/* Generated by Cython 0.23.4 */

/* BEGIN: Cython Metadata
{
    "distutils": {
        "depends": [
            "/home/aebrahim/cobrapy/glpk.h"
        ], 
        "include_dirs": [
            "/home/aebrahim/cobrapy"
        ], 
        "libraries": [
            "glpk"
        ], 
        "library_dirs": [
            "/home/aebrahim/cobrapy"
        ]
    }
}
END: Cython Metadata */

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

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

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


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

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

#define __PYX_HAVE__cobra__solvers__cglpk
#define __PYX_HAVE_API__cobra__solvers__cglpk
#include "glpk.h"
#include "string.h"
#include "stdlib.h"
#include "stdio.h"
#include "pythread.h"
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

#ifdef PYREX_WITHOUT_ASSERTIONS
#define CYTHON_WITHOUT_ASSERTIONS
#endif

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

#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
#define __PYX_DEFAULT_STRING_ENCODING ""
#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#define __Pyx_uchar_cast(c) ((unsigned char)c)
#define __Pyx_long_cast(x) ((long)x)
#define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (\
    (sizeof(type) < sizeof(Py_ssize_t))  ||\
    (sizeof(type) > sizeof(Py_ssize_t) &&\
          likely(v < (type)PY_SSIZE_T_MAX ||\
                 v == (type)PY_SSIZE_T_MAX)  &&\
          (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
                                v == (type)PY_SSIZE_T_MIN)))  ||\
    (sizeof(type) == sizeof(Py_ssize_t) &&\
          (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
                               v == (type)PY_SSIZE_T_MAX)))  )
#if defined (__cplusplus) && __cplusplus >= 201103L
    #include <cstdlib>
    #define __Pyx_sst_abs(value) std::abs(value)
#elif SIZEOF_INT >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) abs(value)
#elif SIZEOF_LONG >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) labs(value)
#elif defined (_MSC_VER) && defined (_M_X64)
    #define __Pyx_sst_abs(value) _abs64(value)
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define __Pyx_sst_abs(value) llabs(value)
#elif defined (__GNUC__)
    #define __Pyx_sst_abs(value) __builtin_llabs(value)
#else
    #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
#endif
static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
#define __Pyx_PyBytes_FromString        PyBytes_FromString
#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
#if PY_MAJOR_VERSION < 3
    #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#else
    #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
#endif
#define __Pyx_PyObject_AsSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_FromCString(s)  __Pyx_PyObject_FromString((const char*)s)
#define __Pyx_PyBytes_FromCString(s)   __Pyx_PyBytes_FromString((const char*)s)
#define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
#define __Pyx_PyStr_FromCString(s)     __Pyx_PyStr_FromString((const char*)s)
#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
#if PY_MAJOR_VERSION < 3
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
{
    const Py_UNICODE *u_end = u;
    while (*u_end++) ;
    return (size_t)(u_end - u - 1);
}
#else
#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
#endif
#define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
#define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
#if CYTHON_COMPILING_IN_CPYTHON
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#else
#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
#endif
#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
static int __Pyx_sys_getdefaultencoding_not_ascii;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
    PyObject* sys;
    PyObject* default_encoding = NULL;
    PyObject* ascii_chars_u = NULL;
    PyObject* ascii_chars_b = NULL;
    const char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (!sys) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
    Py_DECREF(sys);
    if (!default_encoding) goto bad;
    default_encoding_c = PyBytes_AsString(default_encoding);
    if (!default_encoding_c) goto bad;
    if (strcmp(default_encoding_c, "ascii") == 0) {
        __Pyx_sys_getdefaultencoding_not_ascii = 0;
    } else {
        char ascii_chars[128];
        int c;
        for (c = 0; c < 128; c++) {
            ascii_chars[c] = c;
        }
        __Pyx_sys_getdefaultencoding_not_ascii = 1;
        ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
        if (!ascii_chars_u) goto bad;
        ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
        if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
            PyErr_Format(
                PyExc_ValueError,
                "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
                default_encoding_c);
            goto bad;
        }
        Py_DECREF(ascii_chars_u);
        Py_DECREF(ascii_chars_b);
    }
    Py_DECREF(default_encoding);
    return 0;
bad:
    Py_XDECREF(default_encoding);
    Py_XDECREF(ascii_chars_u);
    Py_XDECREF(ascii_chars_b);
    return -1;
}
#endif
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
#else
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
static char* __PYX_DEFAULT_STRING_ENCODING;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
    PyObject* sys;
    PyObject* default_encoding = NULL;
    char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (!sys) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
    Py_DECREF(sys);
    if (!default_encoding) goto bad;
    default_encoding_c = PyBytes_AsString(default_encoding);
    if (!default_encoding_c) goto bad;
    __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
    if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
    strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
    Py_DECREF(default_encoding);
    return 0;
bad:
    Py_XDECREF(default_encoding);
    return -1;
}
#endif
#endif


/* Test for GCC > 2.95 */
#if defined(__GNUC__)     && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
  #define likely(x)   __builtin_expect(!!(x), 1)
  #define unlikely(x) __builtin_expect(!!(x), 0)
#else /* !__GNUC__ or GCC < 2.95 */
  #define likely(x)   (x)
  #define unlikely(x) (x)
#endif /* __GNUC__ */

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


static const char *__pyx_f[] = {
  "cobra/solvers/cglpk.pyx",
  "type.pxd",
  "bool.pxd",
  "complex.pxd",
};

/*--- Type declarations ---*/
struct __pyx_obj_5cobra_7solvers_5cglpk_GLP;

/* "cobra/solvers/cglpk.pyx":137
 * 
 * 
 * cdef class GLP:             # <<<<<<<<<<<<<<
 *     cdef glp_prob *glp
 *     cdef glp_smcp parameters
 */
struct __pyx_obj_5cobra_7solvers_5cglpk_GLP {
  PyObject_HEAD
  struct __pyx_vtabstruct_5cobra_7solvers_5cglpk_GLP *__pyx_vtab;
  glp_prob *glp;
  glp_smcp parameters;
  glp_iocp integer_parameters;
  PyBoolObject *exact;
};



struct __pyx_vtabstruct_5cobra_7solvers_5cglpk_GLP {
  PyObject *(*change_variable_bounds)(struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *, int, double, double, int __pyx_skip_dispatch);
  PyObject *(*set_objective_sense)(struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*set_parameter)(struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *, PyObject *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*get_objective_value)(struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *, int __pyx_skip_dispatch);
  PyObject *(*change_variable_objective)(struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *, int, double, int __pyx_skip_dispatch);
  PyObject *(*is_mip)(struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_5cobra_7solvers_5cglpk_GLP *__pyx_vtabptr_5cobra_7solvers_5cglpk_GLP;

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

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

static PyObject *__Pyx_GetBuiltinName(PyObject *name);

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

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

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

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

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

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

static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);

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

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

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

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

#include <string.h>

static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);

static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);

#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
#else
#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
#endif

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

static CYTHON_INLINE int __Pyx_IterFinish(void);

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

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

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

static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);

static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);

static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);

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

static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);

static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index);

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

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

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

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

static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d);

typedef struct {
    PyObject *type;
    PyObject **method_name;
    PyCFunction func;
    PyObject *method;
    int flag;
} __Pyx_CachedCFunction;

static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_CallUnboundCMethod0(cfunc, self)\
    ((likely((cfunc)->func)) ?\
        (likely((cfunc)->flag == METH_NOARGS) ?  (*((cfunc)->func))(self, NULL) :\
         (likely((cfunc)->flag == (METH_VARARGS | METH_KEYWORDS)) ?  ((*(PyCFunctionWithKeywords)(cfunc)->func)(self, __pyx_empty_tuple, NULL)) :\
             ((cfunc)->flag == METH_VARARGS ?  (*((cfunc)->func))(self, __pyx_empty_tuple) : __Pyx__CallUnboundCMethod0(cfunc, self)))) :\
        __Pyx__CallUnboundCMethod0(cfunc, self))
#else
#define __Pyx_CallUnboundCMethod0(cfunc, self)  __Pyx__CallUnboundCMethod0(cfunc, self)
#endif

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

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

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

static double __Pyx__PyObject_AsDouble(PyObject* obj);
#if CYTHON_COMPILING_IN_PYPY
#define __Pyx_PyObject_AsDouble(obj)\
(likely(PyFloat_CheckExact(obj)) ? PyFloat_AS_DOUBLE(obj) :\
 likely(PyInt_CheckExact(obj)) ?\
 PyFloat_AsDouble(obj) : __Pyx__PyObject_AsDouble(obj))
#else
#define __Pyx_PyObject_AsDouble(obj)\
((likely(PyFloat_CheckExact(obj))) ?\
 PyFloat_AS_DOUBLE(obj) : __Pyx__PyObject_AsDouble(obj))
#endif

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

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

#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL)
static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_setattro))
        return tp->tp_setattro(obj, attr_name, value);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_setattr))
        return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
#endif
    return PyObject_SetAttr(obj, attr_name, value);
}
#else
#define __Pyx_PyObject_DelAttrStr(o,n)   PyObject_DelAttr(o,n)
#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
#endif

#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000
static CYTHON_INLINE PyObject* __Pyx_PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name) {
    PyObject *res;
    PyTypeObject *tp = Py_TYPE(obj);
#if PY_MAJOR_VERSION < 3
    if (unlikely(PyInstance_Check(obj)))
        return __Pyx_PyObject_GetAttrStr(obj, attr_name);
#endif
    res = _PyType_Lookup(tp, attr_name);
    if (likely(res)) {
        descrgetfunc f = Py_TYPE(res)->tp_descr_get;
        if (!f) {
            Py_INCREF(res);
        } else {
            res = f(res, obj, (PyObject *)tp);
        }
    } else {
        PyErr_SetObject(PyExc_AttributeError, attr_name);
    }
    return res;
}
#else
#define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n)
#endif

static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);

static int __Pyx_PyBytes_SingleTailmatch(PyObject* self, PyObject* arg,
                                         Py_ssize_t start, Py_ssize_t end, int direction);
static int __Pyx_PyBytes_Tailmatch(PyObject* self, PyObject* substr,
                                   Py_ssize_t start, Py_ssize_t end, int direction);

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

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

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

static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);

static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
                                           PyObject *mkw, PyObject *modname, PyObject *doc);
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
                                      PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass);

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

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

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

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);

static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);

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

static int __Pyx_PrintOne(PyObject* stream, PyObject *o);

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);

#include "descrobject.h"
static PyObject* __Pyx_Method_ClassMethod(PyObject *method);

static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);

static int __Pyx_check_binary_version(void);

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

static PyObject *__Pyx_ImportModule(const char *name);

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

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);

static PyObject *__pyx_f_5cobra_7solvers_5cglpk_3GLP_change_variable_bounds(struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *__pyx_v_self, int __pyx_v_index, double __pyx_v_lower_bound, double __pyx_v_upper_bound, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_5cobra_7solvers_5cglpk_3GLP_set_objective_sense(struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *__pyx_v_self, PyObject *__pyx_v_objective_sense, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_5cobra_7solvers_5cglpk_3GLP_set_parameter(struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *__pyx_v_self, PyObject *__pyx_v_parameter_name, PyObject *__pyx_v_value, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_5cobra_7solvers_5cglpk_3GLP_get_objective_value(struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_5cobra_7solvers_5cglpk_3GLP_change_variable_objective(struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *__pyx_v_self, int __pyx_v_index, double __pyx_v_value, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_5cobra_7solvers_5cglpk_3GLP_is_mip(struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/

/* Module declarations from 'cobra.solvers.glpk' */

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

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

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

/* Module declarations from '__builtin__' */

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

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

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

/* 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 'cpython.sequence' */

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

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

/* 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 'cobra.solvers.cglpk' */
static PyTypeObject *__pyx_ptype_5cobra_7solvers_5cglpk_GLP = 0;
static PyObject *__pyx_v_5cobra_7solvers_5cglpk_ERROR_CODES = 0;
static PyObject *__pyx_v_5cobra_7solvers_5cglpk_ERROR_MESSAGES = 0;
static PyObject *__pyx_v_5cobra_7solvers_5cglpk_METHODS = 0;
static PyObject *__pyx_v_5cobra_7solvers_5cglpk_PRICINGS = 0;
static PyObject *__pyx_v_5cobra_7solvers_5cglpk_RATIOS = 0;
static PyObject *__pyx_v_5cobra_7solvers_5cglpk_SCALINGS = 0;
static int __pyx_f_5cobra_7solvers_5cglpk_downcast_pos_size(Py_ssize_t); /*proto*/
static PyObject *__pyx_f_5cobra_7solvers_5cglpk_check_error(int); /*proto*/
static int __pyx_f_5cobra_7solvers_5cglpk_hook(void *, char const *); /*proto*/
static int __pyx_f_5cobra_7solvers_5cglpk_silent_hook(void *, char const *); /*proto*/
static double __pyx_f_5cobra_7solvers_5cglpk__to_double(PyObject *); /*proto*/
static PyObject *__pyx_f_5cobra_7solvers_5cglpk_change_variable_bounds(PyObject *, int, double, double, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_5cobra_7solvers_5cglpk_change_variable_objective(PyObject *, int, double, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_5cobra_7solvers_5cglpk_change_coefficient(PyObject *, int, int, double, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_5cobra_7solvers_5cglpk_set_parameter(PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_5cobra_7solvers_5cglpk_get_status(PyObject *, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_5cobra_7solvers_5cglpk_get_objective_value(PyObject *, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_5cobra_7solvers_5cglpk_format_solution(PyObject *, PyObject *, int __pyx_skip_dispatch); /*proto*/
#define __Pyx_MODULE_NAME "cobra.solvers.cglpk"
int __pyx_module_is_main_cobra__solvers__cglpk = 0;

/* Implementation of 'cobra.solvers.cglpk' */
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_RuntimeError;
static PyObject *__pyx_builtin_enumerate;
static PyObject *__pyx_builtin_MemoryError;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_open;
static PyObject *__pyx_builtin_IOError;
static char __pyx_k_E[] = "E";
static char __pyx_k_G[] = "G";
static char __pyx_k_L[] = "L";
static char __pyx_k_r[] = "r";
static char __pyx_k_w[] = "w";
static char __pyx_k_x[] = "x";
static char __pyx_k_y[] = "y";
static char __pyx_k_2n[] = "2n";
static char __pyx_k_eq[] = "eq";
static char __pyx_k_gm[] = "gm";
static char __pyx_k_id[] = "id";
static char __pyx_k_lp[] = ".lp";
static char __pyx_k_os[] = "os";
static char __pyx_k_all[] = "all";
static char __pyx_k_doc[] = "__doc__";
static char __pyx_k_end[] = "end";
static char __pyx_k_err[] = "err";
static char __pyx_k_har[] = "har";
static char __pyx_k_mps[] = ".mps";
static char __pyx_k_pse[] = "pse";
static char __pyx_k_std[] = "std";
static char __pyx_k_auto[] = "auto";
static char __pyx_k_dual[] = "dual";
static char __pyx_k_exit[] = "__exit__";
static char __pyx_k_file[] = "file";
static char __pyx_k_lp_2[] = "lp";
static char __pyx_k_main[] = "__main__";
static char __pyx_k_mode[] = "mode";
static char __pyx_k_name[] = "name";
static char __pyx_k_open[] = "open";
static char __pyx_k_read[] = "read";
static char __pyx_k_skip[] = "skip";
static char __pyx_k_test[] = "__test__";
static char __pyx_k_warn[] = "_warn";
static char __pyx_k_Basic[] = "Basic";
static char __pyx_k_bound[] = "_bound";
static char __pyx_k_cglpk[] = "cglpk";
static char __pyx_k_class[] = "__class__";
static char __pyx_k_close[] = "close";
static char __pyx_k_enter[] = "__enter__";
static char __pyx_k_exact[] = "exact";
static char __pyx_k_index[] = "index";
static char __pyx_k_items[] = "items";
static char __pyx_k_lower[] = "lower";
static char __pyx_k_print[] = "print";
static char __pyx_k_range[] = "range";
static char __pyx_k_scale[] = "scale";
static char __pyx_k_solve[] = "solve";
static char __pyx_k_sympy[] = "sympy";
static char __pyx_k_value[] = "value";
static char __pyx_k_write[] = "write";
static char __pyx_k_Number[] = "Number";
static char __pyx_k_delete[] = "delete";
static char __pyx_k_failed[] = "failed";
static char __pyx_k_import[] = "__import__";
static char __pyx_k_is_mip[] = "is_mip";
static char __pyx_k_kwargs[] = "kwargs";
static char __pyx_k_module[] = "__module__";
static char __pyx_k_normal[] = "normal";
static char __pyx_k_primal[] = "primal";
static char __pyx_k_r_test[] = "r_test";
static char __pyx_k_status[] = "status";
static char __pyx_k_tm_lim[] = "tm_lim";
static char __pyx_k_tol_dj[] = "tol_dj";
static char __pyx_k_unlink[] = "_unlink";
static char __pyx_k_warn_2[] = "warn";
static char __pyx_k_x_dict[] = "x_dict";
static char __pyx_k_y_dict[] = "y_dict";
static char __pyx_k_IOError[] = "IOError";
static char __pyx_k_MIP_gap[] = "MIP_gap";
static char __pyx_k_integer[] = "integer";
static char __pyx_k_latin_1[] = "latin-1";
static char __pyx_k_mip_gap[] = "mip_gap";
static char __pyx_k_optimal[] = "optimal";
static char __pyx_k_prepare[] = "__prepare__";
static char __pyx_k_pricing[] = "pricing";
static char __pyx_k_threads[] = "threads";
static char __pyx_k_tol_bnd[] = "tol_bnd";
static char __pyx_k_tol_int[] = "tol_int";
static char __pyx_k_tol_piv[] = "tol_piv";
static char __pyx_k_verbose[] = "verbose";
static char __pyx_k_getstate[] = "__getstate__";
static char __pyx_k_maximize[] = "maximize";
static char __pyx_k_minimize[] = "minimize";
static char __pyx_k_presolve[] = "presolve";
static char __pyx_k_qualname[] = "__qualname__";
static char __pyx_k_solution[] = "solution";
static char __pyx_k_tempfile[] = "tempfile";
static char __pyx_k_unlink_2[] = "unlink";
static char __pyx_k_warnings[] = "warnings";
static char __pyx_k_GLP_EBADB[] = "GLP_EBADB";
static char __pyx_k_GLP_ECOND[] = "GLP_ECOND";
static char __pyx_k_GLP_EDATA[] = "GLP_EDATA";
static char __pyx_k_GLP_EFAIL[] = "GLP_EFAIL";
static char __pyx_k_GLP_EROOT[] = "GLP_EROOT";
static char __pyx_k_GLP_ESING[] = "GLP_ESING";
static char __pyx_k_GLP_ESTOP[] = "GLP_ESTOP";
static char __pyx_k_enumerate[] = "enumerate";
static char __pyx_k_iteritems[] = "iteritems";
static char __pyx_k_lp_method[] = "lp_method";
static char __pyx_k_met_index[] = "met_index";
static char __pyx_k_metaclass[] = "__metaclass__";
static char __pyx_k_reactions[] = "reactions";
static char __pyx_k_rxn_index[] = "rxn_index";
static char __pyx_k_unbounded[] = "unbounded";
static char __pyx_k_undefined[] = "undefined";
static char __pyx_k_GLP_EBOUND[] = "GLP_EBOUND";
static char __pyx_k_GLP_EITLIM[] = "GLP_EITLIM";
static char __pyx_k_GLP_ENOCVG[] = "GLP_ENOCVG";
static char __pyx_k_GLP_ENODFS[] = "GLP_ENODFS";
static char __pyx_k_GLP_ENOPFS[] = "GLP_ENOPFS";
static char __pyx_k_GLP_EOBJLL[] = "GLP_EOBJLL";
static char __pyx_k_GLP_EOBJUL[] = "GLP_EOBJUL";
static char __pyx_k_GLP_ERANGE[] = "GLP_ERANGE";
static char __pyx_k_GLP_ETMLIM[] = "GLP_ETMLIM";
static char __pyx_k_ValueError[] = "ValueError";
static char __pyx_k_get_status[] = "get_status";
static char __pyx_k_infeasible[] = "infeasible";
static char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
static char __pyx_k_time_limit[] = "time_limit";
static char __pyx_k_GLP_EINSTAB[] = "GLP_EINSTAB";
static char __pyx_k_GLP_EMIPGAP[] = "GLP_EMIPGAP";
static char __pyx_k_GLP_ENOFEAS[] = "GLP_ENOFEAS";
static char __pyx_k_MIP_gap_abs[] = "MIP_gap_abs";
static char __pyx_k_MemoryError[] = "MemoryError";
static char __pyx_k_cobra_model[] = "cobra_model";
static char __pyx_k_lower_bound[] = "lower_bound";
static char __pyx_k_metabolites[] = "metabolites";
static char __pyx_k_solver_name[] = "solver_name";
static char __pyx_k_upper_bound[] = "upper_bound";
static char __pyx_k_RuntimeError[] = "RuntimeError";
static char __pyx_k_glpk_version[] = "__glpk_version__";
static char __pyx_k_invalid_data[] = "invalid data";
static char __pyx_k_SUPPORTS_MILP[] = "_SUPPORTS_MILP";
static char __pyx_k_invalid_basis[] = "invalid basis";
static char __pyx_k_metabolites_2[] = "_metabolites";
static char __pyx_k_set_parameter[] = "set_parameter";
static char __pyx_k_solve_problem[] = "solve_problem";
static char __pyx_k_solver_failed[] = "solver failed";
static char __pyx_k_variable_kind[] = "variable_kind";
static char __pyx_k_create_problem[] = "create_problem";
static char __pyx_k_invalid_bounds[] = "invalid bounds";
static char __pyx_k_no_convergence[] = "no convergence";
static char __pyx_k_parameter_name[] = "parameter_name";
static char __pyx_k_format_solution[] = "format_solution";
static char __pyx_k_iteration_limit[] = "iteration_limit";
static char __pyx_k_objective_sense[] = "objective_sense";
static char __pyx_k_singular_matrix[] = "singular matrix";
static char __pyx_k_constraint_sense[] = "_constraint_sense";
static char __pyx_k_tolerance_integer[] = "tolerance_integer";
static char __pyx_k_unknown_parameter[] = "unknown parameter ";
static char __pyx_k_NamedTemporaryFile[] = "_NamedTemporaryFile";
static char __pyx_k_change_coefficient[] = "change_coefficient";
static char __pyx_k_cobra_solvers_cglpk[] = "cobra.solvers.cglpk";
static char __pyx_k_get_objective_value[] = "get_objective_value";
static char __pyx_k_quadratic_component[] = "quadratic_component";
static char __pyx_k_result_out_of_range[] = "result out of range";
static char __pyx_k_set_objective_sense[] = "set_objective_sense";
static char __pyx_k_time_limit_exceeded[] = "time limit exceeded";
static char __pyx_k_tolerance_markowitz[] = "tolerance_markowitz";
static char __pyx_k_Integer_overflow_d_d[] = "Integer overflow %d > %d";
static char __pyx_k_NamedTemporaryFile_2[] = "NamedTemporaryFile";
static char __pyx_k_numerical_instability[] = "numerical instability";
static char __pyx_k_objective_coefficient[] = "objective_coefficient";
static char __pyx_k_tolerance_feasibility[] = "tolerance_feasibility";
static char __pyx_k_Unknown_python_version[] = "Unknown python version";
static char __pyx_k_change_variable_bounds[] = "change_variable_bounds";
static char __pyx_k_exact___builtin___bool[] = "exact: __builtin__.bool";
static char __pyx_k_ill_conditioned_matrix[] = "ill-conditioned matrix";
static char __pyx_k_iteration_limit_exceeded[] = "iteration limit exceeded";
static char __pyx_k_unsupported_bound_type_s[] = "unsupported bound type: %s";
static char __pyx_k_Unknown_file_format_for_s[] = "Unknown file format for %s";
static char __pyx_k_change_variable_objective[] = "change_variable_objective";
static char __pyx_k_no_dual_feasible_solution[] = "no dual feasible solution";
static char __pyx_k_no_primal_feasible_solution[] = "no primal feasible solution";
static char __pyx_k_failed_to_write_LP_to_file_s[] = "failed to write LP to file %s";
static char __pyx_k_root_LP_optimum_not_provided[] = "root LP optimum not provided";
static char __pyx_k_objective_lower_limit_reached[] = "objective lower limit reached";
static char __pyx_k_objective_upper_limit_reached[] = "objective upper limit reached";
static char __pyx_k_multiple_threads_not_supported[] = "multiple threads not supported";
static char __pyx_k_Bindings_to_GLPK_The_GNU_Linear[] = "Bindings to GLPK\n\nThe GNU Linear Programming Kit (GLPK) is released under the GPL.\nThe source can be downloaded from http://www.gnu.org/software/glpk/\n\nThe GNU Multiple Precision Arithmetic Library (GMP) is released under the GPL.\nThe source can be downloaded from https://gmplib.org/\n\n";
static char __pyx_k_glp_simplex_failed_with_unknown[] = "glp_simplex failed with unknown error code 0x%x";
static char __pyx_k_home_aebrahim_cobrapy_cobra_sol[] = "/home/aebrahim/cobrapy/cobra/solvers/cglpk.pyx";
static char __pyx_k_s_is_not_a_valid_objective_sens[] = "%s is not a valid objective sense";
static char __pyx_k_glp_simplex_failed_with_error_co[] = "glp_simplex failed with error code %s: %s";
static char __pyx_k_no_primal_dual_feasible_solution[] = "no primal/dual feasible solution";
static char __pyx_k_quadratic_component_must_be_None[] = "quadratic component must be None for glpk";
static char __pyx_k_relative_mip_gap_tolerance_reach[] = "relative mip gap tolerance reached";
static char __pyx_k_search_terminated_by_application[] = "search terminated by application";
static char __pyx_k_setting_aboslute_mip_gap_not_sup[] = "setting aboslute mip gap not supported";
static PyObject *__pyx_kp_s_2n;
static PyObject *__pyx_n_s_Basic;
static PyObject *__pyx_kp_s_Bindings_to_GLPK_The_GNU_Linear;
static PyObject *__pyx_n_s_E;
static PyObject *__pyx_n_s_G;
static PyObject *__pyx_n_s_GLP_EBADB;
static PyObject *__pyx_n_s_GLP_EBOUND;
static PyObject *__pyx_n_s_GLP_ECOND;
static PyObject *__pyx_n_s_GLP_EDATA;
static PyObject *__pyx_n_s_GLP_EFAIL;
static PyObject *__pyx_n_s_GLP_EINSTAB;
static PyObject *__pyx_n_s_GLP_EITLIM;
static PyObject *__pyx_n_s_GLP_EMIPGAP;
static PyObject *__pyx_n_s_GLP_ENOCVG;
static PyObject *__pyx_n_s_GLP_ENODFS;
static PyObject *__pyx_n_s_GLP_ENOFEAS;
static PyObject *__pyx_n_s_GLP_ENOPFS;
static PyObject *__pyx_n_s_GLP_EOBJLL;
static PyObject *__pyx_n_s_GLP_EOBJUL;
static PyObject *__pyx_n_s_GLP_ERANGE;
static PyObject *__pyx_n_s_GLP_EROOT;
static PyObject *__pyx_n_s_GLP_ESING;
static PyObject *__pyx_n_s_GLP_ESTOP;
static PyObject *__pyx_n_s_GLP_ETMLIM;
static PyObject *__pyx_n_s_IOError;
static PyObject *__pyx_kp_s_Integer_overflow_d_d;
static PyObject *__pyx_n_s_L;
static PyObject *__pyx_n_s_MIP_gap;
static PyObject *__pyx_n_s_MIP_gap_abs;
static PyObject *__pyx_n_s_MemoryError;
static PyObject *__pyx_n_s_NamedTemporaryFile;
static PyObject *__pyx_n_s_NamedTemporaryFile_2;
static PyObject *__pyx_n_s_Number;
static PyObject *__pyx_n_s_RuntimeError;
static PyObject *__pyx_n_s_SUPPORTS_MILP;
static PyObject *__pyx_kp_s_Unknown_file_format_for_s;
static PyObject *__pyx_kp_s_Unknown_python_version;
static PyObject *__pyx_n_s_ValueError;
static PyObject *__pyx_n_s_all;
static PyObject *__pyx_n_s_auto;
static PyObject *__pyx_n_s_bound;
static PyObject *__pyx_n_s_cglpk;
static PyObject *__pyx_n_s_change_coefficient;
static PyObject *__pyx_n_s_change_variable_bounds;
static PyObject *__pyx_n_s_change_variable_objective;
static PyObject *__pyx_n_s_class;
static PyObject *__pyx_n_s_close;
static PyObject *__pyx_n_s_cobra_model;
static PyObject *__pyx_n_s_cobra_solvers_cglpk;
static PyObject *__pyx_n_s_constraint_sense;
static PyObject *__pyx_n_s_create_problem;
static PyObject *__pyx_n_s_delete;
static PyObject *__pyx_n_s_doc;
static PyObject *__pyx_n_s_dual;
static PyObject *__pyx_n_s_end;
static PyObject *__pyx_n_s_enter;
static PyObject *__pyx_n_s_enumerate;
static PyObject *__pyx_n_s_eq;
static PyObject *__pyx_n_s_err;
static PyObject *__pyx_n_s_exact;
static PyObject *__pyx_n_s_exit;
static PyObject *__pyx_n_s_failed;
static PyObject *__pyx_kp_s_failed_to_write_LP_to_file_s;
static PyObject *__pyx_n_s_file;
static PyObject *__pyx_n_s_format_solution;
static PyObject *__pyx_n_s_get_objective_value;
static PyObject *__pyx_n_s_get_status;
static PyObject *__pyx_n_s_getstate;
static PyObject *__pyx_kp_s_glp_simplex_failed_with_error_co;
static PyObject *__pyx_kp_s_glp_simplex_failed_with_unknown;
static PyObject *__pyx_n_s_glpk_version;
static PyObject *__pyx_n_s_gm;
static PyObject *__pyx_n_s_har;
static PyObject *__pyx_kp_s_home_aebrahim_cobrapy_cobra_sol;
static PyObject *__pyx_n_s_id;
static PyObject *__pyx_kp_s_ill_conditioned_matrix;
static PyObject *__pyx_n_s_import;
static PyObject *__pyx_n_s_index;
static PyObject *__pyx_n_s_infeasible;
static PyObject *__pyx_n_s_integer;
static PyObject *__pyx_kp_s_invalid_basis;
static PyObject *__pyx_kp_s_invalid_bounds;
static PyObject *__pyx_kp_s_invalid_data;
static PyObject *__pyx_n_s_is_mip;
static PyObject *__pyx_n_s_items;
static PyObject *__pyx_n_s_iteration_limit;
static PyObject *__pyx_kp_s_iteration_limit_exceeded;
static PyObject *__pyx_n_s_iteritems;
static PyObject *__pyx_n_s_kwargs;
static PyObject *__pyx_kp_s_latin_1;
static PyObject *__pyx_n_s_lower;
static PyObject *__pyx_n_s_lower_bound;
static PyObject *__pyx_kp_s_lp;
static PyObject *__pyx_n_s_lp_2;
static PyObject *__pyx_n_s_lp_method;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_s_maximize;
static PyObject *__pyx_n_s_met_index;
static PyObject *__pyx_n_s_metabolites;
static PyObject *__pyx_n_s_metabolites_2;
static PyObject *__pyx_n_s_metaclass;
static PyObject *__pyx_n_s_minimize;
static PyObject *__pyx_n_s_mip_gap;
static PyObject *__pyx_n_s_mode;
static PyObject *__pyx_n_s_module;
static PyObject *__pyx_kp_s_mps;
static PyObject *__pyx_kp_s_multiple_threads_not_supported;
static PyObject *__pyx_n_s_name;
static PyObject *__pyx_kp_s_no_convergence;
static PyObject *__pyx_kp_s_no_dual_feasible_solution;
static PyObject *__pyx_kp_s_no_primal_dual_feasible_solution;
static PyObject *__pyx_kp_s_no_primal_feasible_solution;
static PyObject *__pyx_n_s_normal;
static PyObject *__pyx_kp_s_numerical_instability;
static PyObject *__pyx_n_s_objective_coefficient;
static PyObject *__pyx_kp_s_objective_lower_limit_reached;
static PyObject *__pyx_n_s_objective_sense;
static PyObject *__pyx_kp_s_objective_upper_limit_reached;
static PyObject *__pyx_n_s_open;
static PyObject *__pyx_n_s_optimal;
static PyObject *__pyx_n_s_os;
static PyObject *__pyx_n_s_parameter_name;
static PyObject *__pyx_n_s_prepare;
static PyObject *__pyx_n_s_presolve;
static PyObject *__pyx_n_s_pricing;
static PyObject *__pyx_n_s_primal;
static PyObject *__pyx_n_s_print;
static PyObject *__pyx_n_s_pse;
static PyObject *__pyx_n_s_pyx_vtable;
static PyObject *__pyx_n_s_quadratic_component;
static PyObject *__pyx_kp_s_quadratic_component_must_be_None;
static PyObject *__pyx_n_s_qualname;
static PyObject *__pyx_n_s_r;
static PyObject *__pyx_n_s_r_test;
static PyObject *__pyx_n_s_range;
static PyObject *__pyx_n_s_reactions;
static PyObject *__pyx_n_s_read;
static PyObject *__pyx_kp_s_relative_mip_gap_tolerance_reach;
static PyObject *__pyx_kp_s_result_out_of_range;
static PyObject *__pyx_kp_s_root_LP_optimum_not_provided;
static PyObject *__pyx_n_s_rxn_index;
static PyObject *__pyx_kp_s_s_is_not_a_valid_objective_sens;
static PyObject *__pyx_n_s_scale;
static PyObject *__pyx_kp_s_search_terminated_by_application;
static PyObject *__pyx_n_s_set_objective_sense;
static PyObject *__pyx_n_s_set_parameter;
static PyObject *__pyx_kp_s_setting_aboslute_mip_gap_not_sup;
static PyObject *__pyx_kp_s_singular_matrix;
static PyObject *__pyx_n_s_skip;
static PyObject *__pyx_n_s_solution;
static PyObject *__pyx_n_s_solve;
static PyObject *__pyx_n_s_solve_problem;
static PyObject *__pyx_kp_s_solver_failed;
static PyObject *__pyx_n_s_solver_name;
static PyObject *__pyx_n_s_status;
static PyObject *__pyx_n_s_std;
static PyObject *__pyx_n_s_sympy;
static PyObject *__pyx_n_s_tempfile;
static PyObject *__pyx_n_s_test;
static PyObject *__pyx_n_s_threads;
static PyObject *__pyx_n_s_time_limit;
static PyObject *__pyx_kp_s_time_limit_exceeded;
static PyObject *__pyx_n_s_tm_lim;
static PyObject *__pyx_n_s_tol_bnd;
static PyObject *__pyx_n_s_tol_dj;
static PyObject *__pyx_n_s_tol_int;
static PyObject *__pyx_n_s_tol_piv;
static PyObject *__pyx_n_s_tolerance_feasibility;
static PyObject *__pyx_n_s_tolerance_integer;
static PyObject *__pyx_n_s_tolerance_markowitz;
static PyObject *__pyx_n_s_unbounded;
static PyObject *__pyx_n_s_undefined;
static PyObject *__pyx_kp_s_unknown_parameter;
static PyObject *__pyx_n_s_unlink;
static PyObject *__pyx_n_s_unlink_2;
static PyObject *__pyx_kp_s_unsupported_bound_type_s;
static PyObject *__pyx_n_s_upper_bound;
static PyObject *__pyx_n_s_value;
static PyObject *__pyx_n_s_variable_kind;
static PyObject *__pyx_n_s_verbose;
static PyObject *__pyx_n_s_w;
static PyObject *__pyx_n_s_warn;
static PyObject *__pyx_n_s_warn_2;
static PyObject *__pyx_n_s_warnings;
static PyObject *__pyx_n_s_write;
static PyObject *__pyx_n_s_x;
static PyObject *__pyx_n_s_x_dict;
static PyObject *__pyx_n_s_y;
static PyObject *__pyx_n_s_y_dict;
static int __pyx_pf_5cobra_7solvers_5cglpk_3GLP___cinit__(struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *__pyx_v_self); /* proto */
static void __pyx_pf_5cobra_7solvers_5cglpk_3GLP_2__dealloc__(struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *__pyx_v_self); /* proto */
static int __pyx_pf_5cobra_7solvers_5cglpk_3GLP_4__init__(struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *__pyx_v_self, PyObject *__pyx_v_cobra_model); /* proto */
static PyObject *__pyx_pf_5cobra_7solvers_5cglpk_3GLP_6create_problem(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_cobra_model, PyObject *__pyx_v_objective_sense); /* proto */
static PyObject *__pyx_pf_5cobra_7solvers_5cglpk_3GLP_8change_variable_bounds(struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *__pyx_v_self, int __pyx_v_index, double __pyx_v_lower_bound, double __pyx_v_upper_bound); /* proto */
static PyObject *__pyx_pf_5cobra_7solvers_5cglpk_3GLP_10change_coefficient(struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *__pyx_v_self, int __pyx_v_met_index, int __pyx_v_rxn_index, double __pyx_v_value); /* proto */
static PyObject *__pyx_pf_5cobra_7solvers_5cglpk_3GLP_12solve_problem(struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *__pyx_v_self, PyObject *__pyx_v_solver_parameters); /* proto */
static PyObject *__pyx_pf_5cobra_7solvers_5cglpk_3GLP_14solve(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_cobra_model, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_5cobra_7solvers_5cglpk_3GLP_16get_status(struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5cobra_7solvers_5cglpk_3GLP_18set_objective_sense(struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *__pyx_v_self, PyObject *__pyx_v_objective_sense); /* proto */
static PyObject *__pyx_pf_5cobra_7solvers_5cglpk_3GLP_20set_parameter(struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *__pyx_v_self, PyObject *__pyx_v_parameter_name, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5cobra_7solvers_5cglpk_3GLP_22get_objective_value(struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5cobra_7solvers_5cglpk_3GLP_24change_variable_objective(struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *__pyx_v_self, int __pyx_v_index, double __pyx_v_value); /* proto */
static PyObject *__pyx_pf_5cobra_7solvers_5cglpk_3GLP_26is_mip(struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5cobra_7solvers_5cglpk_3GLP_28format_solution(struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *__pyx_v_self, PyObject *__pyx_v_cobra_model); /* proto */
static PyObject *__pyx_pf_5cobra_7solvers_5cglpk_3GLP_30__getstate__(struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5cobra_7solvers_5cglpk_3GLP_32__reduce__(struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5cobra_7solvers_5cglpk_3GLP_34__setstate__(struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *__pyx_v_self, PyObject *__pyx_v_state); /* proto */
static PyObject *__pyx_pf_5cobra_7solvers_5cglpk_3GLP_36__copy__(struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5cobra_7solvers_5cglpk_3GLP_38write(struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *__pyx_v_self, PyObject *__pyx_v_filename); /* proto */
static PyObject *__pyx_pf_5cobra_7solvers_5cglpk_3GLP_5exact___get__(struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *__pyx_v_self); /* proto */
static int __pyx_pf_5cobra_7solvers_5cglpk_3GLP_5exact_2__set__(struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5cobra_7solvers_5cglpk_3GLP_5exact_4__del__(struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5cobra_7solvers_5cglpk_set_objective_sense(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lp, PyObject *__pyx_v_objective_sense); /* proto */
static PyObject *__pyx_pf_5cobra_7solvers_5cglpk_2change_variable_bounds(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lp, int __pyx_v_index, double __pyx_v_lower_bound, double __pyx_v_upper_bound); /* proto */
static PyObject *__pyx_pf_5cobra_7solvers_5cglpk_4change_variable_objective(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lp, int __pyx_v_index, double __pyx_v_value); /* proto */
static PyObject *__pyx_pf_5cobra_7solvers_5cglpk_6change_coefficient(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lp, int __pyx_v_met_index, int __pyx_v_rxn_index, double __pyx_v_value); /* proto */
static PyObject *__pyx_pf_5cobra_7solvers_5cglpk_8set_parameter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lp, PyObject *__pyx_v_parameter_name, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5cobra_7solvers_5cglpk_10solve_problem(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lp, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_5cobra_7solvers_5cglpk_12get_status(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lp); /* proto */
static PyObject *__pyx_pf_5cobra_7solvers_5cglpk_14get_objective_value(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lp); /* proto */
static PyObject *__pyx_pf_5cobra_7solvers_5cglpk_16format_solution(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lp, PyObject *__pyx_v_cobra_model); /* proto */
static PyObject *__pyx_tp_new_5cobra_7solvers_5cglpk_GLP(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_items = {0, &__pyx_n_s_items, 0, 0, 0};
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_1000;
static PyObject *__pyx_tuple_;
static PyObject *__pyx_tuple__2;
static PyObject *__pyx_tuple__3;
static PyObject *__pyx_tuple__4;
static PyObject *__pyx_tuple__5;
static PyObject *__pyx_tuple__6;
static PyObject *__pyx_tuple__7;
static PyObject *__pyx_tuple__8;
static PyObject *__pyx_tuple__10;
static PyObject *__pyx_codeobj__9;
static PyObject *__pyx_codeobj__11;

/* "cobra/solvers/cglpk.pyx":102
 * }
 * 
 * cdef int downcast_pos_size(Py_ssize_t size):             # <<<<<<<<<<<<<<
 *     if size > INT_MAX:
 *         raise ValueError("Integer overflow %d > %d" % (size, INT_MAX))
 */

static int __pyx_f_5cobra_7solvers_5cglpk_downcast_pos_size(Py_ssize_t __pyx_v_size) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("downcast_pos_size", 0);

  /* "cobra/solvers/cglpk.pyx":103
 * 
 * cdef int downcast_pos_size(Py_ssize_t size):
 *     if size > INT_MAX:             # <<<<<<<<<<<<<<
 *         raise ValueError("Integer overflow %d > %d" % (size, INT_MAX))
 *     else:
 */
  __pyx_t_1 = ((__pyx_v_size > INT_MAX) != 0);
  if (__pyx_t_1) {

    /* "cobra/solvers/cglpk.pyx":104
 * cdef int downcast_pos_size(Py_ssize_t size):
 *     if size > INT_MAX:
 *         raise ValueError("Integer overflow %d > %d" % (size, INT_MAX))             # <<<<<<<<<<<<<<
 *     else:
 *         return <int> size
 */
    __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyInt_From_int(INT_MAX); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
    __pyx_t_2 = 0;
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Integer_overflow_d_d, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "cobra/solvers/cglpk.pyx":103
 * 
 * cdef int downcast_pos_size(Py_ssize_t size):
 *     if size > INT_MAX:             # <<<<<<<<<<<<<<
 *         raise ValueError("Integer overflow %d > %d" % (size, INT_MAX))
 *     else:
 */
  }

  /* "cobra/solvers/cglpk.pyx":106
 *         raise ValueError("Integer overflow %d > %d" % (size, INT_MAX))
 *     else:
 *         return <int> size             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __pyx_r = ((int)__pyx_v_size);
    goto __pyx_L0;
  }

  /* "cobra/solvers/cglpk.pyx":102
 * }
 * 
 * cdef int downcast_pos_size(Py_ssize_t size):             # <<<<<<<<<<<<<<
 *     if size > INT_MAX:
 *         raise ValueError("Integer overflow %d > %d" % (size, INT_MAX))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("cobra.solvers.cglpk.downcast_pos_size", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cobra/solvers/cglpk.pyx":109
 * 
 * 
 * cdef check_error(int result):             # <<<<<<<<<<<<<<
 *     if result == 0:
 *         return
 */

static PyObject *__pyx_f_5cobra_7solvers_5cglpk_check_error(int __pyx_v_result) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("check_error", 0);

  /* "cobra/solvers/cglpk.pyx":110
 * 
 * cdef check_error(int result):
 *     if result == 0:             # <<<<<<<<<<<<<<
 *         return
 *     if result not in ERROR_CODES:
 */
  __pyx_t_1 = ((__pyx_v_result == 0) != 0);
  if (__pyx_t_1) {

    /* "cobra/solvers/cglpk.pyx":111
 * cdef check_error(int result):
 *     if result == 0:
 *         return             # <<<<<<<<<<<<<<
 *     if result not in ERROR_CODES:
 *         raise RuntimeError("glp_simplex failed with unknown error code 0x%x" %
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "cobra/solvers/cglpk.pyx":110
 * 
 * cdef check_error(int result):
 *     if result == 0:             # <<<<<<<<<<<<<<
 *         return
 *     if result not in ERROR_CODES:
 */
  }

  /* "cobra/solvers/cglpk.pyx":112
 *     if result == 0:
 *         return
 *     if result not in ERROR_CODES:             # <<<<<<<<<<<<<<
 *         raise RuntimeError("glp_simplex failed with unknown error code 0x%x" %
 *                            result)
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely(__pyx_v_5cobra_7solvers_5cglpk_ERROR_CODES == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = (__Pyx_PyDict_ContainsTF(__pyx_t_2, __pyx_v_5cobra_7solvers_5cglpk_ERROR_CODES, Py_NE)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = (__pyx_t_1 != 0);
  if (__pyx_t_3) {

    /* "cobra/solvers/cglpk.pyx":114
 *     if result not in ERROR_CODES:
 *         raise RuntimeError("glp_simplex failed with unknown error code 0x%x" %
 *                            result)             # <<<<<<<<<<<<<<
 *     raise RuntimeError("glp_simplex failed with error code %s: %s" %
 *                        (ERROR_CODES[result], ERROR_MESSAGES[result]))
 */
    __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);

    /* "cobra/solvers/cglpk.pyx":113
 *         return
 *     if result not in ERROR_CODES:
 *         raise RuntimeError("glp_simplex failed with unknown error code 0x%x" %             # <<<<<<<<<<<<<<
 *                            result)
 *     raise RuntimeError("glp_simplex failed with error code %s: %s" %
 */
    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_glp_simplex_failed_with_unknown, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __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 = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "cobra/solvers/cglpk.pyx":112
 *     if result == 0:
 *         return
 *     if result not in ERROR_CODES:             # <<<<<<<<<<<<<<
 *         raise RuntimeError("glp_simplex failed with unknown error code 0x%x" %
 *                            result)
 */
  }

  /* "cobra/solvers/cglpk.pyx":116
 *                            result)
 *     raise RuntimeError("glp_simplex failed with error code %s: %s" %
 *                        (ERROR_CODES[result], ERROR_MESSAGES[result]))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (unlikely(__pyx_v_5cobra_7solvers_5cglpk_ERROR_CODES == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_5cobra_7solvers_5cglpk_ERROR_CODES, __pyx_t_4); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(__pyx_v_5cobra_7solvers_5cglpk_ERROR_MESSAGES == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_5cobra_7solvers_5cglpk_ERROR_MESSAGES, __pyx_t_4); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5);
  __pyx_t_2 = 0;
  __pyx_t_5 = 0;

  /* "cobra/solvers/cglpk.pyx":115
 *         raise RuntimeError("glp_simplex failed with unknown error code 0x%x" %
 *                            result)
 *     raise RuntimeError("glp_simplex failed with error code %s: %s" %             # <<<<<<<<<<<<<<
 *                        (ERROR_CODES[result], ERROR_MESSAGES[result]))
 * 
 */
  __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_glp_simplex_failed_with_error_co, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
  __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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 = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "cobra/solvers/cglpk.pyx":109
 * 
 * 
 * cdef check_error(int result):             # <<<<<<<<<<<<<<
 *     if result == 0:
 *         return
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cobra.solvers.cglpk.check_error", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cobra/solvers/cglpk.pyx":120
 * 
 * 
 * cdef int hook(void *info, const char *s):             # <<<<<<<<<<<<<<
 *     """function to redirect sdout to python stdout"""
 *     print(s)
 */

static int __pyx_f_5cobra_7solvers_5cglpk_hook(CYTHON_UNUSED void *__pyx_v_info, char const *__pyx_v_s) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("hook", 0);

  /* "cobra/solvers/cglpk.pyx":122
 * cdef int hook(void *info, const char *s):
 *     """function to redirect sdout to python stdout"""
 *     print(s)             # <<<<<<<<<<<<<<
 *     return 1
 * 
 */
  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_s); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PrintOne(0, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cobra/solvers/cglpk.pyx":123
 *     """function to redirect sdout to python stdout"""
 *     print(s)
 *     return 1             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 1;
  goto __pyx_L0;

  /* "cobra/solvers/cglpk.pyx":120
 * 
 * 
 * cdef int hook(void *info, const char *s):             # <<<<<<<<<<<<<<
 *     """function to redirect sdout to python stdout"""
 *     print(s)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("cobra.solvers.cglpk.hook", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cobra/solvers/cglpk.pyx":126
 * 
 * 
 * cdef int silent_hook(void *info, const char *s):             # <<<<<<<<<<<<<<
 *     """function to print nothing but trick GLPK into thinking we did"""
 *     return 1
 */

static int __pyx_f_5cobra_7solvers_5cglpk_silent_hook(CYTHON_UNUSED void *__pyx_v_info, CYTHON_UNUSED char const *__pyx_v_s) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("silent_hook", 0);

  /* "cobra/solvers/cglpk.pyx":128
 * cdef int silent_hook(void *info, const char *s):
 *     """function to print nothing but trick GLPK into thinking we did"""
 *     return 1             # <<<<<<<<<<<<<<
 * 
 * cdef double _to_double(value):
 */
  __pyx_r = 1;
  goto __pyx_L0;

  /* "cobra/solvers/cglpk.pyx":126
 * 
 * 
 * cdef int silent_hook(void *info, const char *s):             # <<<<<<<<<<<<<<
 *     """function to print nothing but trick GLPK into thinking we did"""
 *     return 1
 */

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

/* "cobra/solvers/cglpk.pyx":130
 *     return 1
 * 
 * cdef double _to_double(value):             # <<<<<<<<<<<<<<
 *     if isinstance(value, Basic) and not isinstance(value, Number):
 *         return 0.
 */

static double __pyx_f_5cobra_7solvers_5cglpk__to_double(PyObject *__pyx_v_value) {
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  double __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_to_double", 0);

  /* "cobra/solvers/cglpk.pyx":131
 * 
 * cdef double _to_double(value):
 *     if isinstance(value, Basic) and not isinstance(value, Number):             # <<<<<<<<<<<<<<
 *         return 0.
 *     else:
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Basic); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_IsInstance(__pyx_v_value, __pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {
  } else {
    __pyx_t_1 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Number); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyObject_IsInstance(__pyx_v_value, __pyx_t_2); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = ((!(__pyx_t_4 != 0)) != 0);
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cobra/solvers/cglpk.pyx":132
 * cdef double _to_double(value):
 *     if isinstance(value, Basic) and not isinstance(value, Number):
 *         return 0.             # <<<<<<<<<<<<<<
 *     else:
 *         return <double>value
 */
    __pyx_r = 0.;
    goto __pyx_L0;

    /* "cobra/solvers/cglpk.pyx":131
 * 
 * cdef double _to_double(value):
 *     if isinstance(value, Basic) and not isinstance(value, Number):             # <<<<<<<<<<<<<<
 *         return 0.
 *     else:
 */
  }

  /* "cobra/solvers/cglpk.pyx":134
 *         return 0.
 *     else:
 *         return <double>value             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_r = ((double)__pyx_t_5);
    goto __pyx_L0;
  }

  /* "cobra/solvers/cglpk.pyx":130
 *     return 1
 * 
 * cdef double _to_double(value):             # <<<<<<<<<<<<<<
 *     if isinstance(value, Basic) and not isinstance(value, Number):
 *         return 0.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_WriteUnraisable("cobra.solvers.cglpk._to_double", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cobra/solvers/cglpk.pyx":144
 * 
 *     # cython related allocation/dellocation functions
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.glp = glp_create_prob()
 *         # initialize parameters
 */

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

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

static int __pyx_pf_5cobra_7solvers_5cglpk_3GLP___cinit__(struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "cobra/solvers/cglpk.pyx":145
 *     # cython related allocation/dellocation functions
 *     def __cinit__(self):
 *         self.glp = glp_create_prob()             # <<<<<<<<<<<<<<
 *         # initialize parameters
 *         glp_set_obj_dir(self.glp, GLP_MAX)  # default is maximize
 */
  __pyx_v_self->glp = glp_create_prob();

  /* "cobra/solvers/cglpk.pyx":147
 *         self.glp = glp_create_prob()
 *         # initialize parameters
 *         glp_set_obj_dir(self.glp, GLP_MAX)  # default is maximize             # <<<<<<<<<<<<<<
 *         glp_init_smcp(&self.parameters)
 *         glp_init_iocp(&self.integer_parameters)
 */
  glp_set_obj_dir(__pyx_v_self->glp, GLP_MAX);

  /* "cobra/solvers/cglpk.pyx":148
 *         # initialize parameters
 *         glp_set_obj_dir(self.glp, GLP_MAX)  # default is maximize
 *         glp_init_smcp(&self.parameters)             # <<<<<<<<<<<<<<
 *         glp_init_iocp(&self.integer_parameters)
 *         self.exact = False
 */
  glp_init_smcp((&__pyx_v_self->parameters));

  /* "cobra/solvers/cglpk.pyx":149
 *         glp_set_obj_dir(self.glp, GLP_MAX)  # default is maximize
 *         glp_init_smcp(&self.parameters)
 *         glp_init_iocp(&self.integer_parameters)             # <<<<<<<<<<<<<<
 *         self.exact = False
 *         glp_term_hook(hook, NULL)
 */
  glp_init_iocp((&__pyx_v_self->integer_parameters));

  /* "cobra/solvers/cglpk.pyx":150
 *         glp_init_smcp(&self.parameters)
 *         glp_init_iocp(&self.integer_parameters)
 *         self.exact = False             # <<<<<<<<<<<<<<
 *         glp_term_hook(hook, NULL)
 *         self.parameters.msg_lev = GLP_MSG_OFF
 */
  __Pyx_INCREF(Py_False);
  __Pyx_GIVEREF(Py_False);
  __Pyx_GOTREF(__pyx_v_self->exact);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->exact));
  __pyx_v_self->exact = ((PyBoolObject *)Py_False);

  /* "cobra/solvers/cglpk.pyx":151
 *         glp_init_iocp(&self.integer_parameters)
 *         self.exact = False
 *         glp_term_hook(hook, NULL)             # <<<<<<<<<<<<<<
 *         self.parameters.msg_lev = GLP_MSG_OFF
 *         self.integer_parameters.tol_int = 1e-9
 */
  glp_term_hook(__pyx_f_5cobra_7solvers_5cglpk_hook, NULL);

  /* "cobra/solvers/cglpk.pyx":152
 *         self.exact = False
 *         glp_term_hook(hook, NULL)
 *         self.parameters.msg_lev = GLP_MSG_OFF             # <<<<<<<<<<<<<<
 *         self.integer_parameters.tol_int = 1e-9
 * 
 */
  __pyx_v_self->parameters.msg_lev = GLP_MSG_OFF;

  /* "cobra/solvers/cglpk.pyx":153
 *         glp_term_hook(hook, NULL)
 *         self.parameters.msg_lev = GLP_MSG_OFF
 *         self.integer_parameters.tol_int = 1e-9             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __pyx_v_self->integer_parameters.tol_int = 1e-9;

  /* "cobra/solvers/cglpk.pyx":144
 * 
 *     # cython related allocation/dellocation functions
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.glp = glp_create_prob()
 *         # initialize parameters
 */

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

/* "cobra/solvers/cglpk.pyx":155
 *         self.integer_parameters.tol_int = 1e-9
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         glp_delete_prob(self.glp)
 * 
 */

/* Python wrapper */
static void __pyx_pw_5cobra_7solvers_5cglpk_3GLP_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_5cobra_7solvers_5cglpk_3GLP_3__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_5cobra_7solvers_5cglpk_3GLP_2__dealloc__(((struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *)__pyx_v_self));

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

static void __pyx_pf_5cobra_7solvers_5cglpk_3GLP_2__dealloc__(struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "cobra/solvers/cglpk.pyx":156
 * 
 *     def __dealloc__(self):
 *         glp_delete_prob(self.glp)             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, cobra_model=None):
 */
  glp_delete_prob(__pyx_v_self->glp);

  /* "cobra/solvers/cglpk.pyx":155
 *         self.integer_parameters.tol_int = 1e-9
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         glp_delete_prob(self.glp)
 * 
 */

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

/* "cobra/solvers/cglpk.pyx":158
 *         glp_delete_prob(self.glp)
 * 
 *     def __init__(self, cobra_model=None):             # <<<<<<<<<<<<<<
 *         cdef int bound_type, index, n, n_values
 *         cdef glp_prob *glp
 */

/* Python wrapper */
static int __pyx_pw_5cobra_7solvers_5cglpk_3GLP_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_5cobra_7solvers_5cglpk_3GLP_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_cobra_model = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cobra_model,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  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_cobra_model);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __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_cobra_model = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("cobra.solvers.cglpk.GLP.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5cobra_7solvers_5cglpk_3GLP_4__init__(((struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *)__pyx_v_self), __pyx_v_cobra_model);

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

static int __pyx_pf_5cobra_7solvers_5cglpk_3GLP_4__init__(struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *__pyx_v_self, PyObject *__pyx_v_cobra_model) {
  int __pyx_v_bound_type;
  int __pyx_v_index;
  int __pyx_v_n_values;
  glp_prob *__pyx_v_glp;
  int *__pyx_v_c_rows;
  int *__pyx_v_c_cols;
  double *__pyx_v_c_values;
  double __pyx_v_b;
  PyObject *__pyx_v_metabolite_id_to_index = NULL;
  PyObject *__pyx_v_linear_constraint_rows = NULL;
  PyObject *__pyx_v_linear_constraint_cols = NULL;
  PyObject *__pyx_v_linear_constraint_values = NULL;
  PyObject *__pyx_v_metabolite = NULL;
  PyObject *__pyx_v_c = NULL;
  PyObject *__pyx_v_reaction = NULL;
  PyObject *__pyx_v_coefficient = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  glp_prob *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  PyObject *__pyx_t_10 = NULL;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  int __pyx_t_13;
  int __pyx_t_14;
  int __pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "cobra/solvers/cglpk.pyx":166
 *         cdef double b
 * 
 *         if cobra_model is None:             # <<<<<<<<<<<<<<
 *             return
 *         glp = self.glp
 */
  __pyx_t_1 = (__pyx_v_cobra_model == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "cobra/solvers/cglpk.pyx":167
 * 
 *         if cobra_model is None:
 *             return             # <<<<<<<<<<<<<<
 *         glp = self.glp
 *         glp_add_rows(glp, downcast_pos_size(len(cobra_model.metabolites)))
 */
    __pyx_r = 0;
    goto __pyx_L0;

    /* "cobra/solvers/cglpk.pyx":166
 *         cdef double b
 * 
 *         if cobra_model is None:             # <<<<<<<<<<<<<<
 *             return
 *         glp = self.glp
 */
  }

  /* "cobra/solvers/cglpk.pyx":168
 *         if cobra_model is None:
 *             return
 *         glp = self.glp             # <<<<<<<<<<<<<<
 *         glp_add_rows(glp, downcast_pos_size(len(cobra_model.metabolites)))
 *         glp_add_cols(glp, downcast_pos_size(len(cobra_model.reactions)))
 */
  __pyx_t_3 = __pyx_v_self->glp;
  __pyx_v_glp = __pyx_t_3;

  /* "cobra/solvers/cglpk.pyx":169
 *             return
 *         glp = self.glp
 *         glp_add_rows(glp, downcast_pos_size(len(cobra_model.metabolites)))             # <<<<<<<<<<<<<<
 *         glp_add_cols(glp, downcast_pos_size(len(cobra_model.reactions)))
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_cobra_model, __pyx_n_s_metabolites); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  glp_add_rows(__pyx_v_glp, __pyx_f_5cobra_7solvers_5cglpk_downcast_pos_size(__pyx_t_5));

  /* "cobra/solvers/cglpk.pyx":170
 *         glp = self.glp
 *         glp_add_rows(glp, downcast_pos_size(len(cobra_model.metabolites)))
 *         glp_add_cols(glp, downcast_pos_size(len(cobra_model.reactions)))             # <<<<<<<<<<<<<<
 * 
 *         metabolite_id_to_index = {r.id: index for index, r
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_cobra_model, __pyx_n_s_reactions); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  glp_add_cols(__pyx_v_glp, __pyx_f_5cobra_7solvers_5cglpk_downcast_pos_size(__pyx_t_5));

  /* "cobra/solvers/cglpk.pyx":172
 *         glp_add_cols(glp, downcast_pos_size(len(cobra_model.reactions)))
 * 
 *         metabolite_id_to_index = {r.id: index for index, r             # <<<<<<<<<<<<<<
 *                                   in enumerate(cobra_model.metabolites, 1)}
 * 
 */
  { /* enter inner scope */
    int __pyx_7genexpr__pyx_v_index;
    PyObject *__pyx_7genexpr__pyx_v_r = NULL;
    __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = 1;

    /* "cobra/solvers/cglpk.pyx":173
 * 
 *         metabolite_id_to_index = {r.id: index for index, r
 *                                   in enumerate(cobra_model.metabolites, 1)}             # <<<<<<<<<<<<<<
 * 
 *         linear_constraint_rows = []
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_cobra_model, __pyx_n_s_metabolites); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
    __Pyx_GOTREF(__pyx_t_7);
    if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) {
      __pyx_t_8 = __pyx_t_7; __Pyx_INCREF(__pyx_t_8); __pyx_t_5 = 0;
      __pyx_t_9 = NULL;
    } else {
      __pyx_t_5 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    for (;;) {
      if (likely(!__pyx_t_9)) {
        if (likely(PyList_CheckExact(__pyx_t_8))) {
          if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_8)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_7 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
          #else
          __pyx_t_7 = PySequence_ITEM(__pyx_t_8, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
          __Pyx_GOTREF(__pyx_t_7);
          #endif
        } else {
          if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
          #else
          __pyx_t_7 = PySequence_ITEM(__pyx_t_8, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
          __Pyx_GOTREF(__pyx_t_7);
          #endif
        }
      } else {
        __pyx_t_7 = __pyx_t_9(__pyx_t_8);
        if (unlikely(!__pyx_t_7)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_7);
      }
      __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_r, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "cobra/solvers/cglpk.pyx":172
 *         glp_add_cols(glp, downcast_pos_size(len(cobra_model.reactions)))
 * 
 *         metabolite_id_to_index = {r.id: index for index, r             # <<<<<<<<<<<<<<
 *                                   in enumerate(cobra_model.metabolites, 1)}
 * 
 */
      __pyx_7genexpr__pyx_v_index = __pyx_t_6;

      /* "cobra/solvers/cglpk.pyx":173
 * 
 *         metabolite_id_to_index = {r.id: index for index, r
 *                                   in enumerate(cobra_model.metabolites, 1)}             # <<<<<<<<<<<<<<
 * 
 *         linear_constraint_rows = []
 */
      __pyx_t_6 = (__pyx_t_6 + 1);

      /* "cobra/solvers/cglpk.pyx":172
 *         glp_add_cols(glp, downcast_pos_size(len(cobra_model.reactions)))
 * 
 *         metabolite_id_to_index = {r.id: index for index, r             # <<<<<<<<<<<<<<
 *                                   in enumerate(cobra_model.metabolites, 1)}
 * 
 */
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_7genexpr__pyx_v_r, __pyx_n_s_id); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_7genexpr__pyx_v_index); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
      __Pyx_GOTREF(__pyx_t_10);
      if (unlikely(PyDict_SetItem(__pyx_t_4, (PyObject*)__pyx_t_7, (PyObject*)__pyx_t_10))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_7genexpr__pyx_v_r);
    goto __pyx_L9_exit_scope;
    __pyx_L6_error:;
    __Pyx_XDECREF(__pyx_7genexpr__pyx_v_r);
    goto __pyx_L1_error;
    __pyx_L9_exit_scope:;
  } /* exit inner scope */
  __pyx_v_metabolite_id_to_index = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "cobra/solvers/cglpk.pyx":175
 *                                   in enumerate(cobra_model.metabolites, 1)}
 * 
 *         linear_constraint_rows = []             # <<<<<<<<<<<<<<
 *         linear_constraint_cols = []
 *         linear_constraint_values = []
 */
  __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_linear_constraint_rows = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "cobra/solvers/cglpk.pyx":176
 * 
 *         linear_constraint_rows = []
 *         linear_constraint_cols = []             # <<<<<<<<<<<<<<
 *         linear_constraint_values = []
 * 
 */
  __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_linear_constraint_cols = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "cobra/solvers/cglpk.pyx":177
 *         linear_constraint_rows = []
 *         linear_constraint_cols = []
 *         linear_constraint_values = []             # <<<<<<<<<<<<<<
 * 
 *         # set metabolite/consraint bounds
 */
  __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_linear_constraint_values = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "cobra/solvers/cglpk.pyx":180
 * 
 *         # set metabolite/consraint bounds
 *         for index, metabolite in enumerate(cobra_model.metabolites, 1):             # <<<<<<<<<<<<<<
 *             b = _to_double(metabolite._bound)
 *             c = metabolite._constraint_sense
 */
  __pyx_t_6 = 1;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_cobra_model, __pyx_n_s_metabolites); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
    __pyx_t_8 = __pyx_t_4; __Pyx_INCREF(__pyx_t_8); __pyx_t_5 = 0;
    __pyx_t_9 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  for (;;) {
    if (likely(!__pyx_t_9)) {
      if (likely(PyList_CheckExact(__pyx_t_8))) {
        if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_8)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_8, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_8, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_9(__pyx_t_8);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_metabolite, __pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_v_index = __pyx_t_6;
    __pyx_t_6 = (__pyx_t_6 + 1);

    /* "cobra/solvers/cglpk.pyx":181
 *         # set metabolite/consraint bounds
 *         for index, metabolite in enumerate(cobra_model.metabolites, 1):
 *             b = _to_double(metabolite._bound)             # <<<<<<<<<<<<<<
 *             c = metabolite._constraint_sense
 *             if c == 'E':
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_metabolite, __pyx_n_s_bound); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_v_b = __pyx_f_5cobra_7solvers_5cglpk__to_double(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cobra/solvers/cglpk.pyx":182
 *         for index, metabolite in enumerate(cobra_model.metabolites, 1):
 *             b = _to_double(metabolite._bound)
 *             c = metabolite._constraint_sense             # <<<<<<<<<<<<<<
 *             if c == 'E':
 *                 bound_type = GLP_FX  # Set metabolite to steady state levels
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_metabolite, __pyx_n_s_constraint_sense); 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_XDECREF_SET(__pyx_v_c, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "cobra/solvers/cglpk.pyx":183
 *             b = _to_double(metabolite._bound)
 *             c = metabolite._constraint_sense
 *             if c == 'E':             # <<<<<<<<<<<<<<
 *                 bound_type = GLP_FX  # Set metabolite to steady state levels
 *             elif c == 'L':
 */
    __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_c, __pyx_n_s_E, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_2) {

      /* "cobra/solvers/cglpk.pyx":184
 *             c = metabolite._constraint_sense
 *             if c == 'E':
 *                 bound_type = GLP_FX  # Set metabolite to steady state levels             # <<<<<<<<<<<<<<
 *             elif c == 'L':
 *                 bound_type = GLP_UP  # x < 2 <==> x has an upper bound of 2
 */
      __pyx_v_bound_type = GLP_FX;

      /* "cobra/solvers/cglpk.pyx":183
 *             b = _to_double(metabolite._bound)
 *             c = metabolite._constraint_sense
 *             if c == 'E':             # <<<<<<<<<<<<<<
 *                 bound_type = GLP_FX  # Set metabolite to steady state levels
 *             elif c == 'L':
 */
      goto __pyx_L12;
    }

    /* "cobra/solvers/cglpk.pyx":185
 *             if c == 'E':
 *                 bound_type = GLP_FX  # Set metabolite to steady state levels
 *             elif c == 'L':             # <<<<<<<<<<<<<<
 *                 bound_type = GLP_UP  # x < 2 <==> x has an upper bound of 2
 *             elif c == 'G':
 */
    __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_c, __pyx_n_s_L, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_2) {

      /* "cobra/solvers/cglpk.pyx":186
 *                 bound_type = GLP_FX  # Set metabolite to steady state levels
 *             elif c == 'L':
 *                 bound_type = GLP_UP  # x < 2 <==> x has an upper bound of 2             # <<<<<<<<<<<<<<
 *             elif c == 'G':
 *                 bound_type = GLP_LO  # x > 2 <==> x has a lower bound of 2
 */
      __pyx_v_bound_type = GLP_UP;

      /* "cobra/solvers/cglpk.pyx":185
 *             if c == 'E':
 *                 bound_type = GLP_FX  # Set metabolite to steady state levels
 *             elif c == 'L':             # <<<<<<<<<<<<<<
 *                 bound_type = GLP_UP  # x < 2 <==> x has an upper bound of 2
 *             elif c == 'G':
 */
      goto __pyx_L12;
    }

    /* "cobra/solvers/cglpk.pyx":187
 *             elif c == 'L':
 *                 bound_type = GLP_UP  # x < 2 <==> x has an upper bound of 2
 *             elif c == 'G':             # <<<<<<<<<<<<<<
 *                 bound_type = GLP_LO  # x > 2 <==> x has a lower bound of 2
 *             else:
 */
    __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_c, __pyx_n_s_G, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_2) {

      /* "cobra/solvers/cglpk.pyx":188
 *                 bound_type = GLP_UP  # x < 2 <==> x has an upper bound of 2
 *             elif c == 'G':
 *                 bound_type = GLP_LO  # x > 2 <==> x has a lower bound of 2             # <<<<<<<<<<<<<<
 *             else:
 *                 raise ValueError("unsupported bound type: %s" % c)
 */
      __pyx_v_bound_type = GLP_LO;

      /* "cobra/solvers/cglpk.pyx":187
 *             elif c == 'L':
 *                 bound_type = GLP_UP  # x < 2 <==> x has an upper bound of 2
 *             elif c == 'G':             # <<<<<<<<<<<<<<
 *                 bound_type = GLP_LO  # x > 2 <==> x has a lower bound of 2
 *             else:
 */
      goto __pyx_L12;
    }

    /* "cobra/solvers/cglpk.pyx":190
 *                 bound_type = GLP_LO  # x > 2 <==> x has a lower bound of 2
 *             else:
 *                 raise ValueError("unsupported bound type: %s" % c)             # <<<<<<<<<<<<<<
 *             glp_set_row_bnds(glp, index, bound_type, b, b)
 * 
 */
    /*else*/ {
      __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_unsupported_bound_type_s, __pyx_v_c); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 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 = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L12:;

    /* "cobra/solvers/cglpk.pyx":191
 *             else:
 *                 raise ValueError("unsupported bound type: %s" % c)
 *             glp_set_row_bnds(glp, index, bound_type, b, b)             # <<<<<<<<<<<<<<
 * 
 *         # set reaction/varaiable bounds
 */
    glp_set_row_bnds(__pyx_v_glp, __pyx_v_index, __pyx_v_bound_type, __pyx_v_b, __pyx_v_b);

    /* "cobra/solvers/cglpk.pyx":180
 * 
 *         # set metabolite/consraint bounds
 *         for index, metabolite in enumerate(cobra_model.metabolites, 1):             # <<<<<<<<<<<<<<
 *             b = _to_double(metabolite._bound)
 *             c = metabolite._constraint_sense
 */
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "cobra/solvers/cglpk.pyx":194
 * 
 *         # set reaction/varaiable bounds
 *         for index, reaction in enumerate(cobra_model.reactions, 1):             # <<<<<<<<<<<<<<
 *             if reaction.variable_kind == "integer":
 *                 if reaction.lower_bound == 0 and reaction.upper_bound == 1:
 */
  __pyx_t_6 = 1;
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_cobra_model, __pyx_n_s_reactions); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) {
    __pyx_t_4 = __pyx_t_8; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
    __pyx_t_9 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_9 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  for (;;) {
    if (likely(!__pyx_t_9)) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_8 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_8); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_8 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        #endif
      } else {
        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_8); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_8 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        #endif
      }
    } else {
      __pyx_t_8 = __pyx_t_9(__pyx_t_4);
      if (unlikely(!__pyx_t_8)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_8);
    }
    __Pyx_XDECREF_SET(__pyx_v_reaction, __pyx_t_8);
    __pyx_t_8 = 0;
    __pyx_v_index = __pyx_t_6;
    __pyx_t_6 = (__pyx_t_6 + 1);

    /* "cobra/solvers/cglpk.pyx":195
 *         # set reaction/varaiable bounds
 *         for index, reaction in enumerate(cobra_model.reactions, 1):
 *             if reaction.variable_kind == "integer":             # <<<<<<<<<<<<<<
 *                 if reaction.lower_bound == 0 and reaction.upper_bound == 1:
 *                     glp_set_col_kind(self.glp, index, GLP_BV)  # binary
 */
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_reaction, __pyx_n_s_variable_kind); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_8, __pyx_n_s_integer, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (__pyx_t_2) {

      /* "cobra/solvers/cglpk.pyx":196
 *         for index, reaction in enumerate(cobra_model.reactions, 1):
 *             if reaction.variable_kind == "integer":
 *                 if reaction.lower_bound == 0 and reaction.upper_bound == 1:             # <<<<<<<<<<<<<<
 *                     glp_set_col_kind(self.glp, index, GLP_BV)  # binary
 *                 else:
 */
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_reaction, __pyx_n_s_lower_bound); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_10 = __Pyx_PyInt_EqObjC(__pyx_t_8, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (__pyx_t_1) {
      } else {
        __pyx_t_2 = __pyx_t_1;
        goto __pyx_L17_bool_binop_done;
      }
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_reaction, __pyx_n_s_upper_bound); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_8 = __Pyx_PyInt_EqObjC(__pyx_t_10, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_2 = __pyx_t_1;
      __pyx_L17_bool_binop_done:;
      if (__pyx_t_2) {

        /* "cobra/solvers/cglpk.pyx":197
 *             if reaction.variable_kind == "integer":
 *                 if reaction.lower_bound == 0 and reaction.upper_bound == 1:
 *                     glp_set_col_kind(self.glp, index, GLP_BV)  # binary             # <<<<<<<<<<<<<<
 *                 else:
 *                     glp_set_col_kind(self.glp, index, GLP_IV)
 */
        glp_set_col_kind(__pyx_v_self->glp, __pyx_v_index, GLP_BV);

        /* "cobra/solvers/cglpk.pyx":196
 *         for index, reaction in enumerate(cobra_model.reactions, 1):
 *             if reaction.variable_kind == "integer":
 *                 if reaction.lower_bound == 0 and reaction.upper_bound == 1:             # <<<<<<<<<<<<<<
 *                     glp_set_col_kind(self.glp, index, GLP_BV)  # binary
 *                 else:
 */
        goto __pyx_L16;
      }

      /* "cobra/solvers/cglpk.pyx":199
 *                     glp_set_col_kind(self.glp, index, GLP_BV)  # binary
 *                 else:
 *                     glp_set_col_kind(self.glp, index, GLP_IV)             # <<<<<<<<<<<<<<
 *             if reaction.lower_bound == reaction.upper_bound:
 *                 bound_type = GLP_FX
 */
      /*else*/ {
        glp_set_col_kind(__pyx_v_self->glp, __pyx_v_index, GLP_IV);
      }
      __pyx_L16:;

      /* "cobra/solvers/cglpk.pyx":195
 *         # set reaction/varaiable bounds
 *         for index, reaction in enumerate(cobra_model.reactions, 1):
 *             if reaction.variable_kind == "integer":             # <<<<<<<<<<<<<<
 *                 if reaction.lower_bound == 0 and reaction.upper_bound == 1:
 *                     glp_set_col_kind(self.glp, index, GLP_BV)  # binary
 */
    }

    /* "cobra/solvers/cglpk.pyx":200
 *                 else:
 *                     glp_set_col_kind(self.glp, index, GLP_IV)
 *             if reaction.lower_bound == reaction.upper_bound:             # <<<<<<<<<<<<<<
 *                 bound_type = GLP_FX
 *             else:
 */
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_reaction, __pyx_n_s_lower_bound); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_reaction, __pyx_n_s_upper_bound); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_7 = PyObject_RichCompare(__pyx_t_8, __pyx_t_10, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (__pyx_t_2) {

      /* "cobra/solvers/cglpk.pyx":201
 *                     glp_set_col_kind(self.glp, index, GLP_IV)
 *             if reaction.lower_bound == reaction.upper_bound:
 *                 bound_type = GLP_FX             # <<<<<<<<<<<<<<
 *             else:
 *                 bound_type = GLP_DB
 */
      __pyx_v_bound_type = GLP_FX;

      /* "cobra/solvers/cglpk.pyx":200
 *                 else:
 *                     glp_set_col_kind(self.glp, index, GLP_IV)
 *             if reaction.lower_bound == reaction.upper_bound:             # <<<<<<<<<<<<<<
 *                 bound_type = GLP_FX
 *             else:
 */
      goto __pyx_L19;
    }

    /* "cobra/solvers/cglpk.pyx":203
 *                 bound_type = GLP_FX
 *             else:
 *                 bound_type = GLP_DB             # <<<<<<<<<<<<<<
 *             glp_set_col_bnds(glp, index, bound_type,
 *                              _to_double(reaction.lower_bound),
 */
    /*else*/ {
      __pyx_v_bound_type = GLP_DB;
    }
    __pyx_L19:;

    /* "cobra/solvers/cglpk.pyx":205
 *                 bound_type = GLP_DB
 *             glp_set_col_bnds(glp, index, bound_type,
 *                              _to_double(reaction.lower_bound),             # <<<<<<<<<<<<<<
 *                              _to_double(reaction.upper_bound))
 *             glp_set_obj_coef(glp, index,
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_reaction, __pyx_n_s_lower_bound); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);

    /* "cobra/solvers/cglpk.pyx":206
 *             glp_set_col_bnds(glp, index, bound_type,
 *                              _to_double(reaction.lower_bound),
 *                              _to_double(reaction.upper_bound))             # <<<<<<<<<<<<<<
 *             glp_set_obj_coef(glp, index,
 *                              _to_double(reaction.objective_coefficient))
 */
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_reaction, __pyx_n_s_upper_bound); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);

    /* "cobra/solvers/cglpk.pyx":204
 *             else:
 *                 bound_type = GLP_DB
 *             glp_set_col_bnds(glp, index, bound_type,             # <<<<<<<<<<<<<<
 *                              _to_double(reaction.lower_bound),
 *                              _to_double(reaction.upper_bound))
 */
    glp_set_col_bnds(__pyx_v_glp, __pyx_v_index, __pyx_v_bound_type, __pyx_f_5cobra_7solvers_5cglpk__to_double(__pyx_t_7), __pyx_f_5cobra_7solvers_5cglpk__to_double(__pyx_t_10));
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

    /* "cobra/solvers/cglpk.pyx":208
 *                              _to_double(reaction.upper_bound))
 *             glp_set_obj_coef(glp, index,
 *                              _to_double(reaction.objective_coefficient))             # <<<<<<<<<<<<<<
 * 
 *             for metabolite, coefficient in reaction._metabolites.iteritems():
 */
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_reaction, __pyx_n_s_objective_coefficient); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);

    /* "cobra/solvers/cglpk.pyx":207
 *                              _to_double(reaction.lower_bound),
 *                              _to_double(reaction.upper_bound))
 *             glp_set_obj_coef(glp, index,             # <<<<<<<<<<<<<<
 *                              _to_double(reaction.objective_coefficient))
 * 
 */
    glp_set_obj_coef(__pyx_v_glp, __pyx_v_index, __pyx_f_5cobra_7solvers_5cglpk__to_double(__pyx_t_10));
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

    /* "cobra/solvers/cglpk.pyx":210
 *                              _to_double(reaction.objective_coefficient))
 * 
 *             for metabolite, coefficient in reaction._metabolites.iteritems():             # <<<<<<<<<<<<<<
 *                 linear_constraint_rows.append(
 *                     metabolite_id_to_index[metabolite.id])
 */
    __pyx_t_11 = 0;
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_reaction, __pyx_n_s_metabolites_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    if (unlikely(__pyx_t_7 == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "iteritems");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_8 = __Pyx_dict_iterator(__pyx_t_7, 0, __pyx_n_s_iteritems, (&__pyx_t_12), (&__pyx_t_13)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_10);
    __pyx_t_10 = __pyx_t_8;
    __pyx_t_8 = 0;
    while (1) {
      __pyx_t_14 = __Pyx_dict_iter_next(__pyx_t_10, __pyx_t_12, &__pyx_t_11, &__pyx_t_8, &__pyx_t_7, NULL, __pyx_t_13);
      if (unlikely(__pyx_t_14 == 0)) break;
      if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_XDECREF_SET(__pyx_v_metabolite, __pyx_t_8);
      __pyx_t_8 = 0;
      __Pyx_XDECREF_SET(__pyx_v_coefficient, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "cobra/solvers/cglpk.pyx":212
 *             for metabolite, coefficient in reaction._metabolites.iteritems():
 *                 linear_constraint_rows.append(
 *                     metabolite_id_to_index[metabolite.id])             # <<<<<<<<<<<<<<
 *                 linear_constraint_cols.append(index)
 *                 linear_constraint_values.append(coefficient)
 */
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_metabolite, __pyx_n_s_id); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = __Pyx_PyDict_GetItem(__pyx_v_metabolite_id_to_index, __pyx_t_7); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "cobra/solvers/cglpk.pyx":211
 * 
 *             for metabolite, coefficient in reaction._metabolites.iteritems():
 *                 linear_constraint_rows.append(             # <<<<<<<<<<<<<<
 *                     metabolite_id_to_index[metabolite.id])
 *                 linear_constraint_cols.append(index)
 */
      __pyx_t_15 = __Pyx_PyList_Append(__pyx_v_linear_constraint_rows, __pyx_t_8); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "cobra/solvers/cglpk.pyx":213
 *                 linear_constraint_rows.append(
 *                     metabolite_id_to_index[metabolite.id])
 *                 linear_constraint_cols.append(index)             # <<<<<<<<<<<<<<
 *                 linear_constraint_values.append(coefficient)
 * 
 */
      __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_index); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_15 = __Pyx_PyList_Append(__pyx_v_linear_constraint_cols, __pyx_t_8); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "cobra/solvers/cglpk.pyx":214
 *                     metabolite_id_to_index[metabolite.id])
 *                 linear_constraint_cols.append(index)
 *                 linear_constraint_values.append(coefficient)             # <<<<<<<<<<<<<<
 * 
 *         # set constraint marix
 */
      __pyx_t_15 = __Pyx_PyList_Append(__pyx_v_linear_constraint_values, __pyx_v_coefficient); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

    /* "cobra/solvers/cglpk.pyx":194
 * 
 *         # set reaction/varaiable bounds
 *         for index, reaction in enumerate(cobra_model.reactions, 1):             # <<<<<<<<<<<<<<
 *             if reaction.variable_kind == "integer":
 *                 if reaction.lower_bound == 0 and reaction.upper_bound == 1:
 */
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cobra/solvers/cglpk.pyx":218
 *         # set constraint marix
 *         # first copy the python lists to c arrays
 *         n_values = downcast_pos_size(len(linear_constraint_rows))             # <<<<<<<<<<<<<<
 *         c_cols = <int *> malloc((n_values + 1) * sizeof(int))
 *         c_rows = <int *> malloc((n_values + 1) * sizeof(int))
 */
  __pyx_t_5 = PyList_GET_SIZE(__pyx_v_linear_constraint_rows); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n_values = __pyx_f_5cobra_7solvers_5cglpk_downcast_pos_size(__pyx_t_5);

  /* "cobra/solvers/cglpk.pyx":219
 *         # first copy the python lists to c arrays
 *         n_values = downcast_pos_size(len(linear_constraint_rows))
 *         c_cols = <int *> malloc((n_values + 1) * sizeof(int))             # <<<<<<<<<<<<<<
 *         c_rows = <int *> malloc((n_values + 1) * sizeof(int))
 *         c_values = <double *> malloc((n_values + 1) * sizeof(double))
 */
  __pyx_v_c_cols = ((int *)malloc(((__pyx_v_n_values + 1) * (sizeof(int)))));

  /* "cobra/solvers/cglpk.pyx":220
 *         n_values = downcast_pos_size(len(linear_constraint_rows))
 *         c_cols = <int *> malloc((n_values + 1) * sizeof(int))
 *         c_rows = <int *> malloc((n_values + 1) * sizeof(int))             # <<<<<<<<<<<<<<
 *         c_values = <double *> malloc((n_values + 1) * sizeof(double))
 *         if c_rows is NULL or c_rows is NULL or c_values is NULL:
 */
  __pyx_v_c_rows = ((int *)malloc(((__pyx_v_n_values + 1) * (sizeof(int)))));

  /* "cobra/solvers/cglpk.pyx":221
 *         c_cols = <int *> malloc((n_values + 1) * sizeof(int))
 *         c_rows = <int *> malloc((n_values + 1) * sizeof(int))
 *         c_values = <double *> malloc((n_values + 1) * sizeof(double))             # <<<<<<<<<<<<<<
 *         if c_rows is NULL or c_rows is NULL or c_values is NULL:
 *             raise MemoryError()
 */
  __pyx_v_c_values = ((double *)malloc(((__pyx_v_n_values + 1) * (sizeof(double)))));

  /* "cobra/solvers/cglpk.pyx":222
 *         c_rows = <int *> malloc((n_values + 1) * sizeof(int))
 *         c_values = <double *> malloc((n_values + 1) * sizeof(double))
 *         if c_rows is NULL or c_rows is NULL or c_values is NULL:             # <<<<<<<<<<<<<<
 *             raise MemoryError()
 *         for index in range(n_values):
 */
  __pyx_t_1 = ((__pyx_v_c_rows == NULL) != 0);
  if (!__pyx_t_1) {
  } else {
    __pyx_t_2 = __pyx_t_1;
    goto __pyx_L23_bool_binop_done;
  }
  __pyx_t_1 = ((__pyx_v_c_rows == NULL) != 0);
  if (!__pyx_t_1) {
  } else {
    __pyx_t_2 = __pyx_t_1;
    goto __pyx_L23_bool_binop_done;
  }
  __pyx_t_1 = ((__pyx_v_c_values == NULL) != 0);
  __pyx_t_2 = __pyx_t_1;
  __pyx_L23_bool_binop_done:;
  if (__pyx_t_2) {

    /* "cobra/solvers/cglpk.pyx":223
 *         c_values = <double *> malloc((n_values + 1) * sizeof(double))
 *         if c_rows is NULL or c_rows is NULL or c_values is NULL:
 *             raise MemoryError()             # <<<<<<<<<<<<<<
 *         for index in range(n_values):
 *             c_rows[index + 1] = linear_constraint_rows[index]
 */
    PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "cobra/solvers/cglpk.pyx":222
 *         c_rows = <int *> malloc((n_values + 1) * sizeof(int))
 *         c_values = <double *> malloc((n_values + 1) * sizeof(double))
 *         if c_rows is NULL or c_rows is NULL or c_values is NULL:             # <<<<<<<<<<<<<<
 *             raise MemoryError()
 *         for index in range(n_values):
 */
  }

  /* "cobra/solvers/cglpk.pyx":224
 *         if c_rows is NULL or c_rows is NULL or c_values is NULL:
 *             raise MemoryError()
 *         for index in range(n_values):             # <<<<<<<<<<<<<<
 *             c_rows[index + 1] = linear_constraint_rows[index]
 *             c_cols[index + 1] = linear_constraint_cols[index]
 */
  __pyx_t_6 = __pyx_v_n_values;
  for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_6; __pyx_t_13+=1) {
    __pyx_v_index = __pyx_t_13;

    /* "cobra/solvers/cglpk.pyx":225
 *             raise MemoryError()
 *         for index in range(n_values):
 *             c_rows[index + 1] = linear_constraint_rows[index]             # <<<<<<<<<<<<<<
 *             c_cols[index + 1] = linear_constraint_cols[index]
 *             c_values[index + 1] = _to_double(linear_constraint_values[index])
 */
    __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_linear_constraint_rows, __pyx_v_index, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    (__pyx_v_c_rows[(__pyx_v_index + 1)]) = __pyx_t_14;

    /* "cobra/solvers/cglpk.pyx":226
 *         for index in range(n_values):
 *             c_rows[index + 1] = linear_constraint_rows[index]
 *             c_cols[index + 1] = linear_constraint_cols[index]             # <<<<<<<<<<<<<<
 *             c_values[index + 1] = _to_double(linear_constraint_values[index])
 *         # actually set the values
 */
    __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_linear_constraint_cols, __pyx_v_index, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    (__pyx_v_c_cols[(__pyx_v_index + 1)]) = __pyx_t_14;

    /* "cobra/solvers/cglpk.pyx":227
 *             c_rows[index + 1] = linear_constraint_rows[index]
 *             c_cols[index + 1] = linear_constraint_cols[index]
 *             c_values[index + 1] = _to_double(linear_constraint_values[index])             # <<<<<<<<<<<<<<
 *         # actually set the values
 *         glp_load_matrix(glp, n_values, c_rows, c_cols, c_values)
 */
    __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_linear_constraint_values, __pyx_v_index, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_4);
    (__pyx_v_c_values[(__pyx_v_index + 1)]) = __pyx_f_5cobra_7solvers_5cglpk__to_double(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }

  /* "cobra/solvers/cglpk.pyx":229
 *             c_values[index + 1] = _to_double(linear_constraint_values[index])
 *         # actually set the values
 *         glp_load_matrix(glp, n_values, c_rows, c_cols, c_values)             # <<<<<<<<<<<<<<
 *         # free the c arrays
 *         free(c_rows)
 */
  glp_load_matrix(__pyx_v_glp, __pyx_v_n_values, __pyx_v_c_rows, __pyx_v_c_cols, __pyx_v_c_values);

  /* "cobra/solvers/cglpk.pyx":231
 *         glp_load_matrix(glp, n_values, c_rows, c_cols, c_values)
 *         # free the c arrays
 *         free(c_rows)             # <<<<<<<<<<<<<<
 *         free(c_cols)
 *         free(c_values)
 */
  free(__pyx_v_c_rows);

  /* "cobra/solvers/cglpk.pyx":232
 *         # free the c arrays
 *         free(c_rows)
 *         free(c_cols)             # <<<<<<<<<<<<<<
 *         free(c_values)
 * 
 */
  free(__pyx_v_c_cols);

  /* "cobra/solvers/cglpk.pyx":233
 *         free(c_rows)
 *         free(c_cols)
 *         free(c_values)             # <<<<<<<<<<<<<<
 * 
 *     # problem creation and modification
 */
  free(__pyx_v_c_values);

  /* "cobra/solvers/cglpk.pyx":158
 *         glp_delete_prob(self.glp)
 * 
 *     def __init__(self, cobra_model=None):             # <<<<<<<<<<<<<<
 *         cdef int bound_type, index, n, n_values
 *         cdef glp_prob *glp
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("cobra.solvers.cglpk.GLP.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_metabolite_id_to_index);
  __Pyx_XDECREF(__pyx_v_linear_constraint_rows);
  __Pyx_XDECREF(__pyx_v_linear_constraint_cols);
  __Pyx_XDECREF(__pyx_v_linear_constraint_values);
  __Pyx_XDECREF(__pyx_v_metabolite);
  __Pyx_XDECREF(__pyx_v_c);
  __Pyx_XDECREF(__pyx_v_reaction);
  __Pyx_XDECREF(__pyx_v_coefficient);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cobra/solvers/cglpk.pyx":237
 *     # problem creation and modification
 *     @classmethod
 *     def create_problem(cls, cobra_model, objective_sense="maximize"):             # <<<<<<<<<<<<<<
 *         problem = cls(cobra_model)
 *         problem.set_objective_sense(objective_sense)
 */

/* Python wrapper */
static PyObject *__pyx_pw_5cobra_7solvers_5cglpk_3GLP_7create_problem(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5cobra_7solvers_5cglpk_3GLP_6create_problem[] = "GLP.create_problem(type cls, cobra_model, objective_sense='maximize')";
static PyObject *__pyx_pw_5cobra_7solvers_5cglpk_3GLP_7create_problem(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_cobra_model = 0;
  PyObject *__pyx_v_objective_sense = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("create_problem (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cobra_model,&__pyx_n_s_objective_sense,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)__pyx_n_s_maximize);
    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_cobra_model)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_objective_sense);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create_problem") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_cobra_model = values[0];
    __pyx_v_objective_sense = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("create_problem", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("cobra.solvers.cglpk.GLP.create_problem", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5cobra_7solvers_5cglpk_3GLP_6create_problem(((PyTypeObject*)__pyx_v_cls), __pyx_v_cobra_model, __pyx_v_objective_sense);

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

static PyObject *__pyx_pf_5cobra_7solvers_5cglpk_3GLP_6create_problem(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_cobra_model, PyObject *__pyx_v_objective_sense) {
  PyObject *__pyx_v_problem = 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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("create_problem", 0);

  /* "cobra/solvers/cglpk.pyx":238
 *     @classmethod
 *     def create_problem(cls, cobra_model, objective_sense="maximize"):
 *         problem = cls(cobra_model)             # <<<<<<<<<<<<<<
 *         problem.set_objective_sense(objective_sense)
 *         return problem
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_cobra_model);
  __Pyx_GIVEREF(__pyx_v_cobra_model);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_cobra_model);
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_v_cls), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_problem = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cobra/solvers/cglpk.pyx":239
 *     def create_problem(cls, cobra_model, objective_sense="maximize"):
 *         problem = cls(cobra_model)
 *         problem.set_objective_sense(objective_sense)             # <<<<<<<<<<<<<<
 *         return problem
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_problem, __pyx_n_s_set_objective_sense); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_objective_sense); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_v_objective_sense);
    __Pyx_GIVEREF(__pyx_v_objective_sense);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_objective_sense);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cobra/solvers/cglpk.pyx":240
 *         problem = cls(cobra_model)
 *         problem.set_objective_sense(objective_sense)
 *         return problem             # <<<<<<<<<<<<<<
 * 
 *     cpdef change_variable_bounds(self, int index, double lower_bound,
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_problem);
  __pyx_r = __pyx_v_problem;
  goto __pyx_L0;

  /* "cobra/solvers/cglpk.pyx":237
 *     # problem creation and modification
 *     @classmethod
 *     def create_problem(cls, cobra_model, objective_sense="maximize"):             # <<<<<<<<<<<<<<
 *         problem = cls(cobra_model)
 *         problem.set_objective_sense(objective_sense)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cobra.solvers.cglpk.GLP.create_problem", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_problem);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cobra/solvers/cglpk.pyx":242
 *         return problem
 * 
 *     cpdef change_variable_bounds(self, int index, double lower_bound,             # <<<<<<<<<<<<<<
 *                                  double upper_bound):
 *         cdef int bound_type = GLP_FX if lower_bound == upper_bound else GLP_DB
 */

static PyObject *__pyx_pw_5cobra_7solvers_5cglpk_3GLP_9change_variable_bounds(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_5cobra_7solvers_5cglpk_3GLP_change_variable_bounds(struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *__pyx_v_self, int __pyx_v_index, double __pyx_v_lower_bound, double __pyx_v_upper_bound, int __pyx_skip_dispatch) {
  int __pyx_v_bound_type;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("change_variable_bounds", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_change_variable_bounds); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5cobra_7solvers_5cglpk_3GLP_9change_variable_bounds)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_index); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyFloat_FromDouble(__pyx_v_lower_bound); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyFloat_FromDouble(__pyx_v_upper_bound); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_6 = __pyx_t_1; __pyx_t_7 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_8 = 1;
        }
      }
      __pyx_t_9 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      if (__pyx_t_7) {
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5);
      __pyx_t_3 = 0;
      __pyx_t_4 = 0;
      __pyx_t_5 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "cobra/solvers/cglpk.pyx":244
 *     cpdef change_variable_bounds(self, int index, double lower_bound,
 *                                  double upper_bound):
 *         cdef int bound_type = GLP_FX if lower_bound == upper_bound else GLP_DB             # <<<<<<<<<<<<<<
 *         assert index >= 0
 *         glp_set_col_bnds(self.glp, index + 1, bound_type, lower_bound, upper_bound)
 */
  if (((__pyx_v_lower_bound == __pyx_v_upper_bound) != 0)) {
    __pyx_t_10 = GLP_FX;
  } else {
    __pyx_t_10 = GLP_DB;
  }
  __pyx_v_bound_type = __pyx_t_10;

  /* "cobra/solvers/cglpk.pyx":245
 *                                  double upper_bound):
 *         cdef int bound_type = GLP_FX if lower_bound == upper_bound else GLP_DB
 *         assert index >= 0             # <<<<<<<<<<<<<<
 *         glp_set_col_bnds(self.glp, index + 1, bound_type, lower_bound, upper_bound)
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    if (unlikely(!((__pyx_v_index >= 0) != 0))) {
      PyErr_SetNone(PyExc_AssertionError);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "cobra/solvers/cglpk.pyx":246
 *         cdef int bound_type = GLP_FX if lower_bound == upper_bound else GLP_DB
 *         assert index >= 0
 *         glp_set_col_bnds(self.glp, index + 1, bound_type, lower_bound, upper_bound)             # <<<<<<<<<<<<<<
 * 
 *     def change_coefficient(self, int met_index, int rxn_index, double value):
 */
  glp_set_col_bnds(__pyx_v_self->glp, (__pyx_v_index + 1), __pyx_v_bound_type, __pyx_v_lower_bound, __pyx_v_upper_bound);

  /* "cobra/solvers/cglpk.pyx":242
 *         return problem
 * 
 *     cpdef change_variable_bounds(self, int index, double lower_bound,             # <<<<<<<<<<<<<<
 *                                  double upper_bound):
 *         cdef int bound_type = GLP_FX if lower_bound == upper_bound else GLP_DB
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("cobra.solvers.cglpk.GLP.change_variable_bounds", __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_5cobra_7solvers_5cglpk_3GLP_9change_variable_bounds(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5cobra_7solvers_5cglpk_3GLP_8change_variable_bounds[] = "GLP.change_variable_bounds(self, int index, double lower_bound, double upper_bound)";
static PyObject *__pyx_pw_5cobra_7solvers_5cglpk_3GLP_9change_variable_bounds(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_index;
  double __pyx_v_lower_bound;
  double __pyx_v_upper_bound;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("change_variable_bounds (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_lower_bound,&__pyx_n_s_upper_bound,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_lower_bound)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("change_variable_bounds", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_upper_bound)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("change_variable_bounds", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "change_variable_bounds") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_index = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_index == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_lower_bound = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_lower_bound == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_upper_bound = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_upper_bound == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("change_variable_bounds", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("cobra.solvers.cglpk.GLP.change_variable_bounds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5cobra_7solvers_5cglpk_3GLP_8change_variable_bounds(((struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *)__pyx_v_self), __pyx_v_index, __pyx_v_lower_bound, __pyx_v_upper_bound);

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

static PyObject *__pyx_pf_5cobra_7solvers_5cglpk_3GLP_8change_variable_bounds(struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *__pyx_v_self, int __pyx_v_index, double __pyx_v_lower_bound, double __pyx_v_upper_bound) {
  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("change_variable_bounds", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_5cobra_7solvers_5cglpk_3GLP_change_variable_bounds(__pyx_v_self, __pyx_v_index, __pyx_v_lower_bound, __pyx_v_upper_bound, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cobra.solvers.cglpk.GLP.change_variable_bounds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cobra/solvers/cglpk.pyx":248
 *         glp_set_col_bnds(self.glp, index + 1, bound_type, lower_bound, upper_bound)
 * 
 *     def change_coefficient(self, int met_index, int rxn_index, double value):             # <<<<<<<<<<<<<<
 *         cdef int col_length, i
 *         cdef int *indexes
 */

/* Python wrapper */
static PyObject *__pyx_pw_5cobra_7solvers_5cglpk_3GLP_11change_coefficient(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5cobra_7solvers_5cglpk_3GLP_10change_coefficient[] = "GLP.change_coefficient(self, int met_index, int rxn_index, double value)";
static PyObject *__pyx_pw_5cobra_7solvers_5cglpk_3GLP_11change_coefficient(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_met_index;
  int __pyx_v_rxn_index;
  double __pyx_v_value;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("change_coefficient (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_met_index,&__pyx_n_s_rxn_index,&__pyx_n_s_value,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_met_index)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rxn_index)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("change_coefficient", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("change_coefficient", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "change_coefficient") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_met_index = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_met_index == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_rxn_index = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_rxn_index == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_value = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_value == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("change_coefficient", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("cobra.solvers.cglpk.GLP.change_coefficient", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5cobra_7solvers_5cglpk_3GLP_10change_coefficient(((struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *)__pyx_v_self), __pyx_v_met_index, __pyx_v_rxn_index, __pyx_v_value);

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

static PyObject *__pyx_pf_5cobra_7solvers_5cglpk_3GLP_10change_coefficient(struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *__pyx_v_self, int __pyx_v_met_index, int __pyx_v_rxn_index, double __pyx_v_value) {
  int __pyx_v_col_length;
  int __pyx_v_i;
  int *__pyx_v_indexes;
  double *__pyx_v_values;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("change_coefficient", 0);

  /* "cobra/solvers/cglpk.pyx":253
 *         cdef double *values
 *         # glpk uses 1 indexing
 *         met_index += 1             # <<<<<<<<<<<<<<
 *         rxn_index += 1
 *         # we first have to get the old column
 */
  __pyx_v_met_index = (__pyx_v_met_index + 1);

  /* "cobra/solvers/cglpk.pyx":254
 *         # glpk uses 1 indexing
 *         met_index += 1
 *         rxn_index += 1             # <<<<<<<<<<<<<<
 *         # we first have to get the old column
 *         col_length = glp_get_mat_col(self.glp, rxn_index, NULL, NULL)
 */
  __pyx_v_rxn_index = (__pyx_v_rxn_index + 1);

  /* "cobra/solvers/cglpk.pyx":256
 *         rxn_index += 1
 *         # we first have to get the old column
 *         col_length = glp_get_mat_col(self.glp, rxn_index, NULL, NULL)             # <<<<<<<<<<<<<<
 *         indexes = <int *> malloc((col_length + 2) * sizeof(int))
 *         values = <double *> malloc((col_length + 2) * sizeof(double))
 */
  __pyx_v_col_length = glp_get_mat_col(__pyx_v_self->glp, __pyx_v_rxn_index, NULL, NULL);

  /* "cobra/solvers/cglpk.pyx":257
 *         # we first have to get the old column
 *         col_length = glp_get_mat_col(self.glp, rxn_index, NULL, NULL)
 *         indexes = <int *> malloc((col_length + 2) * sizeof(int))             # <<<<<<<<<<<<<<
 *         values = <double *> malloc((col_length + 2) * sizeof(double))
 *         if indexes == NULL or values == NULL:
 */
  __pyx_v_indexes = ((int *)malloc(((__pyx_v_col_length + 2) * (sizeof(int)))));

  /* "cobra/solvers/cglpk.pyx":258
 *         col_length = glp_get_mat_col(self.glp, rxn_index, NULL, NULL)
 *         indexes = <int *> malloc((col_length + 2) * sizeof(int))
 *         values = <double *> malloc((col_length + 2) * sizeof(double))             # <<<<<<<<<<<<<<
 *         if indexes == NULL or values == NULL:
 *             raise MemoryError()
 */
  __pyx_v_values = ((double *)malloc(((__pyx_v_col_length + 2) * (sizeof(double)))));

  /* "cobra/solvers/cglpk.pyx":259
 *         indexes = <int *> malloc((col_length + 2) * sizeof(int))
 *         values = <double *> malloc((col_length + 2) * sizeof(double))
 *         if indexes == NULL or values == NULL:             # <<<<<<<<<<<<<<
 *             raise MemoryError()
 *         glp_get_mat_col(self.glp, rxn_index, indexes, values)
 */
  __pyx_t_2 = ((__pyx_v_indexes == NULL) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_values == NULL) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cobra/solvers/cglpk.pyx":260
 *         values = <double *> malloc((col_length + 2) * sizeof(double))
 *         if indexes == NULL or values == NULL:
 *             raise MemoryError()             # <<<<<<<<<<<<<<
 *         glp_get_mat_col(self.glp, rxn_index, indexes, values)
 *         # search for duplicate
 */
    PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "cobra/solvers/cglpk.pyx":259
 *         indexes = <int *> malloc((col_length + 2) * sizeof(int))
 *         values = <double *> malloc((col_length + 2) * sizeof(double))
 *         if indexes == NULL or values == NULL:             # <<<<<<<<<<<<<<
 *             raise MemoryError()
 *         glp_get_mat_col(self.glp, rxn_index, indexes, values)
 */
  }

  /* "cobra/solvers/cglpk.pyx":261
 *         if indexes == NULL or values == NULL:
 *             raise MemoryError()
 *         glp_get_mat_col(self.glp, rxn_index, indexes, values)             # <<<<<<<<<<<<<<
 *         # search for duplicate
 *         for i in range(col_length):
 */
  glp_get_mat_col(__pyx_v_self->glp, __pyx_v_rxn_index, __pyx_v_indexes, __pyx_v_values);

  /* "cobra/solvers/cglpk.pyx":263
 *         glp_get_mat_col(self.glp, rxn_index, indexes, values)
 *         # search for duplicate
 *         for i in range(col_length):             # <<<<<<<<<<<<<<
 *             # if a duplicate exists replace that value and exit
 *             if indexes[i + 1] == met_index:
 */
  __pyx_t_3 = __pyx_v_col_length;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "cobra/solvers/cglpk.pyx":265
 *         for i in range(col_length):
 *             # if a duplicate exists replace that value and exit
 *             if indexes[i + 1] == met_index:             # <<<<<<<<<<<<<<
 *                 values[i + 1] = value
 *                 glp_set_mat_col(self.glp, rxn_index, col_length, indexes, values)
 */
    __pyx_t_1 = (((__pyx_v_indexes[(__pyx_v_i + 1)]) == __pyx_v_met_index) != 0);
    if (__pyx_t_1) {

      /* "cobra/solvers/cglpk.pyx":266
 *             # if a duplicate exists replace that value and exit
 *             if indexes[i + 1] == met_index:
 *                 values[i + 1] = value             # <<<<<<<<<<<<<<
 *                 glp_set_mat_col(self.glp, rxn_index, col_length, indexes, values)
 *                 return
 */
      (__pyx_v_values[(__pyx_v_i + 1)]) = __pyx_v_value;

      /* "cobra/solvers/cglpk.pyx":267
 *             if indexes[i + 1] == met_index:
 *                 values[i + 1] = value
 *                 glp_set_mat_col(self.glp, rxn_index, col_length, indexes, values)             # <<<<<<<<<<<<<<
 *                 return
 *         # need to add a new entry
 */
      glp_set_mat_col(__pyx_v_self->glp, __pyx_v_rxn_index, __pyx_v_col_length, __pyx_v_indexes, __pyx_v_values);

      /* "cobra/solvers/cglpk.pyx":268
 *                 values[i + 1] = value
 *                 glp_set_mat_col(self.glp, rxn_index, col_length, indexes, values)
 *                 return             # <<<<<<<<<<<<<<
 *         # need to add a new entry
 *         indexes[col_length + 1] = met_index
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;

      /* "cobra/solvers/cglpk.pyx":265
 *         for i in range(col_length):
 *             # if a duplicate exists replace that value and exit
 *             if indexes[i + 1] == met_index:             # <<<<<<<<<<<<<<
 *                 values[i + 1] = value
 *                 glp_set_mat_col(self.glp, rxn_index, col_length, indexes, values)
 */
    }
  }

  /* "cobra/solvers/cglpk.pyx":270
 *                 return
 *         # need to add a new entry
 *         indexes[col_length + 1] = met_index             # <<<<<<<<<<<<<<
 *         values[col_length + 1] = value
 *         glp_set_mat_col(self.glp, rxn_index, col_length + 1, indexes, values)
 */
  (__pyx_v_indexes[(__pyx_v_col_length + 1)]) = __pyx_v_met_index;

  /* "cobra/solvers/cglpk.pyx":271
 *         # need to add a new entry
 *         indexes[col_length + 1] = met_index
 *         values[col_length + 1] = value             # <<<<<<<<<<<<<<
 *         glp_set_mat_col(self.glp, rxn_index, col_length + 1, indexes, values)
 *         free(indexes)
 */
  (__pyx_v_values[(__pyx_v_col_length + 1)]) = __pyx_v_value;

  /* "cobra/solvers/cglpk.pyx":272
 *         indexes[col_length + 1] = met_index
 *         values[col_length + 1] = value
 *         glp_set_mat_col(self.glp, rxn_index, col_length + 1, indexes, values)             # <<<<<<<<<<<<<<
 *         free(indexes)
 *         free(values)
 */
  glp_set_mat_col(__pyx_v_self->glp, __pyx_v_rxn_index, (__pyx_v_col_length + 1), __pyx_v_indexes, __pyx_v_values);

  /* "cobra/solvers/cglpk.pyx":273
 *         values[col_length + 1] = value
 *         glp_set_mat_col(self.glp, rxn_index, col_length + 1, indexes, values)
 *         free(indexes)             # <<<<<<<<<<<<<<
 *         free(values)
 * 
 */
  free(__pyx_v_indexes);

  /* "cobra/solvers/cglpk.pyx":274
 *         glp_set_mat_col(self.glp, rxn_index, col_length + 1, indexes, values)
 *         free(indexes)
 *         free(values)             # <<<<<<<<<<<<<<
 * 
 *     def solve_problem(self, **solver_parameters):
 */
  free(__pyx_v_values);

  /* "cobra/solvers/cglpk.pyx":248
 *         glp_set_col_bnds(self.glp, index + 1, bound_type, lower_bound, upper_bound)
 * 
 *     def change_coefficient(self, int met_index, int rxn_index, double value):             # <<<<<<<<<<<<<<
 *         cdef int col_length, i
 *         cdef int *indexes
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("cobra.solvers.cglpk.GLP.change_coefficient", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cobra/solvers/cglpk.pyx":276
 *         free(values)
 * 
 *     def solve_problem(self, **solver_parameters):             # <<<<<<<<<<<<<<
 *         cdef int result
 *         cdef int time_limit
 */

/* Python wrapper */
static PyObject *__pyx_pw_5cobra_7solvers_5cglpk_3GLP_13solve_problem(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5cobra_7solvers_5cglpk_3GLP_12solve_problem[] = "GLP.solve_problem(self, **solver_parameters)";
static PyObject *__pyx_pw_5cobra_7solvers_5cglpk_3GLP_13solve_problem(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_solver_parameters = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("solve_problem (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("solve_problem", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
  if (__pyx_kwds && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "solve_problem", 1))) return NULL;
  __pyx_v_solver_parameters = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_solver_parameters)) return NULL;
  __Pyx_GOTREF(__pyx_v_solver_parameters);
  __pyx_r = __pyx_pf_5cobra_7solvers_5cglpk_3GLP_12solve_problem(((struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *)__pyx_v_self), __pyx_v_solver_parameters);

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

static PyObject *__pyx_pf_5cobra_7solvers_5cglpk_3GLP_12solve_problem(struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *__pyx_v_self, PyObject *__pyx_v_solver_parameters) {
  int __pyx_v_time_limit;
  glp_prob *__pyx_v_glp;
  PyObject *__pyx_v_key = NULL;
  PyObject *__pyx_v_value = NULL;
  int __pyx_v_fast_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  glp_prob *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  int __pyx_t_10;
  long __pyx_t_11;
  long __pyx_t_12;
  int __pyx_t_13;
  int __pyx_t_14;
  char const *__pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("solve_problem", 0);

  /* "cobra/solvers/cglpk.pyx":279
 *         cdef int result
 *         cdef int time_limit
 *         cdef glp_prob *glp = self.glp             # <<<<<<<<<<<<<<
 * 
 *         for key, value in solver_parameters.items():
 */
  __pyx_t_1 = __pyx_v_self->glp;
  __pyx_v_glp = __pyx_t_1;

  /* "cobra/solvers/cglpk.pyx":281
 *         cdef glp_prob *glp = self.glp
 * 
 *         for key, value in solver_parameters.items():             # <<<<<<<<<<<<<<
 *             self.set_parameter(key, value)
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_Items(__pyx_v_solver_parameters); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); 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_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_5(__pyx_t_3);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_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 = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_6 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_7);
      #else
      __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      #endif
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
      index = 0; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_7);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_9 = NULL;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_9 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L6_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_6);
    __pyx_t_6 = 0;
    __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "cobra/solvers/cglpk.pyx":282
 * 
 *         for key, value in solver_parameters.items():
 *             self.set_parameter(key, value)             # <<<<<<<<<<<<<<
 * 
 *         # suspend the gil to allow multithreading
 */
    __pyx_t_2 = ((struct __pyx_vtabstruct_5cobra_7solvers_5cglpk_GLP *)__pyx_v_self->__pyx_vtab)->set_parameter(__pyx_v_self, __pyx_v_key, __pyx_v_value, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cobra/solvers/cglpk.pyx":281
 *         cdef glp_prob *glp = self.glp
 * 
 *         for key, value in solver_parameters.items():             # <<<<<<<<<<<<<<
 *             self.set_parameter(key, value)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cobra/solvers/cglpk.pyx":293
 *         # Try to solve the problem with the existing basis, but with
 *         # a time limit in case it gets stuck.
 *         time_limit = self.parameters.tm_lim  # save time limit             # <<<<<<<<<<<<<<
 *         self.parameters.tm_lim = min(500, time_limit)
 *         fast_status = glp_simplex(glp, &self.parameters)
 */
  __pyx_t_10 = __pyx_v_self->parameters.tm_lim;
  __pyx_v_time_limit = __pyx_t_10;

  /* "cobra/solvers/cglpk.pyx":294
 *         # a time limit in case it gets stuck.
 *         time_limit = self.parameters.tm_lim  # save time limit
 *         self.parameters.tm_lim = min(500, time_limit)             # <<<<<<<<<<<<<<
 *         fast_status = glp_simplex(glp, &self.parameters)
 *         self.parameters.tm_lim = time_limit
 */
  __pyx_t_10 = __pyx_v_time_limit;
  __pyx_t_11 = 0x1F4;
  if (((__pyx_t_10 < __pyx_t_11) != 0)) {
    __pyx_t_12 = __pyx_t_10;
  } else {
    __pyx_t_12 = __pyx_t_11;
  }
  __pyx_v_self->parameters.tm_lim = __pyx_t_12;

  /* "cobra/solvers/cglpk.pyx":295
 *         time_limit = self.parameters.tm_lim  # save time limit
 *         self.parameters.tm_lim = min(500, time_limit)
 *         fast_status = glp_simplex(glp, &self.parameters)             # <<<<<<<<<<<<<<
 *         self.parameters.tm_lim = time_limit
 * 
 */
  __pyx_v_fast_status = glp_simplex(__pyx_v_glp, (&__pyx_v_self->parameters));

  /* "cobra/solvers/cglpk.pyx":296
 *         self.parameters.tm_lim = min(500, time_limit)
 *         fast_status = glp_simplex(glp, &self.parameters)
 *         self.parameters.tm_lim = time_limit             # <<<<<<<<<<<<<<
 * 
 *         if fast_status != 0:
 */
  __pyx_v_self->parameters.tm_lim = __pyx_v_time_limit;

  /* "cobra/solvers/cglpk.pyx":298
 *         self.parameters.tm_lim = time_limit
 * 
 *         if fast_status != 0:             # <<<<<<<<<<<<<<
 *             glp_adv_basis(glp, 0)
 *             check_error(glp_simplex(glp, &self.parameters))
 */
  __pyx_t_13 = ((__pyx_v_fast_status != 0) != 0);
  if (__pyx_t_13) {

    /* "cobra/solvers/cglpk.pyx":299
 * 
 *         if fast_status != 0:
 *             glp_adv_basis(glp, 0)             # <<<<<<<<<<<<<<
 *             check_error(glp_simplex(glp, &self.parameters))
 *         self.parameters.tm_lim = time_limit
 */
    glp_adv_basis(__pyx_v_glp, 0);

    /* "cobra/solvers/cglpk.pyx":300
 *         if fast_status != 0:
 *             glp_adv_basis(glp, 0)
 *             check_error(glp_simplex(glp, &self.parameters))             # <<<<<<<<<<<<<<
 *         self.parameters.tm_lim = time_limit
 *         if self.exact:
 */
    __pyx_t_3 = __pyx_f_5cobra_7solvers_5cglpk_check_error(glp_simplex(__pyx_v_glp, (&__pyx_v_self->parameters))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cobra/solvers/cglpk.pyx":298
 *         self.parameters.tm_lim = time_limit
 * 
 *         if fast_status != 0:             # <<<<<<<<<<<<<<
 *             glp_adv_basis(glp, 0)
 *             check_error(glp_simplex(glp, &self.parameters))
 */
  }

  /* "cobra/solvers/cglpk.pyx":301
 *             glp_adv_basis(glp, 0)
 *             check_error(glp_simplex(glp, &self.parameters))
 *         self.parameters.tm_lim = time_limit             # <<<<<<<<<<<<<<
 *         if self.exact:
 *             # sigh... it looks like the exact routine doesn't fully respect
 */
  __pyx_v_self->parameters.tm_lim = __pyx_v_time_limit;

  /* "cobra/solvers/cglpk.pyx":302
 *             check_error(glp_simplex(glp, &self.parameters))
 *         self.parameters.tm_lim = time_limit
 *         if self.exact:             # <<<<<<<<<<<<<<
 *             # sigh... it looks like the exact routine doesn't fully respect
 *             # the verbosity parameter
 */
  __pyx_t_13 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self->exact)); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_13) {

    /* "cobra/solvers/cglpk.pyx":305
 *             # sigh... it looks like the exact routine doesn't fully respect
 *             # the verbosity parameter
 *             if self.parameters.msg_lev == GLP_MSG_OFF:             # <<<<<<<<<<<<<<
 *                 glp_term_hook(silent_hook, NULL)
 *             try:
 */
    __pyx_t_13 = ((__pyx_v_self->parameters.msg_lev == GLP_MSG_OFF) != 0);
    if (__pyx_t_13) {

      /* "cobra/solvers/cglpk.pyx":306
 *             # the verbosity parameter
 *             if self.parameters.msg_lev == GLP_MSG_OFF:
 *                 glp_term_hook(silent_hook, NULL)             # <<<<<<<<<<<<<<
 *             try:
 *                 check_error(glp_exact(glp, &self.parameters))
 */
      glp_term_hook(__pyx_f_5cobra_7solvers_5cglpk_silent_hook, NULL);

      /* "cobra/solvers/cglpk.pyx":305
 *             # sigh... it looks like the exact routine doesn't fully respect
 *             # the verbosity parameter
 *             if self.parameters.msg_lev == GLP_MSG_OFF:             # <<<<<<<<<<<<<<
 *                 glp_term_hook(silent_hook, NULL)
 *             try:
 */
    }

    /* "cobra/solvers/cglpk.pyx":307
 *             if self.parameters.msg_lev == GLP_MSG_OFF:
 *                 glp_term_hook(silent_hook, NULL)
 *             try:             # <<<<<<<<<<<<<<
 *                 check_error(glp_exact(glp, &self.parameters))
 *             finally:
 */
    /*try:*/ {

      /* "cobra/solvers/cglpk.pyx":308
 *                 glp_term_hook(silent_hook, NULL)
 *             try:
 *                 check_error(glp_exact(glp, &self.parameters))             # <<<<<<<<<<<<<<
 *             finally:
 *                 glp_term_hook(hook, NULL)
 */
      __pyx_t_3 = __pyx_f_5cobra_7solvers_5cglpk_check_error(glp_exact(__pyx_v_glp, (&__pyx_v_self->parameters))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }

    /* "cobra/solvers/cglpk.pyx":310
 *                 check_error(glp_exact(glp, &self.parameters))
 *             finally:
 *                 glp_term_hook(hook, NULL)             # <<<<<<<<<<<<<<
 * 
 *         if self.is_mip():
 */
    /*finally:*/ {
      /*normal exit:*/{
        glp_term_hook(__pyx_f_5cobra_7solvers_5cglpk_hook, NULL);
        goto __pyx_L12;
      }
      /*exception exit:*/{
        __pyx_L11_error:;
        __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
        if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
        __Pyx_XGOTREF(__pyx_t_16);
        __Pyx_XGOTREF(__pyx_t_17);
        __Pyx_XGOTREF(__pyx_t_18);
        __Pyx_XGOTREF(__pyx_t_19);
        __Pyx_XGOTREF(__pyx_t_20);
        __Pyx_XGOTREF(__pyx_t_21);
        __pyx_t_10 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename;
        {
          glp_term_hook(__pyx_f_5cobra_7solvers_5cglpk_hook, NULL);
        }
        if (PY_MAJOR_VERSION >= 3) {
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_XGIVEREF(__pyx_t_20);
          __Pyx_XGIVEREF(__pyx_t_21);
          __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
        }
        __Pyx_XGIVEREF(__pyx_t_16);
        __Pyx_XGIVEREF(__pyx_t_17);
        __Pyx_XGIVEREF(__pyx_t_18);
        __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
        __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
        __pyx_lineno = __pyx_t_10; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15;
        goto __pyx_L1_error;
      }
      __pyx_L12:;
    }

    /* "cobra/solvers/cglpk.pyx":302
 *             check_error(glp_simplex(glp, &self.parameters))
 *         self.parameters.tm_lim = time_limit
 *         if self.exact:             # <<<<<<<<<<<<<<
 *             # sigh... it looks like the exact routine doesn't fully respect
 *             # the verbosity parameter
 */
  }

  /* "cobra/solvers/cglpk.pyx":312
 *                 glp_term_hook(hook, NULL)
 * 
 *         if self.is_mip():             # <<<<<<<<<<<<<<
 *             self.integer_parameters.tm_lim = self.parameters.tm_lim
 *             self.integer_parameters.msg_lev = self.parameters.msg_lev
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_5cobra_7solvers_5cglpk_GLP *)__pyx_v_self->__pyx_vtab)->is_mip(__pyx_v_self, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_13) {

    /* "cobra/solvers/cglpk.pyx":313
 * 
 *         if self.is_mip():
 *             self.integer_parameters.tm_lim = self.parameters.tm_lim             # <<<<<<<<<<<<<<
 *             self.integer_parameters.msg_lev = self.parameters.msg_lev
 *             #with nogil:
 */
    __pyx_t_14 = __pyx_v_self->parameters.tm_lim;
    __pyx_v_self->integer_parameters.tm_lim = __pyx_t_14;

    /* "cobra/solvers/cglpk.pyx":314
 *         if self.is_mip():
 *             self.integer_parameters.tm_lim = self.parameters.tm_lim
 *             self.integer_parameters.msg_lev = self.parameters.msg_lev             # <<<<<<<<<<<<<<
 *             #with nogil:
 *             check_error(glp_intopt(glp, &self.integer_parameters))
 */
    __pyx_t_14 = __pyx_v_self->parameters.msg_lev;
    __pyx_v_self->integer_parameters.msg_lev = __pyx_t_14;

    /* "cobra/solvers/cglpk.pyx":316
 *             self.integer_parameters.msg_lev = self.parameters.msg_lev
 *             #with nogil:
 *             check_error(glp_intopt(glp, &self.integer_parameters))             # <<<<<<<<<<<<<<
 *         return self.get_status()
 * 
 */
    __pyx_t_3 = __pyx_f_5cobra_7solvers_5cglpk_check_error(glp_intopt(__pyx_v_glp, (&__pyx_v_self->integer_parameters))); 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_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cobra/solvers/cglpk.pyx":312
 *                 glp_term_hook(hook, NULL)
 * 
 *         if self.is_mip():             # <<<<<<<<<<<<<<
 *             self.integer_parameters.tm_lim = self.parameters.tm_lim
 *             self.integer_parameters.msg_lev = self.parameters.msg_lev
 */
  }

  /* "cobra/solvers/cglpk.pyx":317
 *             #with nogil:
 *             check_error(glp_intopt(glp, &self.integer_parameters))
 *         return self.get_status()             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_status); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_7) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  } else {
    __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __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;

  /* "cobra/solvers/cglpk.pyx":276
 *         free(values)
 * 
 *     def solve_problem(self, **solver_parameters):             # <<<<<<<<<<<<<<
 *         cdef int result
 *         cdef int time_limit
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("cobra.solvers.cglpk.GLP.solve_problem", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cobra/solvers/cglpk.pyx":320
 * 
 *     @classmethod
 *     def solve(cls, cobra_model, **kwargs):             # <<<<<<<<<<<<<<
 *         problem = cls.create_problem(cobra_model)
 *         problem.solve_problem(**kwargs)
 */

/* Python wrapper */
static PyObject *__pyx_pw_5cobra_7solvers_5cglpk_3GLP_15solve(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5cobra_7solvers_5cglpk_3GLP_14solve[] = "GLP.solve(type cls, cobra_model, **kwargs)";
static PyObject *__pyx_pw_5cobra_7solvers_5cglpk_3GLP_15solve(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_cobra_model = 0;
  PyObject *__pyx_v_kwargs = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("solve (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cobra_model,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cobra_model)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "solve") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_cobra_model = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("solve", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("cobra.solvers.cglpk.GLP.solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5cobra_7solvers_5cglpk_3GLP_14solve(((PyTypeObject*)__pyx_v_cls), __pyx_v_cobra_model, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_5cobra_7solvers_5cglpk_3GLP_14solve(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_cobra_model, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_v_problem = NULL;
  PyObject *__pyx_v_solution = 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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("solve", 0);

  /* "cobra/solvers/cglpk.pyx":321
 *     @classmethod
 *     def solve(cls, cobra_model, **kwargs):
 *         problem = cls.create_problem(cobra_model)             # <<<<<<<<<<<<<<
 *         problem.solve_problem(**kwargs)
 *         solution = problem.format_solution(cobra_model)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_cls), __pyx_n_s_create_problem); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_cobra_model); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_v_cobra_model);
    __Pyx_GIVEREF(__pyx_v_cobra_model);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_cobra_model);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_problem = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cobra/solvers/cglpk.pyx":322
 *     def solve(cls, cobra_model, **kwargs):
 *         problem = cls.create_problem(cobra_model)
 *         problem.solve_problem(**kwargs)             # <<<<<<<<<<<<<<
 *         solution = problem.format_solution(cobra_model)
 *         return solution
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_problem, __pyx_n_s_solve_problem); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __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;

  /* "cobra/solvers/cglpk.pyx":323
 *         problem = cls.create_problem(cobra_model)
 *         problem.solve_problem(**kwargs)
 *         solution = problem.format_solution(cobra_model)             # <<<<<<<<<<<<<<
 *         return solution
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_problem, __pyx_n_s_format_solution); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_cobra_model); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_INCREF(__pyx_v_cobra_model);
    __Pyx_GIVEREF(__pyx_v_cobra_model);
    PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_cobra_model);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_solution = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cobra/solvers/cglpk.pyx":324
 *         problem.solve_problem(**kwargs)
 *         solution = problem.format_solution(cobra_model)
 *         return solution             # <<<<<<<<<<<<<<
 * 
 *     def get_status(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_solution);
  __pyx_r = __pyx_v_solution;
  goto __pyx_L0;

  /* "cobra/solvers/cglpk.pyx":320
 * 
 *     @classmethod
 *     def solve(cls, cobra_model, **kwargs):             # <<<<<<<<<<<<<<
 *         problem = cls.create_problem(cobra_model)
 *         problem.solve_problem(**kwargs)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cobra.solvers.cglpk.GLP.solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_problem);
  __Pyx_XDECREF(__pyx_v_solution);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cobra/solvers/cglpk.pyx":326
 *         return solution
 * 
 *     def get_status(self):             # <<<<<<<<<<<<<<
 *         cdef int result = glp_mip_status(self.glp) if self.is_mip() \
 *             else glp_get_status(self.glp)
 */

/* Python wrapper */
static PyObject *__pyx_pw_5cobra_7solvers_5cglpk_3GLP_17get_status(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5cobra_7solvers_5cglpk_3GLP_16get_status[] = "GLP.get_status(self)";
static PyObject *__pyx_pw_5cobra_7solvers_5cglpk_3GLP_17get_status(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_status (wrapper)", 0);
  __pyx_r = __pyx_pf_5cobra_7solvers_5cglpk_3GLP_16get_status(((struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *)__pyx_v_self));

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

static PyObject *__pyx_pf_5cobra_7solvers_5cglpk_3GLP_16get_status(struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *__pyx_v_self) {
  int __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_status", 0);

  /* "cobra/solvers/cglpk.pyx":327
 * 
 *     def get_status(self):
 *         cdef int result = glp_mip_status(self.glp) if self.is_mip() \             # <<<<<<<<<<<<<<
 *             else glp_get_status(self.glp)
 *         if result == GLP_OPT:
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_5cobra_7solvers_5cglpk_GLP *)__pyx_v_self->__pyx_vtab)->is_mip(__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {
    __pyx_t_1 = glp_mip_status(__pyx_v_self->glp);
  } else {

    /* "cobra/solvers/cglpk.pyx":328
 *     def get_status(self):
 *         cdef int result = glp_mip_status(self.glp) if self.is_mip() \
 *             else glp_get_status(self.glp)             # <<<<<<<<<<<<<<
 *         if result == GLP_OPT:
 *             return "optimal"
 */
    __pyx_t_1 = glp_get_status(__pyx_v_self->glp);
  }
  __pyx_v_result = __pyx_t_1;

  /* "cobra/solvers/cglpk.pyx":329
 *         cdef int result = glp_mip_status(self.glp) if self.is_mip() \
 *             else glp_get_status(self.glp)
 *         if result == GLP_OPT:             # <<<<<<<<<<<<<<
 *             return "optimal"
 *         if result == GLP_FEAS:
 */
  __pyx_t_3 = ((__pyx_v_result == GLP_OPT) != 0);
  if (__pyx_t_3) {

    /* "cobra/solvers/cglpk.pyx":330
 *             else glp_get_status(self.glp)
 *         if result == GLP_OPT:
 *             return "optimal"             # <<<<<<<<<<<<<<
 *         if result == GLP_FEAS:
 *             return glp_get_status(self.glp)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_s_optimal);
    __pyx_r = __pyx_n_s_optimal;
    goto __pyx_L0;

    /* "cobra/solvers/cglpk.pyx":329
 *         cdef int result = glp_mip_status(self.glp) if self.is_mip() \
 *             else glp_get_status(self.glp)
 *         if result == GLP_OPT:             # <<<<<<<<<<<<<<
 *             return "optimal"
 *         if result == GLP_FEAS:
 */
  }

  /* "cobra/solvers/cglpk.pyx":331
 *         if result == GLP_OPT:
 *             return "optimal"
 *         if result == GLP_FEAS:             # <<<<<<<<<<<<<<
 *             return glp_get_status(self.glp)
 *         if result == GLP_UNDEF:
 */
  __pyx_t_3 = ((__pyx_v_result == GLP_FEAS) != 0);
  if (__pyx_t_3) {

    /* "cobra/solvers/cglpk.pyx":332
 *             return "optimal"
 *         if result == GLP_FEAS:
 *             return glp_get_status(self.glp)             # <<<<<<<<<<<<<<
 *         if result == GLP_UNDEF:
 *             return "undefined"
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_From_int(glp_get_status(__pyx_v_self->glp)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cobra/solvers/cglpk.pyx":331
 *         if result == GLP_OPT:
 *             return "optimal"
 *         if result == GLP_FEAS:             # <<<<<<<<<<<<<<
 *             return glp_get_status(self.glp)
 *         if result == GLP_UNDEF:
 */
  }

  /* "cobra/solvers/cglpk.pyx":333
 *         if result == GLP_FEAS:
 *             return glp_get_status(self.glp)
 *         if result == GLP_UNDEF:             # <<<<<<<<<<<<<<
 *             return "undefined"
 *         if result == GLP_UNBND:
 */
  __pyx_t_3 = ((__pyx_v_result == GLP_UNDEF) != 0);
  if (__pyx_t_3) {

    /* "cobra/solvers/cglpk.pyx":334
 *             return glp_get_status(self.glp)
 *         if result == GLP_UNDEF:
 *             return "undefined"             # <<<<<<<<<<<<<<
 *         if result == GLP_UNBND:
 *             return "unbounded"
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_s_undefined);
    __pyx_r = __pyx_n_s_undefined;
    goto __pyx_L0;

    /* "cobra/solvers/cglpk.pyx":333
 *         if result == GLP_FEAS:
 *             return glp_get_status(self.glp)
 *         if result == GLP_UNDEF:             # <<<<<<<<<<<<<<
 *             return "undefined"
 *         if result == GLP_UNBND:
 */
  }

  /* "cobra/solvers/cglpk.pyx":335
 *         if result == GLP_UNDEF:
 *             return "undefined"
 *         if result == GLP_UNBND:             # <<<<<<<<<<<<<<
 *             return "unbounded"
 *         if result == GLP_NOFEAS:
 */
  __pyx_t_3 = ((__pyx_v_result == GLP_UNBND) != 0);
  if (__pyx_t_3) {

    /* "cobra/solvers/cglpk.pyx":336
 *             return "undefined"
 *         if result == GLP_UNBND:
 *             return "unbounded"             # <<<<<<<<<<<<<<
 *         if result == GLP_NOFEAS:
 *             return "infeasible"
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_s_unbounded);
    __pyx_r = __pyx_n_s_unbounded;
    goto __pyx_L0;

    /* "cobra/solvers/cglpk.pyx":335
 *         if result == GLP_UNDEF:
 *             return "undefined"
 *         if result == GLP_UNBND:             # <<<<<<<<<<<<<<
 *             return "unbounded"
 *         if result == GLP_NOFEAS:
 */
  }

  /* "cobra/solvers/cglpk.pyx":337
 *         if result == GLP_UNBND:
 *             return "unbounded"
 *         if result == GLP_NOFEAS:             # <<<<<<<<<<<<<<
 *             return "infeasible"
 *         return "failed"
 */
  __pyx_t_3 = ((__pyx_v_result == GLP_NOFEAS) != 0);
  if (__pyx_t_3) {

    /* "cobra/solvers/cglpk.pyx":338
 *             return "unbounded"
 *         if result == GLP_NOFEAS:
 *             return "infeasible"             # <<<<<<<<<<<<<<
 *         return "failed"
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_s_infeasible);
    __pyx_r = __pyx_n_s_infeasible;
    goto __pyx_L0;

    /* "cobra/solvers/cglpk.pyx":337
 *         if result == GLP_UNBND:
 *             return "unbounded"
 *         if result == GLP_NOFEAS:             # <<<<<<<<<<<<<<
 *             return "infeasible"
 *         return "failed"
 */
  }

  /* "cobra/solvers/cglpk.pyx":339
 *         if result == GLP_NOFEAS:
 *             return "infeasible"
 *         return "failed"             # <<<<<<<<<<<<<<
 * 
 *     cpdef set_objective_sense(self, objective_sense):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_n_s_failed);
  __pyx_r = __pyx_n_s_failed;
  goto __pyx_L0;

  /* "cobra/solvers/cglpk.pyx":326
 *         return solution
 * 
 *     def get_status(self):             # <<<<<<<<<<<<<<
 *         cdef int result = glp_mip_status(self.glp) if self.is_mip() \
 *             else glp_get_status(self.glp)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cobra.solvers.cglpk.GLP.get_status", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cobra/solvers/cglpk.pyx":341
 *         return "failed"
 * 
 *     cpdef set_objective_sense(self, objective_sense):             # <<<<<<<<<<<<<<
 *         objective_sense = objective_sense.lower()
 *         if objective_sense == "maximize":
 */

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

  /* "cobra/solvers/cglpk.pyx":342
 * 
 *     cpdef set_objective_sense(self, objective_sense):
 *         objective_sense = objective_sense.lower()             # <<<<<<<<<<<<<<
 *         if objective_sense == "maximize":
 *             glp_set_obj_dir(self.glp, GLP_MAX)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_objective_sense, __pyx_n_s_lower); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_objective_sense, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "cobra/solvers/cglpk.pyx":343
 *     cpdef set_objective_sense(self, objective_sense):
 *         objective_sense = objective_sense.lower()
 *         if objective_sense == "maximize":             # <<<<<<<<<<<<<<
 *             glp_set_obj_dir(self.glp, GLP_MAX)
 *         elif objective_sense == "minimize":
 */
  __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_objective_sense, __pyx_n_s_maximize, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_6) {

    /* "cobra/solvers/cglpk.pyx":344
 *         objective_sense = objective_sense.lower()
 *         if objective_sense == "maximize":
 *             glp_set_obj_dir(self.glp, GLP_MAX)             # <<<<<<<<<<<<<<
 *         elif objective_sense == "minimize":
 *             glp_set_obj_dir(self.glp, GLP_MIN)
 */
    glp_set_obj_dir(__pyx_v_self->glp, GLP_MAX);

    /* "cobra/solvers/cglpk.pyx":343
 *     cpdef set_objective_sense(self, objective_sense):
 *         objective_sense = objective_sense.lower()
 *         if objective_sense == "maximize":             # <<<<<<<<<<<<<<
 *             glp_set_obj_dir(self.glp, GLP_MAX)
 *         elif objective_sense == "minimize":
 */
    goto __pyx_L3;
  }

  /* "cobra/solvers/cglpk.pyx":345
 *         if objective_sense == "maximize":
 *             glp_set_obj_dir(self.glp, GLP_MAX)
 *         elif objective_sense == "minimize":             # <<<<<<<<<<<<<<
 *             glp_set_obj_dir(self.glp, GLP_MIN)
 *         else:
 */
  __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_objective_sense, __pyx_n_s_minimize, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_6) {

    /* "cobra/solvers/cglpk.pyx":346
 *             glp_set_obj_dir(self.glp, GLP_MAX)
 *         elif objective_sense == "minimize":
 *             glp_set_obj_dir(self.glp, GLP_MIN)             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError("%s is not a valid objective sense" % objective_sense)
 */
    glp_set_obj_dir(__pyx_v_self->glp, GLP_MIN);

    /* "cobra/solvers/cglpk.pyx":345
 *         if objective_sense == "maximize":
 *             glp_set_obj_dir(self.glp, GLP_MAX)
 *         elif objective_sense == "minimize":             # <<<<<<<<<<<<<<
 *             glp_set_obj_dir(self.glp, GLP_MIN)
 *         else:
 */
    goto __pyx_L3;
  }

  /* "cobra/solvers/cglpk.pyx":348
 *             glp_set_obj_dir(self.glp, GLP_MIN)
 *         else:
 *             raise ValueError("%s is not a valid objective sense" % objective_sense)             # <<<<<<<<<<<<<<
 * 
 *     cpdef set_parameter(self, parameter_name, value):
 */
  /*else*/ {
    __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_is_not_a_valid_objective_sens, __pyx_v_objective_sense); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __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 = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

  /* "cobra/solvers/cglpk.pyx":341
 *         return "failed"
 * 
 *     cpdef set_objective_sense(self, objective_sense):             # <<<<<<<<<<<<<<
 *         objective_sense = objective_sense.lower()
 *         if objective_sense == "maximize":
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cobra.solvers.cglpk.GLP.set_objective_sense", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_objective_sense);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5cobra_7solvers_5cglpk_3GLP_19set_objective_sense(PyObject *__pyx_v_self, PyObject *__pyx_v_objective_sense); /*proto*/
static char __pyx_doc_5cobra_7solvers_5cglpk_3GLP_18set_objective_sense[] = "GLP.set_objective_sense(self, objective_sense)";
static PyObject *__pyx_pw_5cobra_7solvers_5cglpk_3GLP_19set_objective_sense(PyObject *__pyx_v_self, PyObject *__pyx_v_objective_sense) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_objective_sense (wrapper)", 0);
  __pyx_r = __pyx_pf_5cobra_7solvers_5cglpk_3GLP_18set_objective_sense(((struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *)__pyx_v_self), ((PyObject *)__pyx_v_objective_sense));

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

static PyObject *__pyx_pf_5cobra_7solvers_5cglpk_3GLP_18set_objective_sense(struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *__pyx_v_self, PyObject *__pyx_v_objective_sense) {
  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("set_objective_sense", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_5cobra_7solvers_5cglpk_3GLP_set_objective_sense(__pyx_v_self, __pyx_v_objective_sense, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cobra.solvers.cglpk.GLP.set_objective_sense", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cobra/solvers/cglpk.pyx":350
 *             raise ValueError("%s is not a valid objective sense" % objective_sense)
 * 
 *     cpdef set_parameter(self, parameter_name, value):             # <<<<<<<<<<<<<<
 *         """set a solver parameter"""
 *         if parameter_name == "objective_sense":
 */

static PyObject *__pyx_pw_5cobra_7solvers_5cglpk_3GLP_21set_parameter(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_5cobra_7solvers_5cglpk_3GLP_set_parameter(struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *__pyx_v_self, PyObject *__pyx_v_parameter_name, PyObject *__pyx_v_value, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  double __pyx_t_10;
  int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_parameter", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_parameter); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5cobra_7solvers_5cglpk_3GLP_21set_parameter)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      if (__pyx_t_4) {
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
      }
      __Pyx_INCREF(__pyx_v_parameter_name);
      __Pyx_GIVEREF(__pyx_v_parameter_name);
      PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_parameter_name);
      __Pyx_INCREF(__pyx_v_value);
      __Pyx_GIVEREF(__pyx_v_value);
      PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_value);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "cobra/solvers/cglpk.pyx":352
 *     cpdef set_parameter(self, parameter_name, value):
 *         """set a solver parameter"""
 *         if parameter_name == "objective_sense":             # <<<<<<<<<<<<<<
 *             self.set_objective_sense(value)
 *         elif parameter_name in {"time_limit", "tm_lim"}:
 */
  __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_v_parameter_name, __pyx_n_s_objective_sense, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_7) {

    /* "cobra/solvers/cglpk.pyx":353
 *         """set a solver parameter"""
 *         if parameter_name == "objective_sense":
 *             self.set_objective_sense(value)             # <<<<<<<<<<<<<<
 *         elif parameter_name in {"time_limit", "tm_lim"}:
 *             self.parameters.tm_lim = int(1000 * value)
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_5cobra_7solvers_5cglpk_GLP *)__pyx_v_self->__pyx_vtab)->set_objective_sense(__pyx_v_self, __pyx_v_value, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cobra/solvers/cglpk.pyx":352
 *     cpdef set_parameter(self, parameter_name, value):
 *         """set a solver parameter"""
 *         if parameter_name == "objective_sense":             # <<<<<<<<<<<<<<
 *             self.set_objective_sense(value)
 *         elif parameter_name in {"time_limit", "tm_lim"}:
 */
    goto __pyx_L3;
  }

  /* "cobra/solvers/cglpk.pyx":354
 *         if parameter_name == "objective_sense":
 *             self.set_objective_sense(value)
 *         elif parameter_name in {"time_limit", "tm_lim"}:             # <<<<<<<<<<<<<<
 *             self.parameters.tm_lim = int(1000 * value)
 *             # Setting a value less than 0.001 would cause us to not
 */
  __Pyx_INCREF(__pyx_v_parameter_name);
  __pyx_t_1 = __pyx_v_parameter_name;
  __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_time_limit, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (!__pyx_t_8) {
  } else {
    __pyx_t_7 = __pyx_t_8;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_tm_lim, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = __pyx_t_8;
  __pyx_L4_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_8 = (__pyx_t_7 != 0);
  if (__pyx_t_8) {

    /* "cobra/solvers/cglpk.pyx":355
 *             self.set_objective_sense(value)
 *         elif parameter_name in {"time_limit", "tm_lim"}:
 *             self.parameters.tm_lim = int(1000 * value)             # <<<<<<<<<<<<<<
 *             # Setting a value less than 0.001 would cause us to not
 *             # set a time limit at all. It's better to set a time limit
 */
    __pyx_t_1 = PyNumber_Multiply(__pyx_int_1000, __pyx_v_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_self->parameters.tm_lim = __pyx_t_9;

    /* "cobra/solvers/cglpk.pyx":354
 *         if parameter_name == "objective_sense":
 *             self.set_objective_sense(value)
 *         elif parameter_name in {"time_limit", "tm_lim"}:             # <<<<<<<<<<<<<<
 *             self.parameters.tm_lim = int(1000 * value)
 *             # Setting a value less than 0.001 would cause us to not
 */
    goto __pyx_L3;
  }

  /* "cobra/solvers/cglpk.pyx":361
 *             #if value > 0 and self.parameters.tm_lim == 0:
 *             #    self.parameters.tm_lim = 1
 *         elif parameter_name == "tolerance_feasibility":             # <<<<<<<<<<<<<<
 *             self.parameters.tol_bnd = float(value)
 *             self.parameters.tol_dj = float(value)
 */
  __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_v_parameter_name, __pyx_n_s_tolerance_feasibility, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_8) {

    /* "cobra/solvers/cglpk.pyx":362
 *             #    self.parameters.tm_lim = 1
 *         elif parameter_name == "tolerance_feasibility":
 *             self.parameters.tol_bnd = float(value)             # <<<<<<<<<<<<<<
 *             self.parameters.tol_dj = float(value)
 *         elif parameter_name == "tol_bnd":
 */
    __pyx_t_10 = __Pyx_PyObject_AsDouble(__pyx_v_value); if (unlikely(__pyx_t_10 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_self->parameters.tol_bnd = __pyx_t_10;

    /* "cobra/solvers/cglpk.pyx":363
 *         elif parameter_name == "tolerance_feasibility":
 *             self.parameters.tol_bnd = float(value)
 *             self.parameters.tol_dj = float(value)             # <<<<<<<<<<<<<<
 *         elif parameter_name == "tol_bnd":
 *             self.parameters.tol_bnd = float(value)
 */
    __pyx_t_10 = __Pyx_PyObject_AsDouble(__pyx_v_value); if (unlikely(__pyx_t_10 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_self->parameters.tol_dj = __pyx_t_10;

    /* "cobra/solvers/cglpk.pyx":361
 *             #if value > 0 and self.parameters.tm_lim == 0:
 *             #    self.parameters.tm_lim = 1
 *         elif parameter_name == "tolerance_feasibility":             # <<<<<<<<<<<<<<
 *             self.parameters.tol_bnd = float(value)
 *             self.parameters.tol_dj = float(value)
 */
    goto __pyx_L3;
  }

  /* "cobra/solvers/cglpk.pyx":364
 *             self.parameters.tol_bnd = float(value)
 *             self.parameters.tol_dj = float(value)
 *         elif parameter_name == "tol_bnd":             # <<<<<<<<<<<<<<
 *             self.parameters.tol_bnd = float(value)
 *         elif parameter_name == "tol_dj":
 */
  __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_v_parameter_name, __pyx_n_s_tol_bnd, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_8) {

    /* "cobra/solvers/cglpk.pyx":365
 *             self.parameters.tol_dj = float(value)
 *         elif parameter_name == "tol_bnd":
 *             self.parameters.tol_bnd = float(value)             # <<<<<<<<<<<<<<
 *         elif parameter_name == "tol_dj":
 *             self.parameters.tol_dj = float(value)
 */
    __pyx_t_10 = __Pyx_PyObject_AsDouble(__pyx_v_value); if (unlikely(__pyx_t_10 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_self->parameters.tol_bnd = __pyx_t_10;

    /* "cobra/solvers/cglpk.pyx":364
 *             self.parameters.tol_bnd = float(value)
 *             self.parameters.tol_dj = float(value)
 *         elif parameter_name == "tol_bnd":             # <<<<<<<<<<<<<<
 *             self.parameters.tol_bnd = float(value)
 *         elif parameter_name == "tol_dj":
 */
    goto __pyx_L3;
  }

  /* "cobra/solvers/cglpk.pyx":366
 *         elif parameter_name == "tol_bnd":
 *             self.parameters.tol_bnd = float(value)
 *         elif parameter_name == "tol_dj":             # <<<<<<<<<<<<<<
 *             self.parameters.tol_dj = float(value)
 *         elif parameter_name in {"tolerance_markowitz", "tol_piv"}:
 */
  __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_v_parameter_name, __pyx_n_s_tol_dj, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_8) {

    /* "cobra/solvers/cglpk.pyx":367
 *             self.parameters.tol_bnd = float(value)
 *         elif parameter_name == "tol_dj":
 *             self.parameters.tol_dj = float(value)             # <<<<<<<<<<<<<<
 *         elif parameter_name in {"tolerance_markowitz", "tol_piv"}:
 *             self.parameters.tol_piv = float(value)
 */
    __pyx_t_10 = __Pyx_PyObject_AsDouble(__pyx_v_value); if (unlikely(__pyx_t_10 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_self->parameters.tol_dj = __pyx_t_10;

    /* "cobra/solvers/cglpk.pyx":366
 *         elif parameter_name == "tol_bnd":
 *             self.parameters.tol_bnd = float(value)
 *         elif parameter_name == "tol_dj":             # <<<<<<<<<<<<<<
 *             self.parameters.tol_dj = float(value)
 *         elif parameter_name in {"tolerance_markowitz", "tol_piv"}:
 */
    goto __pyx_L3;
  }

  /* "cobra/solvers/cglpk.pyx":368
 *         elif parameter_name == "tol_dj":
 *             self.parameters.tol_dj = float(value)
 *         elif parameter_name in {"tolerance_markowitz", "tol_piv"}:             # <<<<<<<<<<<<<<
 *             self.parameters.tol_piv = float(value)
 *         elif parameter_name in {"tolerance_integer", "tol_int"}:
 */
  __Pyx_INCREF(__pyx_v_parameter_name);
  __pyx_t_2 = __pyx_v_parameter_name;
  __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_tolerance_markowitz, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (!__pyx_t_7) {
  } else {
    __pyx_t_8 = __pyx_t_7;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_tol_piv, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = __pyx_t_7;
  __pyx_L6_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_7 = (__pyx_t_8 != 0);
  if (__pyx_t_7) {

    /* "cobra/solvers/cglpk.pyx":369
 *             self.parameters.tol_dj = float(value)
 *         elif parameter_name in {"tolerance_markowitz", "tol_piv"}:
 *             self.parameters.tol_piv = float(value)             # <<<<<<<<<<<<<<
 *         elif parameter_name in {"tolerance_integer", "tol_int"}:
 *             self.integer_parameters.tol_int = float(value)
 */
    __pyx_t_10 = __Pyx_PyObject_AsDouble(__pyx_v_value); if (unlikely(__pyx_t_10 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_self->parameters.tol_piv = __pyx_t_10;

    /* "cobra/solvers/cglpk.pyx":368
 *         elif parameter_name == "tol_dj":
 *             self.parameters.tol_dj = float(value)
 *         elif parameter_name in {"tolerance_markowitz", "tol_piv"}:             # <<<<<<<<<<<<<<
 *             self.parameters.tol_piv = float(value)
 *         elif parameter_name in {"tolerance_integer", "tol_int"}:
 */
    goto __pyx_L3;
  }

  /* "cobra/solvers/cglpk.pyx":370
 *         elif parameter_name in {"tolerance_markowitz", "tol_piv"}:
 *             self.parameters.tol_piv = float(value)
 *         elif parameter_name in {"tolerance_integer", "tol_int"}:             # <<<<<<<<<<<<<<
 *             self.integer_parameters.tol_int = float(value)
 *         elif parameter_name in {"mip_gap", "MIP_gap"}:
 */
  __Pyx_INCREF(__pyx_v_parameter_name);
  __pyx_t_2 = __pyx_v_parameter_name;
  __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_tolerance_integer, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (!__pyx_t_8) {
  } else {
    __pyx_t_7 = __pyx_t_8;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_tol_int, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = __pyx_t_8;
  __pyx_L8_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_8 = (__pyx_t_7 != 0);
  if (__pyx_t_8) {

    /* "cobra/solvers/cglpk.pyx":371
 *             self.parameters.tol_piv = float(value)
 *         elif parameter_name in {"tolerance_integer", "tol_int"}:
 *             self.integer_parameters.tol_int = float(value)             # <<<<<<<<<<<<<<
 *         elif parameter_name in {"mip_gap", "MIP_gap"}:
 *             self.integer_parameters.mip_gap = float(value)
 */
    __pyx_t_10 = __Pyx_PyObject_AsDouble(__pyx_v_value); if (unlikely(__pyx_t_10 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_self->integer_parameters.tol_int = __pyx_t_10;

    /* "cobra/solvers/cglpk.pyx":370
 *         elif parameter_name in {"tolerance_markowitz", "tol_piv"}:
 *             self.parameters.tol_piv = float(value)
 *         elif parameter_name in {"tolerance_integer", "tol_int"}:             # <<<<<<<<<<<<<<
 *             self.integer_parameters.tol_int = float(value)
 *         elif parameter_name in {"mip_gap", "MIP_gap"}:
 */
    goto __pyx_L3;
  }

  /* "cobra/solvers/cglpk.pyx":372
 *         elif parameter_name in {"tolerance_integer", "tol_int"}:
 *             self.integer_parameters.tol_int = float(value)
 *         elif parameter_name in {"mip_gap", "MIP_gap"}:             # <<<<<<<<<<<<<<
 *             self.integer_parameters.mip_gap = float(value)
 *         elif parameter_name == "verbose":
 */
  __Pyx_INCREF(__pyx_v_parameter_name);
  __pyx_t_2 = __pyx_v_parameter_name;
  __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_mip_gap, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (!__pyx_t_7) {
  } else {
    __pyx_t_8 = __pyx_t_7;
    goto __pyx_L10_bool_binop_done;
  }
  __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_MIP_gap, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = __pyx_t_7;
  __pyx_L10_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_7 = (__pyx_t_8 != 0);
  if (__pyx_t_7) {

    /* "cobra/solvers/cglpk.pyx":373
 *             self.integer_parameters.tol_int = float(value)
 *         elif parameter_name in {"mip_gap", "MIP_gap"}:
 *             self.integer_parameters.mip_gap = float(value)             # <<<<<<<<<<<<<<
 *         elif parameter_name == "verbose":
 *             if not value:  # suppress all output
 */
    __pyx_t_10 = __Pyx_PyObject_AsDouble(__pyx_v_value); if (unlikely(__pyx_t_10 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_self->integer_parameters.mip_gap = __pyx_t_10;

    /* "cobra/solvers/cglpk.pyx":372
 *         elif parameter_name in {"tolerance_integer", "tol_int"}:
 *             self.integer_parameters.tol_int = float(value)
 *         elif parameter_name in {"mip_gap", "MIP_gap"}:             # <<<<<<<<<<<<<<
 *             self.integer_parameters.mip_gap = float(value)
 *         elif parameter_name == "verbose":
 */
    goto __pyx_L3;
  }

  /* "cobra/solvers/cglpk.pyx":374
 *         elif parameter_name in {"mip_gap", "MIP_gap"}:
 *             self.integer_parameters.mip_gap = float(value)
 *         elif parameter_name == "verbose":             # <<<<<<<<<<<<<<
 *             if not value:  # suppress all output
 *                 self.parameters.msg_lev = GLP_MSG_OFF
 */
  __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_v_parameter_name, __pyx_n_s_verbose, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_7) {

    /* "cobra/solvers/cglpk.pyx":375
 *             self.integer_parameters.mip_gap = float(value)
 *         elif parameter_name == "verbose":
 *             if not value:  # suppress all output             # <<<<<<<<<<<<<<
 *                 self.parameters.msg_lev = GLP_MSG_OFF
 *                 return
 */
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_8 = ((!__pyx_t_7) != 0);
    if (__pyx_t_8) {

      /* "cobra/solvers/cglpk.pyx":376
 *         elif parameter_name == "verbose":
 *             if not value:  # suppress all output
 *                 self.parameters.msg_lev = GLP_MSG_OFF             # <<<<<<<<<<<<<<
 *                 return
 *             if value == "err":
 */
      __pyx_v_self->parameters.msg_lev = GLP_MSG_OFF;

      /* "cobra/solvers/cglpk.pyx":377
 *             if not value:  # suppress all output
 *                 self.parameters.msg_lev = GLP_MSG_OFF
 *                 return             # <<<<<<<<<<<<<<
 *             if value == "err":
 *                 self.parameters.msg_lev = GLP_MSG_ERR
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;

      /* "cobra/solvers/cglpk.pyx":375
 *             self.integer_parameters.mip_gap = float(value)
 *         elif parameter_name == "verbose":
 *             if not value:  # suppress all output             # <<<<<<<<<<<<<<
 *                 self.parameters.msg_lev = GLP_MSG_OFF
 *                 return
 */
    }

    /* "cobra/solvers/cglpk.pyx":378
 *                 self.parameters.msg_lev = GLP_MSG_OFF
 *                 return
 *             if value == "err":             # <<<<<<<<<<<<<<
 *                 self.parameters.msg_lev = GLP_MSG_ERR
 *             elif value is True or value == "all":
 */
    __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_v_value, __pyx_n_s_err, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_8) {

      /* "cobra/solvers/cglpk.pyx":379
 *                 return
 *             if value == "err":
 *                 self.parameters.msg_lev = GLP_MSG_ERR             # <<<<<<<<<<<<<<
 *             elif value is True or value == "all":
 *                 self.parameters.msg_lev = GLP_MSG_ALL
 */
      __pyx_v_self->parameters.msg_lev = GLP_MSG_ERR;

      /* "cobra/solvers/cglpk.pyx":378
 *                 self.parameters.msg_lev = GLP_MSG_OFF
 *                 return
 *             if value == "err":             # <<<<<<<<<<<<<<
 *                 self.parameters.msg_lev = GLP_MSG_ERR
 *             elif value is True or value == "all":
 */
      goto __pyx_L13;
    }

    /* "cobra/solvers/cglpk.pyx":380
 *             if value == "err":
 *                 self.parameters.msg_lev = GLP_MSG_ERR
 *             elif value is True or value == "all":             # <<<<<<<<<<<<<<
 *                 self.parameters.msg_lev = GLP_MSG_ALL
 *             elif value == "normal":
 */
    __pyx_t_7 = (__pyx_v_value == Py_True);
    __pyx_t_11 = (__pyx_t_7 != 0);
    if (!__pyx_t_11) {
    } else {
      __pyx_t_8 = __pyx_t_11;
      goto __pyx_L14_bool_binop_done;
    }
    __pyx_t_11 = (__Pyx_PyString_Equals(__pyx_v_value, __pyx_n_s_all, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_8 = __pyx_t_11;
    __pyx_L14_bool_binop_done:;
    if (__pyx_t_8) {

      /* "cobra/solvers/cglpk.pyx":381
 *                 self.parameters.msg_lev = GLP_MSG_ERR
 *             elif value is True or value == "all":
 *                 self.parameters.msg_lev = GLP_MSG_ALL             # <<<<<<<<<<<<<<
 *             elif value == "normal":
 *                 self.parameters.msg_lev = GLP_MSG_ON
 */
      __pyx_v_self->parameters.msg_lev = GLP_MSG_ALL;

      /* "cobra/solvers/cglpk.pyx":380
 *             if value == "err":
 *                 self.parameters.msg_lev = GLP_MSG_ERR
 *             elif value is True or value == "all":             # <<<<<<<<<<<<<<
 *                 self.parameters.msg_lev = GLP_MSG_ALL
 *             elif value == "normal":
 */
      goto __pyx_L13;
    }

    /* "cobra/solvers/cglpk.pyx":382
 *             elif value is True or value == "all":
 *                 self.parameters.msg_lev = GLP_MSG_ALL
 *             elif value == "normal":             # <<<<<<<<<<<<<<
 *                 self.parameters.msg_lev = GLP_MSG_ON
 *         elif parameter_name == "iteration_limit":
 */
    __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_v_value, __pyx_n_s_normal, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_8) {

      /* "cobra/solvers/cglpk.pyx":383
 *                 self.parameters.msg_lev = GLP_MSG_ALL
 *             elif value == "normal":
 *                 self.parameters.msg_lev = GLP_MSG_ON             # <<<<<<<<<<<<<<
 *         elif parameter_name == "iteration_limit":
 *             self.parameters.it_lim = value
 */
      __pyx_v_self->parameters.msg_lev = GLP_MSG_ON;

      /* "cobra/solvers/cglpk.pyx":382
 *             elif value is True or value == "all":
 *                 self.parameters.msg_lev = GLP_MSG_ALL
 *             elif value == "normal":             # <<<<<<<<<<<<<<
 *                 self.parameters.msg_lev = GLP_MSG_ON
 *         elif parameter_name == "iteration_limit":
 */
    }
    __pyx_L13:;

    /* "cobra/solvers/cglpk.pyx":374
 *         elif parameter_name in {"mip_gap", "MIP_gap"}:
 *             self.integer_parameters.mip_gap = float(value)
 *         elif parameter_name == "verbose":             # <<<<<<<<<<<<<<
 *             if not value:  # suppress all output
 *                 self.parameters.msg_lev = GLP_MSG_OFF
 */
    goto __pyx_L3;
  }

  /* "cobra/solvers/cglpk.pyx":384
 *             elif value == "normal":
 *                 self.parameters.msg_lev = GLP_MSG_ON
 *         elif parameter_name == "iteration_limit":             # <<<<<<<<<<<<<<
 *             self.parameters.it_lim = value
 *         elif parameter_name == "lp_method":
 */
  __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_v_parameter_name, __pyx_n_s_iteration_limit, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_8) {

    /* "cobra/solvers/cglpk.pyx":385
 *                 self.parameters.msg_lev = GLP_MSG_ON
 *         elif parameter_name == "iteration_limit":
 *             self.parameters.it_lim = value             # <<<<<<<<<<<<<<
 *         elif parameter_name == "lp_method":
 *             self.parameters.meth = METHODS[value]
 */
    __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_self->parameters.it_lim = __pyx_t_9;

    /* "cobra/solvers/cglpk.pyx":384
 *             elif value == "normal":
 *                 self.parameters.msg_lev = GLP_MSG_ON
 *         elif parameter_name == "iteration_limit":             # <<<<<<<<<<<<<<
 *             self.parameters.it_lim = value
 *         elif parameter_name == "lp_method":
 */
    goto __pyx_L3;
  }

  /* "cobra/solvers/cglpk.pyx":386
 *         elif parameter_name == "iteration_limit":
 *             self.parameters.it_lim = value
 *         elif parameter_name == "lp_method":             # <<<<<<<<<<<<<<
 *             self.parameters.meth = METHODS[value]
 *         elif parameter_name == "exact":
 */
  __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_v_parameter_name, __pyx_n_s_lp_method, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_8) {

    /* "cobra/solvers/cglpk.pyx":387
 *             self.parameters.it_lim = value
 *         elif parameter_name == "lp_method":
 *             self.parameters.meth = METHODS[value]             # <<<<<<<<<<<<<<
 *         elif parameter_name == "exact":
 *             self.exact = value
 */
    if (unlikely(__pyx_v_5cobra_7solvers_5cglpk_METHODS == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_5cobra_7solvers_5cglpk_METHODS, __pyx_v_value); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_self->parameters.meth = __pyx_t_9;

    /* "cobra/solvers/cglpk.pyx":386
 *         elif parameter_name == "iteration_limit":
 *             self.parameters.it_lim = value
 *         elif parameter_name == "lp_method":             # <<<<<<<<<<<<<<
 *             self.parameters.meth = METHODS[value]
 *         elif parameter_name == "exact":
 */
    goto __pyx_L3;
  }

  /* "cobra/solvers/cglpk.pyx":388
 *         elif parameter_name == "lp_method":
 *             self.parameters.meth = METHODS[value]
 *         elif parameter_name == "exact":             # <<<<<<<<<<<<<<
 *             self.exact = value
 *         elif parameter_name == "threads":
 */
  __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_v_parameter_name, __pyx_n_s_exact, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_8) {

    /* "cobra/solvers/cglpk.pyx":389
 *             self.parameters.meth = METHODS[value]
 *         elif parameter_name == "exact":
 *             self.exact = value             # <<<<<<<<<<<<<<
 *         elif parameter_name == "threads":
 *             _warn("multiple threads not supported")
 */
    if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_7cpython_4bool_bool))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = __pyx_v_value;
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __Pyx_GOTREF(__pyx_v_self->exact);
    __Pyx_DECREF(((PyObject *)__pyx_v_self->exact));
    __pyx_v_self->exact = ((PyBoolObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "cobra/solvers/cglpk.pyx":388
 *         elif parameter_name == "lp_method":
 *             self.parameters.meth = METHODS[value]
 *         elif parameter_name == "exact":             # <<<<<<<<<<<<<<
 *             self.exact = value
 *         elif parameter_name == "threads":
 */
    goto __pyx_L3;
  }

  /* "cobra/solvers/cglpk.pyx":390
 *         elif parameter_name == "exact":
 *             self.exact = value
 *         elif parameter_name == "threads":             # <<<<<<<<<<<<<<
 *             _warn("multiple threads not supported")
 *         elif parameter_name == "MIP_gap_abs":
 */
  __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_v_parameter_name, __pyx_n_s_threads, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_8) {

    /* "cobra/solvers/cglpk.pyx":391
 *             self.exact = value
 *         elif parameter_name == "threads":
 *             _warn("multiple threads not supported")             # <<<<<<<<<<<<<<
 *         elif parameter_name == "MIP_gap_abs":
 *             _warn("setting aboslute mip gap not supported")
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_warn); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cobra/solvers/cglpk.pyx":390
 *         elif parameter_name == "exact":
 *             self.exact = value
 *         elif parameter_name == "threads":             # <<<<<<<<<<<<<<
 *             _warn("multiple threads not supported")
 *         elif parameter_name == "MIP_gap_abs":
 */
    goto __pyx_L3;
  }

  /* "cobra/solvers/cglpk.pyx":392
 *         elif parameter_name == "threads":
 *             _warn("multiple threads not supported")
 *         elif parameter_name == "MIP_gap_abs":             # <<<<<<<<<<<<<<
 *             _warn("setting aboslute mip gap not supported")
 *         elif parameter_name == "presolve":
 */
  __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_v_parameter_name, __pyx_n_s_MIP_gap_abs, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_8) {

    /* "cobra/solvers/cglpk.pyx":393
 *             _warn("multiple threads not supported")
 *         elif parameter_name == "MIP_gap_abs":
 *             _warn("setting aboslute mip gap not supported")             # <<<<<<<<<<<<<<
 *         elif parameter_name == "presolve":
 *             self.parameters.presolve = GLP_ON if value else GLP_OFF
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_warn); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cobra/solvers/cglpk.pyx":392
 *         elif parameter_name == "threads":
 *             _warn("multiple threads not supported")
 *         elif parameter_name == "MIP_gap_abs":             # <<<<<<<<<<<<<<
 *             _warn("setting aboslute mip gap not supported")
 *         elif parameter_name == "presolve":
 */
    goto __pyx_L3;
  }

  /* "cobra/solvers/cglpk.pyx":394
 *         elif parameter_name == "MIP_gap_abs":
 *             _warn("setting aboslute mip gap not supported")
 *         elif parameter_name == "presolve":             # <<<<<<<<<<<<<<
 *             self.parameters.presolve = GLP_ON if value else GLP_OFF
 *         elif parameter_name == "pricing":
 */
  __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_v_parameter_name, __pyx_n_s_presolve, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_8) {

    /* "cobra/solvers/cglpk.pyx":395
 *             _warn("setting aboslute mip gap not supported")
 *         elif parameter_name == "presolve":
 *             self.parameters.presolve = GLP_ON if value else GLP_OFF             # <<<<<<<<<<<<<<
 *         elif parameter_name == "pricing":
 *             self.parameters.pricing = PRICINGS[value]
 */
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_8) {
      __pyx_t_9 = GLP_ON;
    } else {
      __pyx_t_9 = GLP_OFF;
    }
    __pyx_v_self->parameters.presolve = __pyx_t_9;

    /* "cobra/solvers/cglpk.pyx":394
 *         elif parameter_name == "MIP_gap_abs":
 *             _warn("setting aboslute mip gap not supported")
 *         elif parameter_name == "presolve":             # <<<<<<<<<<<<<<
 *             self.parameters.presolve = GLP_ON if value else GLP_OFF
 *         elif parameter_name == "pricing":
 */
    goto __pyx_L3;
  }

  /* "cobra/solvers/cglpk.pyx":396
 *         elif parameter_name == "presolve":
 *             self.parameters.presolve = GLP_ON if value else GLP_OFF
 *         elif parameter_name == "pricing":             # <<<<<<<<<<<<<<
 *             self.parameters.pricing = PRICINGS[value]
 *         elif parameter_name == "r_test":
 */
  __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_v_parameter_name, __pyx_n_s_pricing, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_8) {

    /* "cobra/solvers/cglpk.pyx":397
 *             self.parameters.presolve = GLP_ON if value else GLP_OFF
 *         elif parameter_name == "pricing":
 *             self.parameters.pricing = PRICINGS[value]             # <<<<<<<<<<<<<<
 *         elif parameter_name == "r_test":
 *             self.parameters.r_test = RATIOS[value]
 */
    if (unlikely(__pyx_v_5cobra_7solvers_5cglpk_PRICINGS == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_5cobra_7solvers_5cglpk_PRICINGS, __pyx_v_value); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_self->parameters.pricing = __pyx_t_9;

    /* "cobra/solvers/cglpk.pyx":396
 *         elif parameter_name == "presolve":
 *             self.parameters.presolve = GLP_ON if value else GLP_OFF
 *         elif parameter_name == "pricing":             # <<<<<<<<<<<<<<
 *             self.parameters.pricing = PRICINGS[value]
 *         elif parameter_name == "r_test":
 */
    goto __pyx_L3;
  }

  /* "cobra/solvers/cglpk.pyx":398
 *         elif parameter_name == "pricing":
 *             self.parameters.pricing = PRICINGS[value]
 *         elif parameter_name == "r_test":             # <<<<<<<<<<<<<<
 *             self.parameters.r_test = RATIOS[value]
 *         elif parameter_name == "scale":
 */
  __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_v_parameter_name, __pyx_n_s_r_test, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_8) {

    /* "cobra/solvers/cglpk.pyx":399
 *             self.parameters.pricing = PRICINGS[value]
 *         elif parameter_name == "r_test":
 *             self.parameters.r_test = RATIOS[value]             # <<<<<<<<<<<<<<
 *         elif parameter_name == "scale":
 *             if value:
 */
    if (unlikely(__pyx_v_5cobra_7solvers_5cglpk_RATIOS == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_5cobra_7solvers_5cglpk_RATIOS, __pyx_v_value); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_self->parameters.r_test = __pyx_t_9;

    /* "cobra/solvers/cglpk.pyx":398
 *         elif parameter_name == "pricing":
 *             self.parameters.pricing = PRICINGS[value]
 *         elif parameter_name == "r_test":             # <<<<<<<<<<<<<<
 *             self.parameters.r_test = RATIOS[value]
 *         elif parameter_name == "scale":
 */
    goto __pyx_L3;
  }

  /* "cobra/solvers/cglpk.pyx":400
 *         elif parameter_name == "r_test":
 *             self.parameters.r_test = RATIOS[value]
 *         elif parameter_name == "scale":             # <<<<<<<<<<<<<<
 *             if value:
 *                 if isinstance(value, int):
 */
  __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_v_parameter_name, __pyx_n_s_scale, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_8) {

    /* "cobra/solvers/cglpk.pyx":401
 *             self.parameters.r_test = RATIOS[value]
 *         elif parameter_name == "scale":
 *             if value:             # <<<<<<<<<<<<<<
 *                 if isinstance(value, int):
 *                     glp_scale_prob(self.glp, value)
 */
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_8) {

      /* "cobra/solvers/cglpk.pyx":402
 *         elif parameter_name == "scale":
 *             if value:
 *                 if isinstance(value, int):             # <<<<<<<<<<<<<<
 *                     glp_scale_prob(self.glp, value)
 *                 else:
 */
      __pyx_t_8 = PyInt_Check(__pyx_v_value); 
      __pyx_t_11 = (__pyx_t_8 != 0);
      if (__pyx_t_11) {

        /* "cobra/solvers/cglpk.pyx":403
 *             if value:
 *                 if isinstance(value, int):
 *                     glp_scale_prob(self.glp, value)             # <<<<<<<<<<<<<<
 *                 else:
 *                     glp_scale_prob(self.glp, SCALINGS[value])
 */
        __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        glp_scale_prob(__pyx_v_self->glp, __pyx_t_9);

        /* "cobra/solvers/cglpk.pyx":402
 *         elif parameter_name == "scale":
 *             if value:
 *                 if isinstance(value, int):             # <<<<<<<<<<<<<<
 *                     glp_scale_prob(self.glp, value)
 *                 else:
 */
        goto __pyx_L17;
      }

      /* "cobra/solvers/cglpk.pyx":405
 *                     glp_scale_prob(self.glp, value)
 *                 else:
 *                     glp_scale_prob(self.glp, SCALINGS[value])             # <<<<<<<<<<<<<<
 *             else:
 *                 glp_unscale_prob(self.glp)
 */
      /*else*/ {
        if (unlikely(__pyx_v_5cobra_7solvers_5cglpk_SCALINGS == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_5cobra_7solvers_5cglpk_SCALINGS, __pyx_v_value); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        glp_scale_prob(__pyx_v_self->glp, __pyx_t_9);
      }
      __pyx_L17:;

      /* "cobra/solvers/cglpk.pyx":401
 *             self.parameters.r_test = RATIOS[value]
 *         elif parameter_name == "scale":
 *             if value:             # <<<<<<<<<<<<<<
 *                 if isinstance(value, int):
 *                     glp_scale_prob(self.glp, value)
 */
      goto __pyx_L16;
    }

    /* "cobra/solvers/cglpk.pyx":407
 *                     glp_scale_prob(self.glp, SCALINGS[value])
 *             else:
 *                 glp_unscale_prob(self.glp)             # <<<<<<<<<<<<<<
 *         elif parameter_name == "quadratic_component":
 *             if value is not None:
 */
    /*else*/ {
      glp_unscale_prob(__pyx_v_self->glp);
    }
    __pyx_L16:;

    /* "cobra/solvers/cglpk.pyx":400
 *         elif parameter_name == "r_test":
 *             self.parameters.r_test = RATIOS[value]
 *         elif parameter_name == "scale":             # <<<<<<<<<<<<<<
 *             if value:
 *                 if isinstance(value, int):
 */
    goto __pyx_L3;
  }

  /* "cobra/solvers/cglpk.pyx":408
 *             else:
 *                 glp_unscale_prob(self.glp)
 *         elif parameter_name == "quadratic_component":             # <<<<<<<<<<<<<<
 *             if value is not None:
 *                 raise ValueError("quadratic component must be None for glpk")
 */
  __pyx_t_11 = (__Pyx_PyString_Equals(__pyx_v_parameter_name, __pyx_n_s_quadratic_component, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_11) {

    /* "cobra/solvers/cglpk.pyx":409
 *                 glp_unscale_prob(self.glp)
 *         elif parameter_name == "quadratic_component":
 *             if value is not None:             # <<<<<<<<<<<<<<
 *                 raise ValueError("quadratic component must be None for glpk")
 *         else:
 */
    __pyx_t_11 = (__pyx_v_value != Py_None);
    __pyx_t_8 = (__pyx_t_11 != 0);
    if (__pyx_t_8) {

      /* "cobra/solvers/cglpk.pyx":410
 *         elif parameter_name == "quadratic_component":
 *             if value is not None:
 *                 raise ValueError("quadratic component must be None for glpk")             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError("unknown parameter " + str(parameter_name))
 */
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __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 = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "cobra/solvers/cglpk.pyx":409
 *                 glp_unscale_prob(self.glp)
 *         elif parameter_name == "quadratic_component":
 *             if value is not None:             # <<<<<<<<<<<<<<
 *                 raise ValueError("quadratic component must be None for glpk")
 *         else:
 */
    }

    /* "cobra/solvers/cglpk.pyx":408
 *             else:
 *                 glp_unscale_prob(self.glp)
 *         elif parameter_name == "quadratic_component":             # <<<<<<<<<<<<<<
 *             if value is not None:
 *                 raise ValueError("quadratic component must be None for glpk")
 */
    goto __pyx_L3;
  }

  /* "cobra/solvers/cglpk.pyx":412
 *                 raise ValueError("quadratic component must be None for glpk")
 *         else:
 *             raise ValueError("unknown parameter " + str(parameter_name))             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_objective_value(self):
 */
  /*else*/ {
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_parameter_name);
    __Pyx_GIVEREF(__pyx_v_parameter_name);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_parameter_name);
    __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyNumber_Add(__pyx_kp_s_unknown_parameter, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

  /* "cobra/solvers/cglpk.pyx":350
 *             raise ValueError("%s is not a valid objective sense" % objective_sense)
 * 
 *     cpdef set_parameter(self, parameter_name, value):             # <<<<<<<<<<<<<<
 *         """set a solver parameter"""
 *         if parameter_name == "objective_sense":
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("cobra.solvers.cglpk.GLP.set_parameter", __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_5cobra_7solvers_5cglpk_3GLP_21set_parameter(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5cobra_7solvers_5cglpk_3GLP_20set_parameter[] = "GLP.set_parameter(self, parameter_name, value)\nset a solver parameter";
static PyObject *__pyx_pw_5cobra_7solvers_5cglpk_3GLP_21set_parameter(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_parameter_name = 0;
  PyObject *__pyx_v_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_parameter (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_parameter_name,&__pyx_n_s_value,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_parameter_name)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_parameter", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_parameter") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __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_parameter_name = values[0];
    __pyx_v_value = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_parameter", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("cobra.solvers.cglpk.GLP.set_parameter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5cobra_7solvers_5cglpk_3GLP_20set_parameter(((struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *)__pyx_v_self), __pyx_v_parameter_name, __pyx_v_value);

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

static PyObject *__pyx_pf_5cobra_7solvers_5cglpk_3GLP_20set_parameter(struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *__pyx_v_self, PyObject *__pyx_v_parameter_name, PyObject *__pyx_v_value) {
  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("set_parameter", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_5cobra_7solvers_5cglpk_3GLP_set_parameter(__pyx_v_self, __pyx_v_parameter_name, __pyx_v_value, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cobra.solvers.cglpk.GLP.set_parameter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cobra/solvers/cglpk.pyx":414
 *             raise ValueError("unknown parameter " + str(parameter_name))
 * 
 *     cpdef get_objective_value(self):             # <<<<<<<<<<<<<<
 *         if self.is_mip():
 *             return glp_mip_obj_val(self.glp)
 */

static PyObject *__pyx_pw_5cobra_7solvers_5cglpk_3GLP_23get_objective_value(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_5cobra_7solvers_5cglpk_3GLP_get_objective_value(struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_objective_value", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_objective_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5cobra_7solvers_5cglpk_3GLP_23get_objective_value)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "cobra/solvers/cglpk.pyx":415
 * 
 *     cpdef get_objective_value(self):
 *         if self.is_mip():             # <<<<<<<<<<<<<<
 *             return glp_mip_obj_val(self.glp)
 *         return glp_get_obj_val(self.glp)
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_5cobra_7solvers_5cglpk_GLP *)__pyx_v_self->__pyx_vtab)->is_mip(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_5) {

    /* "cobra/solvers/cglpk.pyx":416
 *     cpdef get_objective_value(self):
 *         if self.is_mip():
 *             return glp_mip_obj_val(self.glp)             # <<<<<<<<<<<<<<
 *         return glp_get_obj_val(self.glp)
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyFloat_FromDouble(glp_mip_obj_val(__pyx_v_self->glp)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cobra/solvers/cglpk.pyx":415
 * 
 *     cpdef get_objective_value(self):
 *         if self.is_mip():             # <<<<<<<<<<<<<<
 *             return glp_mip_obj_val(self.glp)
 *         return glp_get_obj_val(self.glp)
 */
  }

  /* "cobra/solvers/cglpk.pyx":417
 *         if self.is_mip():
 *             return glp_mip_obj_val(self.glp)
 *         return glp_get_obj_val(self.glp)             # <<<<<<<<<<<<<<
 * 
 *     cpdef change_variable_objective(self, int index, double value):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(glp_get_obj_val(__pyx_v_self->glp)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cobra/solvers/cglpk.pyx":414
 *             raise ValueError("unknown parameter " + str(parameter_name))
 * 
 *     cpdef get_objective_value(self):             # <<<<<<<<<<<<<<
 *         if self.is_mip():
 *             return glp_mip_obj_val(self.glp)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cobra.solvers.cglpk.GLP.get_objective_value", __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_5cobra_7solvers_5cglpk_3GLP_23get_objective_value(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5cobra_7solvers_5cglpk_3GLP_22get_objective_value[] = "GLP.get_objective_value(self)";
static PyObject *__pyx_pw_5cobra_7solvers_5cglpk_3GLP_23get_objective_value(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_objective_value (wrapper)", 0);
  __pyx_r = __pyx_pf_5cobra_7solvers_5cglpk_3GLP_22get_objective_value(((struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *)__pyx_v_self));

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

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cobra.solvers.cglpk.GLP.get_objective_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cobra/solvers/cglpk.pyx":419
 *         return glp_get_obj_val(self.glp)
 * 
 *     cpdef change_variable_objective(self, int index, double value):             # <<<<<<<<<<<<<<
 *         assert index >= 0
 *         glp_set_obj_coef(self.glp, index + 1, value)
 */

static PyObject *__pyx_pw_5cobra_7solvers_5cglpk_3GLP_25change_variable_objective(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_5cobra_7solvers_5cglpk_3GLP_change_variable_objective(struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *__pyx_v_self, int __pyx_v_index, double __pyx_v_value, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("change_variable_objective", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_change_variable_objective); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5cobra_7solvers_5cglpk_3GLP_25change_variable_objective)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_index); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyFloat_FromDouble(__pyx_v_value); 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_INCREF(__pyx_t_1);
      __pyx_t_5 = __pyx_t_1; __pyx_t_6 = NULL;
      __pyx_t_7 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
          __pyx_t_7 = 1;
        }
      }
      __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      if (__pyx_t_6) {
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_4);
      __pyx_t_3 = 0;
      __pyx_t_4 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "cobra/solvers/cglpk.pyx":420
 * 
 *     cpdef change_variable_objective(self, int index, double value):
 *         assert index >= 0             # <<<<<<<<<<<<<<
 *         glp_set_obj_coef(self.glp, index + 1, value)
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    if (unlikely(!((__pyx_v_index >= 0) != 0))) {
      PyErr_SetNone(PyExc_AssertionError);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "cobra/solvers/cglpk.pyx":421
 *     cpdef change_variable_objective(self, int index, double value):
 *         assert index >= 0
 *         glp_set_obj_coef(self.glp, index + 1, value)             # <<<<<<<<<<<<<<
 * 
 *     cpdef is_mip(self):
 */
  glp_set_obj_coef(__pyx_v_self->glp, (__pyx_v_index + 1), __pyx_v_value);

  /* "cobra/solvers/cglpk.pyx":419
 *         return glp_get_obj_val(self.glp)
 * 
 *     cpdef change_variable_objective(self, int index, double value):             # <<<<<<<<<<<<<<
 *         assert index >= 0
 *         glp_set_obj_coef(self.glp, index + 1, value)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("cobra.solvers.cglpk.GLP.change_variable_objective", __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_5cobra_7solvers_5cglpk_3GLP_25change_variable_objective(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5cobra_7solvers_5cglpk_3GLP_24change_variable_objective[] = "GLP.change_variable_objective(self, int index, double value)";
static PyObject *__pyx_pw_5cobra_7solvers_5cglpk_3GLP_25change_variable_objective(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_index;
  double __pyx_v_value;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("change_variable_objective (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_value,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_index)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("change_variable_objective", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "change_variable_objective") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __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_index = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_index == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_value = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_value == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("change_variable_objective", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("cobra.solvers.cglpk.GLP.change_variable_objective", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5cobra_7solvers_5cglpk_3GLP_24change_variable_objective(((struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *)__pyx_v_self), __pyx_v_index, __pyx_v_value);

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

static PyObject *__pyx_pf_5cobra_7solvers_5cglpk_3GLP_24change_variable_objective(struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *__pyx_v_self, int __pyx_v_index, double __pyx_v_value) {
  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("change_variable_objective", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_5cobra_7solvers_5cglpk_3GLP_change_variable_objective(__pyx_v_self, __pyx_v_index, __pyx_v_value, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cobra.solvers.cglpk.GLP.change_variable_objective", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cobra/solvers/cglpk.pyx":423
 *         glp_set_obj_coef(self.glp, index + 1, value)
 * 
 *     cpdef is_mip(self):             # <<<<<<<<<<<<<<
 *         return glp_get_num_int(self.glp) > 0
 * 
 */

static PyObject *__pyx_pw_5cobra_7solvers_5cglpk_3GLP_27is_mip(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_5cobra_7solvers_5cglpk_3GLP_is_mip(struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_mip", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_mip); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5cobra_7solvers_5cglpk_3GLP_27is_mip)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "cobra/solvers/cglpk.pyx":424
 * 
 *     cpdef is_mip(self):
 *         return glp_get_num_int(self.glp) > 0             # <<<<<<<<<<<<<<
 * 
 *     def format_solution(self, cobra_model):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong((glp_get_num_int(__pyx_v_self->glp) > 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cobra/solvers/cglpk.pyx":423
 *         glp_set_obj_coef(self.glp, index + 1, value)
 * 
 *     cpdef is_mip(self):             # <<<<<<<<<<<<<<
 *         return glp_get_num_int(self.glp) > 0
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cobra.solvers.cglpk.GLP.is_mip", __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_5cobra_7solvers_5cglpk_3GLP_27is_mip(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5cobra_7solvers_5cglpk_3GLP_26is_mip[] = "GLP.is_mip(self)";
static PyObject *__pyx_pw_5cobra_7solvers_5cglpk_3GLP_27is_mip(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_mip (wrapper)", 0);
  __pyx_r = __pyx_pf_5cobra_7solvers_5cglpk_3GLP_26is_mip(((struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *)__pyx_v_self));

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

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cobra.solvers.cglpk.GLP.is_mip", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cobra/solvers/cglpk.pyx":426
 *         return glp_get_num_int(self.glp) > 0
 * 
 *     def format_solution(self, cobra_model):             # <<<<<<<<<<<<<<
 *         cdef int i, m, n
 *         cdef glp_prob *glp = self.glp
 */

/* Python wrapper */
static PyObject *__pyx_pw_5cobra_7solvers_5cglpk_3GLP_29format_solution(PyObject *__pyx_v_self, PyObject *__pyx_v_cobra_model); /*proto*/
static char __pyx_doc_5cobra_7solvers_5cglpk_3GLP_28format_solution[] = "GLP.format_solution(self, cobra_model)";
static PyObject *__pyx_pw_5cobra_7solvers_5cglpk_3GLP_29format_solution(PyObject *__pyx_v_self, PyObject *__pyx_v_cobra_model) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("format_solution (wrapper)", 0);
  __pyx_r = __pyx_pf_5cobra_7solvers_5cglpk_3GLP_28format_solution(((struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *)__pyx_v_self), ((PyObject *)__pyx_v_cobra_model));

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

static PyObject *__pyx_pf_5cobra_7solvers_5cglpk_3GLP_28format_solution(struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *__pyx_v_self, PyObject *__pyx_v_cobra_model) {
  int __pyx_v_i;
  int __pyx_v_m;
  int __pyx_v_n;
  glp_prob *__pyx_v_glp;
  PyObject *__pyx_v_Solution = NULL;
  PyObject *__pyx_v_status = NULL;
  PyObject *__pyx_v_solution = NULL;
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_v_y = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  glp_prob *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  long __pyx_t_6;
  int __pyx_t_7;
  long __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  PyObject *(*__pyx_t_10)(PyObject *);
  PyObject *__pyx_t_11 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("format_solution", 0);

  /* "cobra/solvers/cglpk.pyx":428
 *     def format_solution(self, cobra_model):
 *         cdef int i, m, n
 *         cdef glp_prob *glp = self.glp             # <<<<<<<<<<<<<<
 *         Solution = cobra_model.solution.__class__
 *         status = self.get_status()
 */
  __pyx_t_1 = __pyx_v_self->glp;
  __pyx_v_glp = __pyx_t_1;

  /* "cobra/solvers/cglpk.pyx":429
 *         cdef int i, m, n
 *         cdef glp_prob *glp = self.glp
 *         Solution = cobra_model.solution.__class__             # <<<<<<<<<<<<<<
 *         status = self.get_status()
 *         if status != "optimal":  # todo handle other possible
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cobra_model, __pyx_n_s_solution); 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_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_class); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_Solution = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "cobra/solvers/cglpk.pyx":430
 *         cdef glp_prob *glp = self.glp
 *         Solution = cobra_model.solution.__class__
 *         status = self.get_status()             # <<<<<<<<<<<<<<
 *         if status != "optimal":  # todo handle other possible
 *             return Solution(None, status=status)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_status); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_4) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else {
    __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_status = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "cobra/solvers/cglpk.pyx":431
 *         Solution = cobra_model.solution.__class__
 *         status = self.get_status()
 *         if status != "optimal":  # todo handle other possible             # <<<<<<<<<<<<<<
 *             return Solution(None, status=status)
 *         solution = Solution(self.get_objective_value(), status=status)
 */
  __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_status, __pyx_n_s_optimal, Py_NE)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_5) {

    /* "cobra/solvers/cglpk.pyx":432
 *         status = self.get_status()
 *         if status != "optimal":  # todo handle other possible
 *             return Solution(None, status=status)             # <<<<<<<<<<<<<<
 *         solution = Solution(self.get_objective_value(), status=status)
 *         m = glp_get_num_rows(glp)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_status, __pyx_v_status) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_Solution, __pyx_tuple__4, __pyx_t_3); 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(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cobra/solvers/cglpk.pyx":431
 *         Solution = cobra_model.solution.__class__
 *         status = self.get_status()
 *         if status != "optimal":  # todo handle other possible             # <<<<<<<<<<<<<<
 *             return Solution(None, status=status)
 *         solution = Solution(self.get_objective_value(), status=status)
 */
  }

  /* "cobra/solvers/cglpk.pyx":433
 *         if status != "optimal":  # todo handle other possible
 *             return Solution(None, status=status)
 *         solution = Solution(self.get_objective_value(), status=status)             # <<<<<<<<<<<<<<
 *         m = glp_get_num_rows(glp)
 *         n = glp_get_num_cols(glp)
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_5cobra_7solvers_5cglpk_GLP *)__pyx_v_self->__pyx_vtab)->get_objective_value(__pyx_v_self, 0); 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_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); 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);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_status, __pyx_v_status) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_v_Solution, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_solution = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "cobra/solvers/cglpk.pyx":434
 *             return Solution(None, status=status)
 *         solution = Solution(self.get_objective_value(), status=status)
 *         m = glp_get_num_rows(glp)             # <<<<<<<<<<<<<<
 *         n = glp_get_num_cols(glp)
 *         x = [0] * n
 */
  __pyx_v_m = glp_get_num_rows(__pyx_v_glp);

  /* "cobra/solvers/cglpk.pyx":435
 *         solution = Solution(self.get_objective_value(), status=status)
 *         m = glp_get_num_rows(glp)
 *         n = glp_get_num_cols(glp)             # <<<<<<<<<<<<<<
 *         x = [0] * n
 *         if self.is_mip():
 */
  __pyx_v_n = glp_get_num_cols(__pyx_v_glp);

  /* "cobra/solvers/cglpk.pyx":436
 *         m = glp_get_num_rows(glp)
 *         n = glp_get_num_cols(glp)
 *         x = [0] * n             # <<<<<<<<<<<<<<
 *         if self.is_mip():
 *             for i in range(1, n + 1):
 */
  __pyx_t_4 = PyList_New(1 * ((__pyx_v_n<0) ? 0:__pyx_v_n)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  { Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < __pyx_v_n; __pyx_temp++) {
      __Pyx_INCREF(__pyx_int_0);
      __Pyx_GIVEREF(__pyx_int_0);
      PyList_SET_ITEM(__pyx_t_4, __pyx_temp, __pyx_int_0);
    }
  }
  __pyx_v_x = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "cobra/solvers/cglpk.pyx":437
 *         n = glp_get_num_cols(glp)
 *         x = [0] * n
 *         if self.is_mip():             # <<<<<<<<<<<<<<
 *             for i in range(1, n + 1):
 *                     x[i - 1] = glp_mip_col_val(glp, i)
 */
  __pyx_t_4 = ((struct __pyx_vtabstruct_5cobra_7solvers_5cglpk_GLP *)__pyx_v_self->__pyx_vtab)->is_mip(__pyx_v_self, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_5) {

    /* "cobra/solvers/cglpk.pyx":438
 *         x = [0] * n
 *         if self.is_mip():
 *             for i in range(1, n + 1):             # <<<<<<<<<<<<<<
 *                     x[i - 1] = glp_mip_col_val(glp, i)
 *             solution.x_dict = {rxn.id: x[i] for i, rxn
 */
    __pyx_t_6 = (__pyx_v_n + 1);
    for (__pyx_t_7 = 1; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
      __pyx_v_i = __pyx_t_7;

      /* "cobra/solvers/cglpk.pyx":439
 *         if self.is_mip():
 *             for i in range(1, n + 1):
 *                     x[i - 1] = glp_mip_col_val(glp, i)             # <<<<<<<<<<<<<<
 *             solution.x_dict = {rxn.id: x[i] for i, rxn
 *                                in enumerate(cobra_model.reactions)}
 */
      __pyx_t_4 = PyFloat_FromDouble(glp_mip_col_val(__pyx_v_glp, __pyx_v_i)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_8 = (__pyx_v_i - 1);
      if (unlikely(__Pyx_SetItemInt(__pyx_v_x, __pyx_t_8, __pyx_t_4, long, 1, __Pyx_PyInt_From_long, 1, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }

    /* "cobra/solvers/cglpk.pyx":440
 *             for i in range(1, n + 1):
 *                     x[i - 1] = glp_mip_col_val(glp, i)
 *             solution.x_dict = {rxn.id: x[i] for i, rxn             # <<<<<<<<<<<<<<
 *                                in enumerate(cobra_model.reactions)}
 *             solution.x = x
 */
    { /* enter inner scope */
      int __pyx_8genexpr1__pyx_v_i;
      PyObject *__pyx_8genexpr1__pyx_v_rxn = NULL;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = 0;

      /* "cobra/solvers/cglpk.pyx":441
 *                     x[i - 1] = glp_mip_col_val(glp, i)
 *             solution.x_dict = {rxn.id: x[i] for i, rxn
 *                                in enumerate(cobra_model.reactions)}             # <<<<<<<<<<<<<<
 *             solution.x = x
 *         else:
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cobra_model, __pyx_n_s_reactions); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
      __Pyx_GOTREF(__pyx_t_2);
      if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
        __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_9 = 0;
        __pyx_t_10 = NULL;
      } else {
        __pyx_t_9 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_10 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      for (;;) {
        if (likely(!__pyx_t_10)) {
          if (likely(PyList_CheckExact(__pyx_t_3))) {
            if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_3)) break;
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_9); __Pyx_INCREF(__pyx_t_2); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
            #else
            __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
            __Pyx_GOTREF(__pyx_t_2);
            #endif
          } else {
            if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_9); __Pyx_INCREF(__pyx_t_2); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
            #else
            __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
            __Pyx_GOTREF(__pyx_t_2);
            #endif
          }
        } else {
          __pyx_t_2 = __pyx_t_10(__pyx_t_3);
          if (unlikely(!__pyx_t_2)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_rxn, __pyx_t_2);
        __pyx_t_2 = 0;

        /* "cobra/solvers/cglpk.pyx":440
 *             for i in range(1, n + 1):
 *                     x[i - 1] = glp_mip_col_val(glp, i)
 *             solution.x_dict = {rxn.id: x[i] for i, rxn             # <<<<<<<<<<<<<<
 *                                in enumerate(cobra_model.reactions)}
 *             solution.x = x
 */
        __pyx_8genexpr1__pyx_v_i = __pyx_t_7;

        /* "cobra/solvers/cglpk.pyx":441
 *                     x[i - 1] = glp_mip_col_val(glp, i)
 *             solution.x_dict = {rxn.id: x[i] for i, rxn
 *                                in enumerate(cobra_model.reactions)}             # <<<<<<<<<<<<<<
 *             solution.x = x
 *         else:
 */
        __pyx_t_7 = (__pyx_t_7 + 1);

        /* "cobra/solvers/cglpk.pyx":440
 *             for i in range(1, n + 1):
 *                     x[i - 1] = glp_mip_col_val(glp, i)
 *             solution.x_dict = {rxn.id: x[i] for i, rxn             # <<<<<<<<<<<<<<
 *                                in enumerate(cobra_model.reactions)}
 *             solution.x = x
 */
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr1__pyx_v_rxn, __pyx_n_s_id); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_11 = __Pyx_GetItemInt_List(__pyx_v_x, __pyx_8genexpr1__pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L9_error;};
        __Pyx_GOTREF(__pyx_t_11);
        if (unlikely(PyDict_SetItem(__pyx_t_4, (PyObject*)__pyx_t_2, (PyObject*)__pyx_t_11))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_rxn);
      goto __pyx_L12_exit_scope;
      __pyx_L9_error:;
      __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_rxn);
      goto __pyx_L1_error;
      __pyx_L12_exit_scope:;
    } /* exit inner scope */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_solution, __pyx_n_s_x_dict, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cobra/solvers/cglpk.pyx":442
 *             solution.x_dict = {rxn.id: x[i] for i, rxn
 *                                in enumerate(cobra_model.reactions)}
 *             solution.x = x             # <<<<<<<<<<<<<<
 *         else:
 *             for i in range(1, n + 1):
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_solution, __pyx_n_s_x, __pyx_v_x) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "cobra/solvers/cglpk.pyx":437
 *         n = glp_get_num_cols(glp)
 *         x = [0] * n
 *         if self.is_mip():             # <<<<<<<<<<<<<<
 *             for i in range(1, n + 1):
 *                     x[i - 1] = glp_mip_col_val(glp, i)
 */
    goto __pyx_L4;
  }

  /* "cobra/solvers/cglpk.pyx":444
 *             solution.x = x
 *         else:
 *             for i in range(1, n + 1):             # <<<<<<<<<<<<<<
 *                 x[i - 1] = glp_get_col_prim(glp, i)
 *             solution.x_dict = {rxn.id: x[i] for i, rxn
 */
  /*else*/ {
    __pyx_t_6 = (__pyx_v_n + 1);
    for (__pyx_t_7 = 1; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
      __pyx_v_i = __pyx_t_7;

      /* "cobra/solvers/cglpk.pyx":445
 *         else:
 *             for i in range(1, n + 1):
 *                 x[i - 1] = glp_get_col_prim(glp, i)             # <<<<<<<<<<<<<<
 *             solution.x_dict = {rxn.id: x[i] for i, rxn
 *                                in enumerate(cobra_model.reactions)}
 */
      __pyx_t_4 = PyFloat_FromDouble(glp_get_col_prim(__pyx_v_glp, __pyx_v_i)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_8 = (__pyx_v_i - 1);
      if (unlikely(__Pyx_SetItemInt(__pyx_v_x, __pyx_t_8, __pyx_t_4, long, 1, __Pyx_PyInt_From_long, 1, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }

    /* "cobra/solvers/cglpk.pyx":446
 *             for i in range(1, n + 1):
 *                 x[i - 1] = glp_get_col_prim(glp, i)
 *             solution.x_dict = {rxn.id: x[i] for i, rxn             # <<<<<<<<<<<<<<
 *                                in enumerate(cobra_model.reactions)}
 *             solution.x = x
 */
    { /* enter inner scope */
      int __pyx_8genexpr2__pyx_v_i;
      PyObject *__pyx_8genexpr2__pyx_v_rxn = NULL;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = 0;

      /* "cobra/solvers/cglpk.pyx":447
 *                 x[i - 1] = glp_get_col_prim(glp, i)
 *             solution.x_dict = {rxn.id: x[i] for i, rxn
 *                                in enumerate(cobra_model.reactions)}             # <<<<<<<<<<<<<<
 *             solution.x = x
 *             y = [0] * m
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_cobra_model, __pyx_n_s_reactions); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
      __Pyx_GOTREF(__pyx_t_3);
      if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
        __pyx_t_11 = __pyx_t_3; __Pyx_INCREF(__pyx_t_11); __pyx_t_9 = 0;
        __pyx_t_10 = NULL;
      } else {
        __pyx_t_9 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_10 = Py_TYPE(__pyx_t_11)->tp_iternext; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      for (;;) {
        if (likely(!__pyx_t_10)) {
          if (likely(PyList_CheckExact(__pyx_t_11))) {
            if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_11)) break;
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_3 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            #else
            __pyx_t_3 = PySequence_ITEM(__pyx_t_11, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            __Pyx_GOTREF(__pyx_t_3);
            #endif
          } else {
            if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_11)) break;
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            #else
            __pyx_t_3 = PySequence_ITEM(__pyx_t_11, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            __Pyx_GOTREF(__pyx_t_3);
            #endif
          }
        } else {
          __pyx_t_3 = __pyx_t_10(__pyx_t_11);
          if (unlikely(!__pyx_t_3)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_3);
        }
        __Pyx_XDECREF_SET(__pyx_8genexpr2__pyx_v_rxn, __pyx_t_3);
        __pyx_t_3 = 0;

        /* "cobra/solvers/cglpk.pyx":446
 *             for i in range(1, n + 1):
 *                 x[i - 1] = glp_get_col_prim(glp, i)
 *             solution.x_dict = {rxn.id: x[i] for i, rxn             # <<<<<<<<<<<<<<
 *                                in enumerate(cobra_model.reactions)}
 *             solution.x = x
 */
        __pyx_8genexpr2__pyx_v_i = __pyx_t_7;

        /* "cobra/solvers/cglpk.pyx":447
 *                 x[i - 1] = glp_get_col_prim(glp, i)
 *             solution.x_dict = {rxn.id: x[i] for i, rxn
 *                                in enumerate(cobra_model.reactions)}             # <<<<<<<<<<<<<<
 *             solution.x = x
 *             y = [0] * m
 */
        __pyx_t_7 = (__pyx_t_7 + 1);

        /* "cobra/solvers/cglpk.pyx":446
 *             for i in range(1, n + 1):
 *                 x[i - 1] = glp_get_col_prim(glp, i)
 *             solution.x_dict = {rxn.id: x[i] for i, rxn             # <<<<<<<<<<<<<<
 *                                in enumerate(cobra_model.reactions)}
 *             solution.x = x
 */
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr2__pyx_v_rxn, __pyx_n_s_id); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_x, __pyx_8genexpr2__pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L17_error;};
        __Pyx_GOTREF(__pyx_t_2);
        if (unlikely(PyDict_SetItem(__pyx_t_4, (PyObject*)__pyx_t_3, (PyObject*)__pyx_t_2))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_rxn);
      goto __pyx_L20_exit_scope;
      __pyx_L17_error:;
      __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_rxn);
      goto __pyx_L1_error;
      __pyx_L20_exit_scope:;
    } /* exit inner scope */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_solution, __pyx_n_s_x_dict, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cobra/solvers/cglpk.pyx":448
 *             solution.x_dict = {rxn.id: x[i] for i, rxn
 *                                in enumerate(cobra_model.reactions)}
 *             solution.x = x             # <<<<<<<<<<<<<<
 *             y = [0] * m
 *             for i in range(1, m + 1):
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_solution, __pyx_n_s_x, __pyx_v_x) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "cobra/solvers/cglpk.pyx":449
 *                                in enumerate(cobra_model.reactions)}
 *             solution.x = x
 *             y = [0] * m             # <<<<<<<<<<<<<<
 *             for i in range(1, m + 1):
 *                 y[i - 1] = glp_get_row_dual(glp, i)
 */
    __pyx_t_4 = PyList_New(1 * ((__pyx_v_m<0) ? 0:__pyx_v_m)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    { Py_ssize_t __pyx_temp;
      for (__pyx_temp=0; __pyx_temp < __pyx_v_m; __pyx_temp++) {
        __Pyx_INCREF(__pyx_int_0);
        __Pyx_GIVEREF(__pyx_int_0);
        PyList_SET_ITEM(__pyx_t_4, __pyx_temp, __pyx_int_0);
      }
    }
    __pyx_v_y = ((PyObject*)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "cobra/solvers/cglpk.pyx":450
 *             solution.x = x
 *             y = [0] * m
 *             for i in range(1, m + 1):             # <<<<<<<<<<<<<<
 *                 y[i - 1] = glp_get_row_dual(glp, i)
 *             solution.y_dict = {met.id: y[i] for i, met
 */
    __pyx_t_6 = (__pyx_v_m + 1);
    for (__pyx_t_7 = 1; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
      __pyx_v_i = __pyx_t_7;

      /* "cobra/solvers/cglpk.pyx":451
 *             y = [0] * m
 *             for i in range(1, m + 1):
 *                 y[i - 1] = glp_get_row_dual(glp, i)             # <<<<<<<<<<<<<<
 *             solution.y_dict = {met.id: y[i] for i, met
 *                                in enumerate(cobra_model.metabolites)}
 */
      __pyx_t_4 = PyFloat_FromDouble(glp_get_row_dual(__pyx_v_glp, __pyx_v_i)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_8 = (__pyx_v_i - 1);
      if (unlikely(__Pyx_SetItemInt(__pyx_v_y, __pyx_t_8, __pyx_t_4, long, 1, __Pyx_PyInt_From_long, 1, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }

    /* "cobra/solvers/cglpk.pyx":452
 *             for i in range(1, m + 1):
 *                 y[i - 1] = glp_get_row_dual(glp, i)
 *             solution.y_dict = {met.id: y[i] for i, met             # <<<<<<<<<<<<<<
 *                                in enumerate(cobra_model.metabolites)}
 *             solution.y = y
 */
    { /* enter inner scope */
      int __pyx_8genexpr3__pyx_v_i;
      PyObject *__pyx_8genexpr3__pyx_v_met = NULL;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L25_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = 0;

      /* "cobra/solvers/cglpk.pyx":453
 *                 y[i - 1] = glp_get_row_dual(glp, i)
 *             solution.y_dict = {met.id: y[i] for i, met
 *                                in enumerate(cobra_model.metabolites)}             # <<<<<<<<<<<<<<
 *             solution.y = y
 *         return solution
 */
      __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_cobra_model, __pyx_n_s_metabolites); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L25_error;}
      __Pyx_GOTREF(__pyx_t_11);
      if (likely(PyList_CheckExact(__pyx_t_11)) || PyTuple_CheckExact(__pyx_t_11)) {
        __pyx_t_2 = __pyx_t_11; __Pyx_INCREF(__pyx_t_2); __pyx_t_9 = 0;
        __pyx_t_10 = NULL;
      } else {
        __pyx_t_9 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L25_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_10 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L25_error;}
      }
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      for (;;) {
        if (likely(!__pyx_t_10)) {
          if (likely(PyList_CheckExact(__pyx_t_2))) {
            if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_2)) break;
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_11 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_9); __Pyx_INCREF(__pyx_t_11); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L25_error;}
            #else
            __pyx_t_11 = PySequence_ITEM(__pyx_t_2, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L25_error;}
            __Pyx_GOTREF(__pyx_t_11);
            #endif
          } else {
            if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_9); __Pyx_INCREF(__pyx_t_11); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L25_error;}
            #else
            __pyx_t_11 = PySequence_ITEM(__pyx_t_2, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L25_error;}
            __Pyx_GOTREF(__pyx_t_11);
            #endif
          }
        } else {
          __pyx_t_11 = __pyx_t_10(__pyx_t_2);
          if (unlikely(!__pyx_t_11)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L25_error;}
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_11);
        }
        __Pyx_XDECREF_SET(__pyx_8genexpr3__pyx_v_met, __pyx_t_11);
        __pyx_t_11 = 0;

        /* "cobra/solvers/cglpk.pyx":452
 *             for i in range(1, m + 1):
 *                 y[i - 1] = glp_get_row_dual(glp, i)
 *             solution.y_dict = {met.id: y[i] for i, met             # <<<<<<<<<<<<<<
 *                                in enumerate(cobra_model.metabolites)}
 *             solution.y = y
 */
        __pyx_8genexpr3__pyx_v_i = __pyx_t_7;

        /* "cobra/solvers/cglpk.pyx":453
 *                 y[i - 1] = glp_get_row_dual(glp, i)
 *             solution.y_dict = {met.id: y[i] for i, met
 *                                in enumerate(cobra_model.metabolites)}             # <<<<<<<<<<<<<<
 *             solution.y = y
 *         return solution
 */
        __pyx_t_7 = (__pyx_t_7 + 1);

        /* "cobra/solvers/cglpk.pyx":452
 *             for i in range(1, m + 1):
 *                 y[i - 1] = glp_get_row_dual(glp, i)
 *             solution.y_dict = {met.id: y[i] for i, met             # <<<<<<<<<<<<<<
 *                                in enumerate(cobra_model.metabolites)}
 *             solution.y = y
 */
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr3__pyx_v_met, __pyx_n_s_id); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L25_error;}
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_y, __pyx_8genexpr3__pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L25_error;};
        __Pyx_GOTREF(__pyx_t_3);
        if (unlikely(PyDict_SetItem(__pyx_t_4, (PyObject*)__pyx_t_11, (PyObject*)__pyx_t_3))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L25_error;}
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_met);
      goto __pyx_L28_exit_scope;
      __pyx_L25_error:;
      __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_met);
      goto __pyx_L1_error;
      __pyx_L28_exit_scope:;
    } /* exit inner scope */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_solution, __pyx_n_s_y_dict, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cobra/solvers/cglpk.pyx":454
 *             solution.y_dict = {met.id: y[i] for i, met
 *                                in enumerate(cobra_model.metabolites)}
 *             solution.y = y             # <<<<<<<<<<<<<<
 *         return solution
 * 
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_solution, __pyx_n_s_y, __pyx_v_y) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L4:;

  /* "cobra/solvers/cglpk.pyx":455
 *                                in enumerate(cobra_model.metabolites)}
 *             solution.y = y
 *         return solution             # <<<<<<<<<<<<<<
 * 
 *     # make serializable and copyable
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_solution);
  __pyx_r = __pyx_v_solution;
  goto __pyx_L0;

  /* "cobra/solvers/cglpk.pyx":426
 *         return glp_get_num_int(self.glp) > 0
 * 
 *     def format_solution(self, cobra_model):             # <<<<<<<<<<<<<<
 *         cdef int i, m, n
 *         cdef glp_prob *glp = self.glp
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("cobra.solvers.cglpk.GLP.format_solution", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_Solution);
  __Pyx_XDECREF(__pyx_v_status);
  __Pyx_XDECREF(__pyx_v_solution);
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_y);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cobra/solvers/cglpk.pyx":458
 * 
 *     # make serializable and copyable
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         cdef int result
 *         cdef char *name
 */

/* Python wrapper */
static PyObject *__pyx_pw_5cobra_7solvers_5cglpk_3GLP_31__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5cobra_7solvers_5cglpk_3GLP_30__getstate__[] = "GLP.__getstate__(self)";
static PyObject *__pyx_pw_5cobra_7solvers_5cglpk_3GLP_31__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getstate__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5cobra_7solvers_5cglpk_3GLP_30__getstate__(((struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *)__pyx_v_self));

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

static PyObject *__pyx_pf_5cobra_7solvers_5cglpk_3GLP_30__getstate__(struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *__pyx_v_self) {
  int __pyx_v_result;
  char *__pyx_v_name;
  PyObject *__pyx_v_tempfile = NULL;
  PyObject *__pyx_v_infile = NULL;
  PyObject *__pyx_v_state = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  char *__pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  int __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getstate__", 0);

  /* "cobra/solvers/cglpk.pyx":461
 *         cdef int result
 *         cdef char *name
 *         tempfile = _NamedTemporaryFile(mode="r", delete=False)             # <<<<<<<<<<<<<<
 *         name = tempfile.name
 *         tempfile.close()
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_NamedTemporaryFile); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_mode, __pyx_n_s_r) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_delete, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_tempfile = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "cobra/solvers/cglpk.pyx":462
 *         cdef char *name
 *         tempfile = _NamedTemporaryFile(mode="r", delete=False)
 *         name = tempfile.name             # <<<<<<<<<<<<<<
 *         tempfile.close()
 *         result = glp_write_prob(self.glp, 0, name)
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_tempfile, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_AsString(__pyx_t_3); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_name = __pyx_t_4;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cobra/solvers/cglpk.pyx":463
 *         tempfile = _NamedTemporaryFile(mode="r", delete=False)
 *         name = tempfile.name
 *         tempfile.close()             # <<<<<<<<<<<<<<
 *         result = glp_write_prob(self.glp, 0, name)
 *         assert result == 0
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_tempfile, __pyx_n_s_close); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_1) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __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;

  /* "cobra/solvers/cglpk.pyx":464
 *         name = tempfile.name
 *         tempfile.close()
 *         result = glp_write_prob(self.glp, 0, name)             # <<<<<<<<<<<<<<
 *         assert result == 0
 *         with open(name, "r") as infile:
 */
  __pyx_v_result = glp_write_prob(__pyx_v_self->glp, 0, __pyx_v_name);

  /* "cobra/solvers/cglpk.pyx":465
 *         tempfile.close()
 *         result = glp_write_prob(self.glp, 0, name)
 *         assert result == 0             # <<<<<<<<<<<<<<
 *         with open(name, "r") as infile:
 *             state = infile.read()
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    if (unlikely(!((__pyx_v_result == 0) != 0))) {
      PyErr_SetNone(PyExc_AssertionError);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "cobra/solvers/cglpk.pyx":466
 *         result = glp_write_prob(self.glp, 0, name)
 *         assert result == 0
 *         with open(name, "r") as infile:             # <<<<<<<<<<<<<<
 *             state = infile.read()
 *         _unlink(name)
 */
  /*with:*/ {
    __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __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 = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
    __Pyx_INCREF(__pyx_n_s_r);
    __Pyx_GIVEREF(__pyx_n_s_r);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_r);
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_3, __pyx_n_s_exit); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = __Pyx_PyObject_LookupSpecial(__pyx_t_3, __pyx_n_s_enter); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    if (__pyx_t_6) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else {
      __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    /*try:*/ {
      {
        __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_9);
        /*try:*/ {
          __pyx_v_infile = __pyx_t_1;
          __pyx_t_1 = 0;

          /* "cobra/solvers/cglpk.pyx":467
 *         assert result == 0
 *         with open(name, "r") as infile:
 *             state = infile.read()             # <<<<<<<<<<<<<<
 *         _unlink(name)
 *         return state
 */
          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_infile, __pyx_n_s_read); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_2 = NULL;
          if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
            __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
            if (likely(__pyx_t_2)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
              __Pyx_INCREF(__pyx_t_2);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_3, function);
            }
          }
          if (__pyx_t_2) {
            __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          } else {
            __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          }
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_v_state = __pyx_t_1;
          __pyx_t_1 = 0;

          /* "cobra/solvers/cglpk.pyx":466
 *         result = glp_write_prob(self.glp, 0, name)
 *         assert result == 0
 *         with open(name, "r") as infile:             # <<<<<<<<<<<<<<
 *             state = infile.read()
 *         _unlink(name)
 */
        }
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        goto __pyx_L14_try_end;
        __pyx_L7_error:;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("cobra.solvers.cglpk.GLP.__getstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_6 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (__pyx_t_11 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
          __pyx_t_12 = ((!(__pyx_t_11 != 0)) != 0);
          if (__pyx_t_12) {
            __Pyx_GIVEREF(__pyx_t_1);
            __Pyx_GIVEREF(__pyx_t_3);
            __Pyx_XGIVEREF(__pyx_t_2);
            __Pyx_ErrRestore(__pyx_t_1, __pyx_t_3, __pyx_t_2);
            __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_t_2 = 0; 
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
          }
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
        goto __pyx_L1_error;
        __pyx_L8_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
        __pyx_L14_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_5) {
          __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__5, NULL);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        goto __pyx_L6;
      }
      __pyx_L6:;
    }
    goto __pyx_L18;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L1_error;
    __pyx_L18:;
  }

  /* "cobra/solvers/cglpk.pyx":468
 *         with open(name, "r") as infile:
 *             state = infile.read()
 *         _unlink(name)             # <<<<<<<<<<<<<<
 *         return state
 * 
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_unlink); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_6) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_6); __pyx_t_6 = NULL;
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_13, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cobra/solvers/cglpk.pyx":469
 *             state = infile.read()
 *         _unlink(name)
 *         return state             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_v_state)) { __Pyx_RaiseUnboundLocalError("state"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __Pyx_INCREF(__pyx_v_state);
  __pyx_r = __pyx_v_state;
  goto __pyx_L0;

  /* "cobra/solvers/cglpk.pyx":458
 * 
 *     # make serializable and copyable
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 *         cdef int result
 *         cdef char *name
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("cobra.solvers.cglpk.GLP.__getstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_tempfile);
  __Pyx_XDECREF(__pyx_v_infile);
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cobra/solvers/cglpk.pyx":471
 *         return state
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return (GLP, (), self.__getstate__())
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5cobra_7solvers_5cglpk_3GLP_33__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5cobra_7solvers_5cglpk_3GLP_32__reduce__[] = "GLP.__reduce__(self)";
static PyObject *__pyx_pw_5cobra_7solvers_5cglpk_3GLP_33__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5cobra_7solvers_5cglpk_3GLP_32__reduce__(((struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *)__pyx_v_self));

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

static PyObject *__pyx_pf_5cobra_7solvers_5cglpk_3GLP_32__reduce__(struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "cobra/solvers/cglpk.pyx":472
 * 
 *     def __reduce__(self):
 *         return (GLP, (), self.__getstate__())             # <<<<<<<<<<<<<<
 * 
 *     def __setstate__(self, state):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getstate); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_ptype_5cobra_7solvers_5cglpk_GLP));
  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_5cobra_7solvers_5cglpk_GLP));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_5cobra_7solvers_5cglpk_GLP));
  __Pyx_INCREF(__pyx_empty_tuple);
  __Pyx_GIVEREF(__pyx_empty_tuple);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_empty_tuple);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cobra/solvers/cglpk.pyx":471
 *         return state
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return (GLP, (), self.__getstate__())
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cobra.solvers.cglpk.GLP.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cobra/solvers/cglpk.pyx":474
 *         return (GLP, (), self.__getstate__())
 * 
 *     def __setstate__(self, state):             # <<<<<<<<<<<<<<
 *         cdef int result
 *         cdef char *name = NULL
 */

/* Python wrapper */
static PyObject *__pyx_pw_5cobra_7solvers_5cglpk_3GLP_35__setstate__(PyObject *__pyx_v_self, PyObject *__pyx_v_state); /*proto*/
static char __pyx_doc_5cobra_7solvers_5cglpk_3GLP_34__setstate__[] = "GLP.__setstate__(self, state)";
static PyObject *__pyx_pw_5cobra_7solvers_5cglpk_3GLP_35__setstate__(PyObject *__pyx_v_self, PyObject *__pyx_v_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5cobra_7solvers_5cglpk_3GLP_34__setstate__(((struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *)__pyx_v_self), ((PyObject *)__pyx_v_state));

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

static PyObject *__pyx_pf_5cobra_7solvers_5cglpk_3GLP_34__setstate__(struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *__pyx_v_self, PyObject *__pyx_v_state) {
  int __pyx_v_result;
  char *__pyx_v_name;
  PyObject *__pyx_v_tempfile = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  char *__pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  int __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate__", 0);

  /* "cobra/solvers/cglpk.pyx":476
 *     def __setstate__(self, state):
 *         cdef int result
 *         cdef char *name = NULL             # <<<<<<<<<<<<<<
 *         with _NamedTemporaryFile(mode="w", delete=False) as tempfile:
 *             name = tempfile.name
 */
  __pyx_v_name = NULL;

  /* "cobra/solvers/cglpk.pyx":477
 *         cdef int result
 *         cdef char *name = NULL
 *         with _NamedTemporaryFile(mode="w", delete=False) as tempfile:             # <<<<<<<<<<<<<<
 *             name = tempfile.name
 *             tempfile.write(state)
 */
  /*with:*/ {
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_NamedTemporaryFile); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __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 = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_mode, __pyx_n_s_w) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_delete, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_3, __pyx_n_s_exit); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __Pyx_PyObject_LookupSpecial(__pyx_t_3, __pyx_n_s_enter); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    if (__pyx_t_5) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else {
      __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    /*try:*/ {
      {
        __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_6);
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_8);
        /*try:*/ {
          __pyx_v_tempfile = __pyx_t_1;
          __pyx_t_1 = 0;

          /* "cobra/solvers/cglpk.pyx":478
 *         cdef char *name = NULL
 *         with _NamedTemporaryFile(mode="w", delete=False) as tempfile:
 *             name = tempfile.name             # <<<<<<<<<<<<<<
 *             tempfile.write(state)
 *         result = glp_read_prob(self.glp, 0, name)
 */
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_tempfile, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_9 = __Pyx_PyObject_AsString(__pyx_t_1); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __pyx_v_name = __pyx_t_9;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

          /* "cobra/solvers/cglpk.pyx":479
 *         with _NamedTemporaryFile(mode="w", delete=False) as tempfile:
 *             name = tempfile.name
 *             tempfile.write(state)             # <<<<<<<<<<<<<<
 *         result = glp_read_prob(self.glp, 0, name)
 *         assert result == 0
 */
          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_tempfile, __pyx_n_s_write); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_2 = NULL;
          if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
            __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
            if (likely(__pyx_t_2)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
              __Pyx_INCREF(__pyx_t_2);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_3, function);
            }
          }
          if (!__pyx_t_2) {
            __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_state); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
            __Pyx_GOTREF(__pyx_t_1);
          } else {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
            __Pyx_INCREF(__pyx_v_state);
            __Pyx_GIVEREF(__pyx_v_state);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_state);
            __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

          /* "cobra/solvers/cglpk.pyx":477
 *         cdef int result
 *         cdef char *name = NULL
 *         with _NamedTemporaryFile(mode="w", delete=False) as tempfile:             # <<<<<<<<<<<<<<
 *             name = tempfile.name
 *             tempfile.write(state)
 */
        }
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L14_try_end;
        __pyx_L7_error:;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("cobra.solvers.cglpk.GLP.__setstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_2 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (__pyx_t_11 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
          __pyx_t_12 = ((!(__pyx_t_11 != 0)) != 0);
          if (__pyx_t_12) {
            __Pyx_GIVEREF(__pyx_t_1);
            __Pyx_GIVEREF(__pyx_t_3);
            __Pyx_XGIVEREF(__pyx_t_5);
            __Pyx_ErrRestore(__pyx_t_1, __pyx_t_3, __pyx_t_5);
            __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_t_5 = 0; 
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
          }
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
        goto __pyx_L1_error;
        __pyx_L8_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
        __pyx_L14_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_4) {
          __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__6, NULL);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        }
        goto __pyx_L6;
      }
      __pyx_L6:;
    }
    goto __pyx_L18;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L1_error;
    __pyx_L18:;
  }

  /* "cobra/solvers/cglpk.pyx":480
 *             name = tempfile.name
 *             tempfile.write(state)
 *         result = glp_read_prob(self.glp, 0, name)             # <<<<<<<<<<<<<<
 *         assert result == 0
 *         _unlink(name)
 */
  __pyx_v_result = glp_read_prob(__pyx_v_self->glp, 0, __pyx_v_name);

  /* "cobra/solvers/cglpk.pyx":481
 *             tempfile.write(state)
 *         result = glp_read_prob(self.glp, 0, name)
 *         assert result == 0             # <<<<<<<<<<<<<<
 *         _unlink(name)
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    if (unlikely(!((__pyx_v_result == 0) != 0))) {
      PyErr_SetNone(PyExc_AssertionError);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "cobra/solvers/cglpk.pyx":482
 *         result = glp_read_prob(self.glp, 0, name)
 *         assert result == 0
 *         _unlink(name)             # <<<<<<<<<<<<<<
 * 
 *     def __copy__(self):
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_unlink); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_2) {
    __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GOTREF(__pyx_t_5);
  } else {
    __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_2); __pyx_t_2 = NULL;
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_13, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cobra/solvers/cglpk.pyx":474
 *         return (GLP, (), self.__getstate__())
 * 
 *     def __setstate__(self, state):             # <<<<<<<<<<<<<<
 *         cdef int result
 *         cdef char *name = NULL
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("cobra.solvers.cglpk.GLP.__setstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_tempfile);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cobra/solvers/cglpk.pyx":484
 *         _unlink(name)
 * 
 *     def __copy__(self):             # <<<<<<<<<<<<<<
 *         other = GLP()
 *         glp_copy_prob(other.glp, self.glp, GLP_ON)
 */

/* Python wrapper */
static PyObject *__pyx_pw_5cobra_7solvers_5cglpk_3GLP_37__copy__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5cobra_7solvers_5cglpk_3GLP_36__copy__[] = "GLP.__copy__(self)";
static PyObject *__pyx_pw_5cobra_7solvers_5cglpk_3GLP_37__copy__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__copy__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5cobra_7solvers_5cglpk_3GLP_36__copy__(((struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *)__pyx_v_self));

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

static PyObject *__pyx_pf_5cobra_7solvers_5cglpk_3GLP_36__copy__(struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *__pyx_v_self) {
  struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *__pyx_v_other = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  glp_smcp __pyx_t_2;
  glp_iocp __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__copy__", 0);

  /* "cobra/solvers/cglpk.pyx":485
 * 
 *     def __copy__(self):
 *         other = GLP()             # <<<<<<<<<<<<<<
 *         glp_copy_prob(other.glp, self.glp, GLP_ON)
 *         other.parameters = self.parameters
 */
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5cobra_7solvers_5cglpk_GLP), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_other = ((struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cobra/solvers/cglpk.pyx":486
 *     def __copy__(self):
 *         other = GLP()
 *         glp_copy_prob(other.glp, self.glp, GLP_ON)             # <<<<<<<<<<<<<<
 *         other.parameters = self.parameters
 *         other.integer_parameters = self.integer_parameters
 */
  glp_copy_prob(__pyx_v_other->glp, __pyx_v_self->glp, GLP_ON);

  /* "cobra/solvers/cglpk.pyx":487
 *         other = GLP()
 *         glp_copy_prob(other.glp, self.glp, GLP_ON)
 *         other.parameters = self.parameters             # <<<<<<<<<<<<<<
 *         other.integer_parameters = self.integer_parameters
 *         other.exact = self.exact
 */
  __pyx_t_2 = __pyx_v_self->parameters;
  __pyx_v_other->parameters = __pyx_t_2;

  /* "cobra/solvers/cglpk.pyx":488
 *         glp_copy_prob(other.glp, self.glp, GLP_ON)
 *         other.parameters = self.parameters
 *         other.integer_parameters = self.integer_parameters             # <<<<<<<<<<<<<<
 *         other.exact = self.exact
 *         return other
 */
  __pyx_t_3 = __pyx_v_self->integer_parameters;
  __pyx_v_other->integer_parameters = __pyx_t_3;

  /* "cobra/solvers/cglpk.pyx":489
 *         other.parameters = self.parameters
 *         other.integer_parameters = self.integer_parameters
 *         other.exact = self.exact             # <<<<<<<<<<<<<<
 *         return other
 * 
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_self->exact);
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_other->exact);
  __Pyx_DECREF(((PyObject *)__pyx_v_other->exact));
  __pyx_v_other->exact = ((PyBoolObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cobra/solvers/cglpk.pyx":490
 *         other.integer_parameters = self.integer_parameters
 *         other.exact = self.exact
 *         return other             # <<<<<<<<<<<<<<
 * 
 *     def write(self, filename):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_other));
  __pyx_r = ((PyObject *)__pyx_v_other);
  goto __pyx_L0;

  /* "cobra/solvers/cglpk.pyx":484
 *         _unlink(name)
 * 
 *     def __copy__(self):             # <<<<<<<<<<<<<<
 *         other = GLP()
 *         glp_copy_prob(other.glp, self.glp, GLP_ON)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cobra.solvers.cglpk.GLP.__copy__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_other);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cobra/solvers/cglpk.pyx":492
 *         return other
 * 
 *     def write(self, filename):             # <<<<<<<<<<<<<<
 *         """Write the problem to a file
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5cobra_7solvers_5cglpk_3GLP_39write(PyObject *__pyx_v_self, PyObject *__pyx_v_filename); /*proto*/
static char __pyx_doc_5cobra_7solvers_5cglpk_3GLP_38write[] = "GLP.write(self, filename)\nWrite the problem to a file\n\n        The format will be determined by the file extension.\n            .lp: LP file\n            .mps: MPS file\n        ";
static PyObject *__pyx_pw_5cobra_7solvers_5cglpk_3GLP_39write(PyObject *__pyx_v_self, PyObject *__pyx_v_filename) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("write (wrapper)", 0);
  __pyx_r = __pyx_pf_5cobra_7solvers_5cglpk_3GLP_38write(((struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *)__pyx_v_self), ((PyObject *)__pyx_v_filename));

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

static PyObject *__pyx_pf_5cobra_7solvers_5cglpk_3GLP_38write(struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *__pyx_v_self, PyObject *__pyx_v_filename) {
  PyObject *__pyx_v_b_name = NULL;
  char *__pyx_v_c_name;
  int __pyx_v_res;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  char *__pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  char const *__pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("write", 0);

  /* "cobra/solvers/cglpk.pyx":499
 *             .mps: MPS file
 *         """
 *         if PY_MAJOR_VERSION == 2:             # <<<<<<<<<<<<<<
 *             b_name = bytes(filename)
 *         elif PY_MAJOR_VERSION == 3:
 */
  switch (PY_MAJOR_VERSION) {
    case 2:

    /* "cobra/solvers/cglpk.pyx":500
 *         """
 *         if PY_MAJOR_VERSION == 2:
 *             b_name = bytes(filename)             # <<<<<<<<<<<<<<
 *         elif PY_MAJOR_VERSION == 3:
 *             b_name = bytes(filename, "latin-1")
 */
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_filename);
    __Pyx_GIVEREF(__pyx_v_filename);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_filename);
    __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyBytes_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_b_name = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "cobra/solvers/cglpk.pyx":499
 *             .mps: MPS file
 *         """
 *         if PY_MAJOR_VERSION == 2:             # <<<<<<<<<<<<<<
 *             b_name = bytes(filename)
 *         elif PY_MAJOR_VERSION == 3:
 */
    break;

    /* "cobra/solvers/cglpk.pyx":501
 *         if PY_MAJOR_VERSION == 2:
 *             b_name = bytes(filename)
 *         elif PY_MAJOR_VERSION == 3:             # <<<<<<<<<<<<<<
 *             b_name = bytes(filename, "latin-1")
 *         else:
 */
    case 3:

    /* "cobra/solvers/cglpk.pyx":502
 *             b_name = bytes(filename)
 *         elif PY_MAJOR_VERSION == 3:
 *             b_name = bytes(filename, "latin-1")             # <<<<<<<<<<<<<<
 *         else:
 *             raise RuntimeError("Unknown python version")
 */
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_filename);
    __Pyx_GIVEREF(__pyx_v_filename);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_filename);
    __Pyx_INCREF(__pyx_kp_s_latin_1);
    __Pyx_GIVEREF(__pyx_kp_s_latin_1);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_kp_s_latin_1);
    __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&PyBytes_Type)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_b_name = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "cobra/solvers/cglpk.pyx":501
 *         if PY_MAJOR_VERSION == 2:
 *             b_name = bytes(filename)
 *         elif PY_MAJOR_VERSION == 3:             # <<<<<<<<<<<<<<
 *             b_name = bytes(filename, "latin-1")
 *         else:
 */
    break;
    default:

    /* "cobra/solvers/cglpk.pyx":504
 *             b_name = bytes(filename, "latin-1")
 *         else:
 *             raise RuntimeError("Unknown python version")             # <<<<<<<<<<<<<<
 *         cdef char *c_name = <bytes> b_name
 *         cdef int res
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    break;
  }

  /* "cobra/solvers/cglpk.pyx":505
 *         else:
 *             raise RuntimeError("Unknown python version")
 *         cdef char *c_name = <bytes> b_name             # <<<<<<<<<<<<<<
 *         cdef int res
 *         # no other way to silence this function
 */
  __pyx_t_3 = __Pyx_PyObject_AsString(__pyx_v_b_name); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_c_name = __pyx_t_3;

  /* "cobra/solvers/cglpk.pyx":508
 *         cdef int res
 *         # no other way to silence this function
 *         glp_term_hook(silent_hook, NULL)             # <<<<<<<<<<<<<<
 *         try:
 *             if b_name.endswith(".lp"):
 */
  glp_term_hook(__pyx_f_5cobra_7solvers_5cglpk_silent_hook, NULL);

  /* "cobra/solvers/cglpk.pyx":509
 *         # no other way to silence this function
 *         glp_term_hook(silent_hook, NULL)
 *         try:             # <<<<<<<<<<<<<<
 *             if b_name.endswith(".lp"):
 *                 res = glp_write_lp(self.glp, NULL, c_name)
 */
  /*try:*/ {

    /* "cobra/solvers/cglpk.pyx":510
 *         glp_term_hook(silent_hook, NULL)
 *         try:
 *             if b_name.endswith(".lp"):             # <<<<<<<<<<<<<<
 *                 res = glp_write_lp(self.glp, NULL, c_name)
 *             elif b_name.endswith(".mps"):
 */
    __pyx_t_4 = __Pyx_PyBytes_Tailmatch(__pyx_v_b_name, __pyx_kp_s_lp, 0, PY_SSIZE_T_MAX, 1); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    if ((__pyx_t_4 != 0)) {

      /* "cobra/solvers/cglpk.pyx":511
 *         try:
 *             if b_name.endswith(".lp"):
 *                 res = glp_write_lp(self.glp, NULL, c_name)             # <<<<<<<<<<<<<<
 *             elif b_name.endswith(".mps"):
 *                 res = glp_write_mps(self.glp, GLP_MPS_FILE, NULL, c_name)
 */
      __pyx_v_res = glp_write_lp(__pyx_v_self->glp, NULL, __pyx_v_c_name);

      /* "cobra/solvers/cglpk.pyx":510
 *         glp_term_hook(silent_hook, NULL)
 *         try:
 *             if b_name.endswith(".lp"):             # <<<<<<<<<<<<<<
 *                 res = glp_write_lp(self.glp, NULL, c_name)
 *             elif b_name.endswith(".mps"):
 */
      goto __pyx_L6;
    }

    /* "cobra/solvers/cglpk.pyx":512
 *             if b_name.endswith(".lp"):
 *                 res = glp_write_lp(self.glp, NULL, c_name)
 *             elif b_name.endswith(".mps"):             # <<<<<<<<<<<<<<
 *                 res = glp_write_mps(self.glp, GLP_MPS_FILE, NULL, c_name)
 *             else:
 */
    __pyx_t_4 = __Pyx_PyBytes_Tailmatch(__pyx_v_b_name, __pyx_kp_s_mps, 0, PY_SSIZE_T_MAX, 1); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    if ((__pyx_t_4 != 0)) {

      /* "cobra/solvers/cglpk.pyx":513
 *                 res = glp_write_lp(self.glp, NULL, c_name)
 *             elif b_name.endswith(".mps"):
 *                 res = glp_write_mps(self.glp, GLP_MPS_FILE, NULL, c_name)             # <<<<<<<<<<<<<<
 *             else:
 *                 raise ValueError("Unknown file format for %s" % str(filename))
 */
      __pyx_v_res = glp_write_mps(__pyx_v_self->glp, GLP_MPS_FILE, NULL, __pyx_v_c_name);

      /* "cobra/solvers/cglpk.pyx":512
 *             if b_name.endswith(".lp"):
 *                 res = glp_write_lp(self.glp, NULL, c_name)
 *             elif b_name.endswith(".mps"):             # <<<<<<<<<<<<<<
 *                 res = glp_write_mps(self.glp, GLP_MPS_FILE, NULL, c_name)
 *             else:
 */
      goto __pyx_L6;
    }

    /* "cobra/solvers/cglpk.pyx":515
 *                 res = glp_write_mps(self.glp, GLP_MPS_FILE, NULL, c_name)
 *             else:
 *                 raise ValueError("Unknown file format for %s" % str(filename))             # <<<<<<<<<<<<<<
 *             if res != 0:
 *                 raise IOError("failed to write LP to file %s" % str(filename))
 */
    /*else*/ {
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_v_filename);
      __Pyx_GIVEREF(__pyx_v_filename);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_filename);
      __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Unknown_file_format_for_s, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    }
    __pyx_L6:;

    /* "cobra/solvers/cglpk.pyx":516
 *             else:
 *                 raise ValueError("Unknown file format for %s" % str(filename))
 *             if res != 0:             # <<<<<<<<<<<<<<
 *                 raise IOError("failed to write LP to file %s" % str(filename))
 *         finally:
 */
    __pyx_t_4 = ((__pyx_v_res != 0) != 0);
    if (__pyx_t_4) {

      /* "cobra/solvers/cglpk.pyx":517
 *                 raise ValueError("Unknown file format for %s" % str(filename))
 *             if res != 0:
 *                 raise IOError("failed to write LP to file %s" % str(filename))             # <<<<<<<<<<<<<<
 *         finally:
 *             glp_term_hook(hook, NULL)
 */
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_v_filename);
      __Pyx_GIVEREF(__pyx_v_filename);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_filename);
      __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_failed_to_write_LP_to_file_s, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L4_error;}

      /* "cobra/solvers/cglpk.pyx":516
 *             else:
 *                 raise ValueError("Unknown file format for %s" % str(filename))
 *             if res != 0:             # <<<<<<<<<<<<<<
 *                 raise IOError("failed to write LP to file %s" % str(filename))
 *         finally:
 */
    }
  }

  /* "cobra/solvers/cglpk.pyx":519
 *                 raise IOError("failed to write LP to file %s" % str(filename))
 *         finally:
 *             glp_term_hook(hook, NULL)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*finally:*/ {
    /*normal exit:*/{
      glp_term_hook(__pyx_f_5cobra_7solvers_5cglpk_hook, NULL);
      goto __pyx_L5;
    }
    /*exception exit:*/{
      __pyx_L4_error:;
      __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10) < 0)) __Pyx_ErrFetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_11);
      __Pyx_XGOTREF(__pyx_t_12);
      __Pyx_XGOTREF(__pyx_t_13);
      __pyx_t_5 = __pyx_lineno; __pyx_t_6 = __pyx_clineno; __pyx_t_7 = __pyx_filename;
      {
        glp_term_hook(__pyx_f_5cobra_7solvers_5cglpk_hook, NULL);
      }
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_XGIVEREF(__pyx_t_13);
        __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
      }
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_ErrRestore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0;
      __pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_6; __pyx_filename = __pyx_t_7;
      goto __pyx_L1_error;
    }
    __pyx_L5:;
  }

  /* "cobra/solvers/cglpk.pyx":492
 *         return other
 * 
 *     def write(self, filename):             # <<<<<<<<<<<<<<
 *         """Write the problem to a file
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cobra.solvers.cglpk.GLP.write", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_b_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cobra/solvers/cglpk.pyx":141
 *     cdef glp_smcp parameters
 *     cdef glp_iocp integer_parameters
 *     cdef public bool exact             # <<<<<<<<<<<<<<
 * 
 *     # cython related allocation/dellocation functions
 */

/* Python wrapper */
static PyObject *__pyx_pw_5cobra_7solvers_5cglpk_3GLP_5exact_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5cobra_7solvers_5cglpk_3GLP_5exact_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5cobra_7solvers_5cglpk_3GLP_5exact___get__(((struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *)__pyx_v_self));

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

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

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

/* Python wrapper */
static int __pyx_pw_5cobra_7solvers_5cglpk_3GLP_5exact_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5cobra_7solvers_5cglpk_3GLP_5exact_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5cobra_7solvers_5cglpk_3GLP_5exact_2__set__(((struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_5cobra_7solvers_5cglpk_3GLP_5exact_2__set__(struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_7cpython_4bool_bool))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->exact);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->exact));
  __pyx_v_self->exact = ((PyBoolObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cobra.solvers.cglpk.GLP.exact.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5cobra_7solvers_5cglpk_3GLP_5exact_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5cobra_7solvers_5cglpk_3GLP_5exact_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5cobra_7solvers_5cglpk_3GLP_5exact_4__del__(((struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *)__pyx_v_self));

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

static int __pyx_pf_5cobra_7solvers_5cglpk_3GLP_5exact_4__del__(struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *__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->exact);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->exact));
  __pyx_v_self->exact = ((PyBoolObject *)Py_None);

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

/* "cobra/solvers/cglpk.pyx":524
 * # wrappers for all the functions at the module level
 * create_problem = GLP.create_problem
 * def set_objective_sense(lp, objective_sense="maximize"):             # <<<<<<<<<<<<<<
 *     return lp.set_objective_sense(lp, objective_sense=objective_sense)
 * cpdef change_variable_bounds(lp, int index,
 */

/* Python wrapper */
static PyObject *__pyx_pw_5cobra_7solvers_5cglpk_1set_objective_sense(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5cobra_7solvers_5cglpk_set_objective_sense[] = "set_objective_sense(lp, objective_sense='maximize')";
static PyMethodDef __pyx_mdef_5cobra_7solvers_5cglpk_1set_objective_sense = {"set_objective_sense", (PyCFunction)__pyx_pw_5cobra_7solvers_5cglpk_1set_objective_sense, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5cobra_7solvers_5cglpk_set_objective_sense};
static PyObject *__pyx_pw_5cobra_7solvers_5cglpk_1set_objective_sense(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_lp = 0;
  PyObject *__pyx_v_objective_sense = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_objective_sense (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_lp_2,&__pyx_n_s_objective_sense,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)__pyx_n_s_maximize);
    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_lp_2)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_objective_sense);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_objective_sense") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_lp = values[0];
    __pyx_v_objective_sense = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_objective_sense", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("cobra.solvers.cglpk.set_objective_sense", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5cobra_7solvers_5cglpk_set_objective_sense(__pyx_self, __pyx_v_lp, __pyx_v_objective_sense);

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

static PyObject *__pyx_pf_5cobra_7solvers_5cglpk_set_objective_sense(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lp, PyObject *__pyx_v_objective_sense) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_objective_sense", 0);

  /* "cobra/solvers/cglpk.pyx":525
 * create_problem = GLP.create_problem
 * def set_objective_sense(lp, objective_sense="maximize"):
 *     return lp.set_objective_sense(lp, objective_sense=objective_sense)             # <<<<<<<<<<<<<<
 * cpdef change_variable_bounds(lp, int index,
 *                              double lower_bound, double upper_bound):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_lp, __pyx_n_s_set_objective_sense); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_lp);
  __Pyx_GIVEREF(__pyx_v_lp);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_lp);
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_objective_sense, __pyx_v_objective_sense) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cobra/solvers/cglpk.pyx":524
 * # wrappers for all the functions at the module level
 * create_problem = GLP.create_problem
 * def set_objective_sense(lp, objective_sense="maximize"):             # <<<<<<<<<<<<<<
 *     return lp.set_objective_sense(lp, objective_sense=objective_sense)
 * cpdef change_variable_bounds(lp, int index,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cobra.solvers.cglpk.set_objective_sense", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cobra/solvers/cglpk.pyx":526
 * def set_objective_sense(lp, objective_sense="maximize"):
 *     return lp.set_objective_sense(lp, objective_sense=objective_sense)
 * cpdef change_variable_bounds(lp, int index,             # <<<<<<<<<<<<<<
 *                              double lower_bound, double upper_bound):
 *     return lp.change_variable_bounds(index, lower_bound, upper_bound)
 */

static PyObject *__pyx_pw_5cobra_7solvers_5cglpk_3change_variable_bounds(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_5cobra_7solvers_5cglpk_change_variable_bounds(PyObject *__pyx_v_lp, int __pyx_v_index, double __pyx_v_lower_bound, double __pyx_v_upper_bound, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("change_variable_bounds", 0);

  /* "cobra/solvers/cglpk.pyx":528
 * cpdef change_variable_bounds(lp, int index,
 *                              double lower_bound, double upper_bound):
 *     return lp.change_variable_bounds(index, lower_bound, upper_bound)             # <<<<<<<<<<<<<<
 * cpdef change_variable_objective(lp, int index, double value):
 *     return lp.change_variable_objective(index, value)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_lp, __pyx_n_s_change_variable_bounds); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_index); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyFloat_FromDouble(__pyx_v_lower_bound); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyFloat_FromDouble(__pyx_v_upper_bound); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_7 = 1;
    }
  }
  __pyx_t_8 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  if (__pyx_t_6) {
    __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
  }
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, __pyx_t_5);
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cobra/solvers/cglpk.pyx":526
 * def set_objective_sense(lp, objective_sense="maximize"):
 *     return lp.set_objective_sense(lp, objective_sense=objective_sense)
 * cpdef change_variable_bounds(lp, int index,             # <<<<<<<<<<<<<<
 *                              double lower_bound, double upper_bound):
 *     return lp.change_variable_bounds(index, lower_bound, upper_bound)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("cobra.solvers.cglpk.change_variable_bounds", __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_5cobra_7solvers_5cglpk_3change_variable_bounds(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5cobra_7solvers_5cglpk_2change_variable_bounds[] = "change_variable_bounds(lp, int index, double lower_bound, double upper_bound)";
static PyObject *__pyx_pw_5cobra_7solvers_5cglpk_3change_variable_bounds(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_lp = 0;
  int __pyx_v_index;
  double __pyx_v_lower_bound;
  double __pyx_v_upper_bound;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("change_variable_bounds (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_lp_2,&__pyx_n_s_index,&__pyx_n_s_lower_bound,&__pyx_n_s_upper_bound,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_lp_2)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("change_variable_bounds", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_lower_bound)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("change_variable_bounds", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_upper_bound)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("change_variable_bounds", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "change_variable_bounds") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_lp = values[0];
    __pyx_v_index = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_index == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_lower_bound = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_lower_bound == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_upper_bound = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_upper_bound == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("change_variable_bounds", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("cobra.solvers.cglpk.change_variable_bounds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5cobra_7solvers_5cglpk_2change_variable_bounds(__pyx_self, __pyx_v_lp, __pyx_v_index, __pyx_v_lower_bound, __pyx_v_upper_bound);

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

static PyObject *__pyx_pf_5cobra_7solvers_5cglpk_2change_variable_bounds(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lp, int __pyx_v_index, double __pyx_v_lower_bound, double __pyx_v_upper_bound) {
  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("change_variable_bounds", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_5cobra_7solvers_5cglpk_change_variable_bounds(__pyx_v_lp, __pyx_v_index, __pyx_v_lower_bound, __pyx_v_upper_bound, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cobra.solvers.cglpk.change_variable_bounds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cobra/solvers/cglpk.pyx":529
 *                              double lower_bound, double upper_bound):
 *     return lp.change_variable_bounds(index, lower_bound, upper_bound)
 * cpdef change_variable_objective(lp, int index, double value):             # <<<<<<<<<<<<<<
 *     return lp.change_variable_objective(index, value)
 * cpdef change_coefficient(lp, int met_index, int rxn_index, double value):
 */

static PyObject *__pyx_pw_5cobra_7solvers_5cglpk_5change_variable_objective(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_5cobra_7solvers_5cglpk_change_variable_objective(PyObject *__pyx_v_lp, int __pyx_v_index, double __pyx_v_value, CYTHON_UNUSED int __pyx_skip_dispatch) {
  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;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("change_variable_objective", 0);

  /* "cobra/solvers/cglpk.pyx":530
 *     return lp.change_variable_bounds(index, lower_bound, upper_bound)
 * cpdef change_variable_objective(lp, int index, double value):
 *     return lp.change_variable_objective(index, value)             # <<<<<<<<<<<<<<
 * cpdef change_coefficient(lp, int met_index, int rxn_index, double value):
 *     return lp.change_coefficient(met_index, rxn_index, value)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_lp, __pyx_n_s_change_variable_objective); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_index); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  if (__pyx_t_5) {
    __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
  }
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_4);
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cobra/solvers/cglpk.pyx":529
 *                              double lower_bound, double upper_bound):
 *     return lp.change_variable_bounds(index, lower_bound, upper_bound)
 * cpdef change_variable_objective(lp, int index, double value):             # <<<<<<<<<<<<<<
 *     return lp.change_variable_objective(index, value)
 * cpdef change_coefficient(lp, int met_index, int rxn_index, double value):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("cobra.solvers.cglpk.change_variable_objective", __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_5cobra_7solvers_5cglpk_5change_variable_objective(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5cobra_7solvers_5cglpk_4change_variable_objective[] = "change_variable_objective(lp, int index, double value)";
static PyObject *__pyx_pw_5cobra_7solvers_5cglpk_5change_variable_objective(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_lp = 0;
  int __pyx_v_index;
  double __pyx_v_value;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("change_variable_objective (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_lp_2,&__pyx_n_s_index,&__pyx_n_s_value,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_lp_2)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("change_variable_objective", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("change_variable_objective", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "change_variable_objective") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_lp = values[0];
    __pyx_v_index = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_index == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_value = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_value == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("change_variable_objective", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("cobra.solvers.cglpk.change_variable_objective", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5cobra_7solvers_5cglpk_4change_variable_objective(__pyx_self, __pyx_v_lp, __pyx_v_index, __pyx_v_value);

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

static PyObject *__pyx_pf_5cobra_7solvers_5cglpk_4change_variable_objective(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lp, int __pyx_v_index, double __pyx_v_value) {
  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("change_variable_objective", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_5cobra_7solvers_5cglpk_change_variable_objective(__pyx_v_lp, __pyx_v_index, __pyx_v_value, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cobra.solvers.cglpk.change_variable_objective", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cobra/solvers/cglpk.pyx":531
 * cpdef change_variable_objective(lp, int index, double value):
 *     return lp.change_variable_objective(index, value)
 * cpdef change_coefficient(lp, int met_index, int rxn_index, double value):             # <<<<<<<<<<<<<<
 *     return lp.change_coefficient(met_index, rxn_index, value)
 * cpdef set_parameter(lp, parameter_name, value):
 */

static PyObject *__pyx_pw_5cobra_7solvers_5cglpk_7change_coefficient(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_5cobra_7solvers_5cglpk_change_coefficient(PyObject *__pyx_v_lp, int __pyx_v_met_index, int __pyx_v_rxn_index, double __pyx_v_value, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("change_coefficient", 0);

  /* "cobra/solvers/cglpk.pyx":532
 *     return lp.change_variable_objective(index, value)
 * cpdef change_coefficient(lp, int met_index, int rxn_index, double value):
 *     return lp.change_coefficient(met_index, rxn_index, value)             # <<<<<<<<<<<<<<
 * cpdef set_parameter(lp, parameter_name, value):
 *     return lp.set_parameter(parameter_name, value)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_lp, __pyx_n_s_change_coefficient); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_met_index); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_rxn_index); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_7 = 1;
    }
  }
  __pyx_t_8 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  if (__pyx_t_6) {
    __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
  }
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, __pyx_t_5);
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cobra/solvers/cglpk.pyx":531
 * cpdef change_variable_objective(lp, int index, double value):
 *     return lp.change_variable_objective(index, value)
 * cpdef change_coefficient(lp, int met_index, int rxn_index, double value):             # <<<<<<<<<<<<<<
 *     return lp.change_coefficient(met_index, rxn_index, value)
 * cpdef set_parameter(lp, parameter_name, value):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("cobra.solvers.cglpk.change_coefficient", __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_5cobra_7solvers_5cglpk_7change_coefficient(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5cobra_7solvers_5cglpk_6change_coefficient[] = "change_coefficient(lp, int met_index, int rxn_index, double value)";
static PyObject *__pyx_pw_5cobra_7solvers_5cglpk_7change_coefficient(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_lp = 0;
  int __pyx_v_met_index;
  int __pyx_v_rxn_index;
  double __pyx_v_value;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("change_coefficient (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_lp_2,&__pyx_n_s_met_index,&__pyx_n_s_rxn_index,&__pyx_n_s_value,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_lp_2)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_met_index)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("change_coefficient", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rxn_index)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("change_coefficient", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("change_coefficient", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "change_coefficient") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_lp = values[0];
    __pyx_v_met_index = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_met_index == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_rxn_index = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_rxn_index == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_value = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_value == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("change_coefficient", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("cobra.solvers.cglpk.change_coefficient", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5cobra_7solvers_5cglpk_6change_coefficient(__pyx_self, __pyx_v_lp, __pyx_v_met_index, __pyx_v_rxn_index, __pyx_v_value);

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

static PyObject *__pyx_pf_5cobra_7solvers_5cglpk_6change_coefficient(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lp, int __pyx_v_met_index, int __pyx_v_rxn_index, double __pyx_v_value) {
  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("change_coefficient", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_5cobra_7solvers_5cglpk_change_coefficient(__pyx_v_lp, __pyx_v_met_index, __pyx_v_rxn_index, __pyx_v_value, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cobra.solvers.cglpk.change_coefficient", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cobra/solvers/cglpk.pyx":533
 * cpdef change_coefficient(lp, int met_index, int rxn_index, double value):
 *     return lp.change_coefficient(met_index, rxn_index, value)
 * cpdef set_parameter(lp, parameter_name, value):             # <<<<<<<<<<<<<<
 *     return lp.set_parameter(parameter_name, value)
 * def solve_problem(lp, **kwargs):
 */

static PyObject *__pyx_pw_5cobra_7solvers_5cglpk_9set_parameter(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_5cobra_7solvers_5cglpk_set_parameter(PyObject *__pyx_v_lp, PyObject *__pyx_v_parameter_name, PyObject *__pyx_v_value, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_parameter", 0);

  /* "cobra/solvers/cglpk.pyx":534
 *     return lp.change_coefficient(met_index, rxn_index, value)
 * cpdef set_parameter(lp, parameter_name, value):
 *     return lp.set_parameter(parameter_name, value)             # <<<<<<<<<<<<<<
 * def solve_problem(lp, **kwargs):
 *     return lp.solve_problem(**kwargs)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_lp, __pyx_n_s_set_parameter); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_3) {
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
  }
  __Pyx_INCREF(__pyx_v_parameter_name);
  __Pyx_GIVEREF(__pyx_v_parameter_name);
  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_parameter_name);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_value);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cobra/solvers/cglpk.pyx":533
 * cpdef change_coefficient(lp, int met_index, int rxn_index, double value):
 *     return lp.change_coefficient(met_index, rxn_index, value)
 * cpdef set_parameter(lp, parameter_name, value):             # <<<<<<<<<<<<<<
 *     return lp.set_parameter(parameter_name, value)
 * def solve_problem(lp, **kwargs):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cobra.solvers.cglpk.set_parameter", __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_5cobra_7solvers_5cglpk_9set_parameter(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5cobra_7solvers_5cglpk_8set_parameter[] = "set_parameter(lp, parameter_name, value)";
static PyObject *__pyx_pw_5cobra_7solvers_5cglpk_9set_parameter(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_lp = 0;
  PyObject *__pyx_v_parameter_name = 0;
  PyObject *__pyx_v_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_parameter (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_lp_2,&__pyx_n_s_parameter_name,&__pyx_n_s_value,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_lp_2)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_parameter_name)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_parameter", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_parameter", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_parameter") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_lp = values[0];
    __pyx_v_parameter_name = values[1];
    __pyx_v_value = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_parameter", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("cobra.solvers.cglpk.set_parameter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5cobra_7solvers_5cglpk_8set_parameter(__pyx_self, __pyx_v_lp, __pyx_v_parameter_name, __pyx_v_value);

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

static PyObject *__pyx_pf_5cobra_7solvers_5cglpk_8set_parameter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lp, PyObject *__pyx_v_parameter_name, PyObject *__pyx_v_value) {
  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("set_parameter", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_5cobra_7solvers_5cglpk_set_parameter(__pyx_v_lp, __pyx_v_parameter_name, __pyx_v_value, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cobra.solvers.cglpk.set_parameter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cobra/solvers/cglpk.pyx":535
 * cpdef set_parameter(lp, parameter_name, value):
 *     return lp.set_parameter(parameter_name, value)
 * def solve_problem(lp, **kwargs):             # <<<<<<<<<<<<<<
 *     return lp.solve_problem(**kwargs)
 * cpdef get_status(lp):
 */

/* Python wrapper */
static PyObject *__pyx_pw_5cobra_7solvers_5cglpk_11solve_problem(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5cobra_7solvers_5cglpk_10solve_problem[] = "solve_problem(lp, **kwargs)";
static PyMethodDef __pyx_mdef_5cobra_7solvers_5cglpk_11solve_problem = {"solve_problem", (PyCFunction)__pyx_pw_5cobra_7solvers_5cglpk_11solve_problem, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5cobra_7solvers_5cglpk_10solve_problem};
static PyObject *__pyx_pw_5cobra_7solvers_5cglpk_11solve_problem(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_lp = 0;
  PyObject *__pyx_v_kwargs = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("solve_problem (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_lp_2,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_lp_2)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "solve_problem") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_lp = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("solve_problem", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("cobra.solvers.cglpk.solve_problem", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5cobra_7solvers_5cglpk_10solve_problem(__pyx_self, __pyx_v_lp, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_5cobra_7solvers_5cglpk_10solve_problem(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lp, PyObject *__pyx_v_kwargs) {
  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("solve_problem", 0);

  /* "cobra/solvers/cglpk.pyx":536
 *     return lp.set_parameter(parameter_name, value)
 * def solve_problem(lp, **kwargs):
 *     return lp.solve_problem(**kwargs)             # <<<<<<<<<<<<<<
 * cpdef get_status(lp):
 *     return lp.get_status()
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_lp, __pyx_n_s_solve_problem); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cobra/solvers/cglpk.pyx":535
 * cpdef set_parameter(lp, parameter_name, value):
 *     return lp.set_parameter(parameter_name, value)
 * def solve_problem(lp, **kwargs):             # <<<<<<<<<<<<<<
 *     return lp.solve_problem(**kwargs)
 * cpdef get_status(lp):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cobra.solvers.cglpk.solve_problem", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cobra/solvers/cglpk.pyx":537
 * def solve_problem(lp, **kwargs):
 *     return lp.solve_problem(**kwargs)
 * cpdef get_status(lp):             # <<<<<<<<<<<<<<
 *     return lp.get_status()
 * cpdef get_objective_value(lp):
 */

static PyObject *__pyx_pw_5cobra_7solvers_5cglpk_13get_status(PyObject *__pyx_self, PyObject *__pyx_v_lp); /*proto*/
static PyObject *__pyx_f_5cobra_7solvers_5cglpk_get_status(PyObject *__pyx_v_lp, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_status", 0);

  /* "cobra/solvers/cglpk.pyx":538
 *     return lp.solve_problem(**kwargs)
 * cpdef get_status(lp):
 *     return lp.get_status()             # <<<<<<<<<<<<<<
 * cpdef get_objective_value(lp):
 *     return lp.get_objective_value()
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_lp, __pyx_n_s_get_status); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cobra/solvers/cglpk.pyx":537
 * def solve_problem(lp, **kwargs):
 *     return lp.solve_problem(**kwargs)
 * cpdef get_status(lp):             # <<<<<<<<<<<<<<
 *     return lp.get_status()
 * cpdef get_objective_value(lp):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cobra.solvers.cglpk.get_status", __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_5cobra_7solvers_5cglpk_13get_status(PyObject *__pyx_self, PyObject *__pyx_v_lp); /*proto*/
static char __pyx_doc_5cobra_7solvers_5cglpk_12get_status[] = "get_status(lp)";
static PyObject *__pyx_pw_5cobra_7solvers_5cglpk_13get_status(PyObject *__pyx_self, PyObject *__pyx_v_lp) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_status (wrapper)", 0);
  __pyx_r = __pyx_pf_5cobra_7solvers_5cglpk_12get_status(__pyx_self, ((PyObject *)__pyx_v_lp));

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

static PyObject *__pyx_pf_5cobra_7solvers_5cglpk_12get_status(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lp) {
  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_status", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_5cobra_7solvers_5cglpk_get_status(__pyx_v_lp, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cobra.solvers.cglpk.get_status", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cobra/solvers/cglpk.pyx":539
 * cpdef get_status(lp):
 *     return lp.get_status()
 * cpdef get_objective_value(lp):             # <<<<<<<<<<<<<<
 *     return lp.get_objective_value()
 * cpdef format_solution(lp, cobra_model):
 */

static PyObject *__pyx_pw_5cobra_7solvers_5cglpk_15get_objective_value(PyObject *__pyx_self, PyObject *__pyx_v_lp); /*proto*/
static PyObject *__pyx_f_5cobra_7solvers_5cglpk_get_objective_value(PyObject *__pyx_v_lp, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_objective_value", 0);

  /* "cobra/solvers/cglpk.pyx":540
 *     return lp.get_status()
 * cpdef get_objective_value(lp):
 *     return lp.get_objective_value()             # <<<<<<<<<<<<<<
 * cpdef format_solution(lp, cobra_model):
 *     return lp.format_solution(cobra_model)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_lp, __pyx_n_s_get_objective_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cobra/solvers/cglpk.pyx":539
 * cpdef get_status(lp):
 *     return lp.get_status()
 * cpdef get_objective_value(lp):             # <<<<<<<<<<<<<<
 *     return lp.get_objective_value()
 * cpdef format_solution(lp, cobra_model):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cobra.solvers.cglpk.get_objective_value", __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_5cobra_7solvers_5cglpk_15get_objective_value(PyObject *__pyx_self, PyObject *__pyx_v_lp); /*proto*/
static char __pyx_doc_5cobra_7solvers_5cglpk_14get_objective_value[] = "get_objective_value(lp)";
static PyObject *__pyx_pw_5cobra_7solvers_5cglpk_15get_objective_value(PyObject *__pyx_self, PyObject *__pyx_v_lp) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_objective_value (wrapper)", 0);
  __pyx_r = __pyx_pf_5cobra_7solvers_5cglpk_14get_objective_value(__pyx_self, ((PyObject *)__pyx_v_lp));

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

static PyObject *__pyx_pf_5cobra_7solvers_5cglpk_14get_objective_value(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lp) {
  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_objective_value", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_5cobra_7solvers_5cglpk_get_objective_value(__pyx_v_lp, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cobra.solvers.cglpk.get_objective_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cobra/solvers/cglpk.pyx":541
 * cpdef get_objective_value(lp):
 *     return lp.get_objective_value()
 * cpdef format_solution(lp, cobra_model):             # <<<<<<<<<<<<<<
 *     return lp.format_solution(cobra_model)
 * solve = GLP.solve
 */

static PyObject *__pyx_pw_5cobra_7solvers_5cglpk_17format_solution(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_5cobra_7solvers_5cglpk_format_solution(PyObject *__pyx_v_lp, PyObject *__pyx_v_cobra_model, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("format_solution", 0);

  /* "cobra/solvers/cglpk.pyx":542
 *     return lp.get_objective_value()
 * cpdef format_solution(lp, cobra_model):
 *     return lp.format_solution(cobra_model)             # <<<<<<<<<<<<<<
 * solve = GLP.solve
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_lp, __pyx_n_s_format_solution); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_cobra_model); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_v_cobra_model);
    __Pyx_GIVEREF(__pyx_v_cobra_model);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_cobra_model);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cobra/solvers/cglpk.pyx":541
 * cpdef get_objective_value(lp):
 *     return lp.get_objective_value()
 * cpdef format_solution(lp, cobra_model):             # <<<<<<<<<<<<<<
 *     return lp.format_solution(cobra_model)
 * solve = GLP.solve
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cobra.solvers.cglpk.format_solution", __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_5cobra_7solvers_5cglpk_17format_solution(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5cobra_7solvers_5cglpk_16format_solution[] = "format_solution(lp, cobra_model)";
static PyObject *__pyx_pw_5cobra_7solvers_5cglpk_17format_solution(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_lp = 0;
  PyObject *__pyx_v_cobra_model = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("format_solution (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_lp_2,&__pyx_n_s_cobra_model,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_lp_2)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cobra_model)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("format_solution", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "format_solution") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __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_lp = values[0];
    __pyx_v_cobra_model = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("format_solution", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("cobra.solvers.cglpk.format_solution", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5cobra_7solvers_5cglpk_16format_solution(__pyx_self, __pyx_v_lp, __pyx_v_cobra_model);

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

static PyObject *__pyx_pf_5cobra_7solvers_5cglpk_16format_solution(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lp, PyObject *__pyx_v_cobra_model) {
  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("format_solution", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_5cobra_7solvers_5cglpk_format_solution(__pyx_v_lp, __pyx_v_cobra_model, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cobra.solvers.cglpk.format_solution", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static struct __pyx_vtabstruct_5cobra_7solvers_5cglpk_GLP __pyx_vtable_5cobra_7solvers_5cglpk_GLP;

static PyObject *__pyx_tp_new_5cobra_7solvers_5cglpk_GLP(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *)o);
  p->__pyx_vtab = __pyx_vtabptr_5cobra_7solvers_5cglpk_GLP;
  p->exact = ((PyBoolObject *)Py_None); Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_5cobra_7solvers_5cglpk_3GLP_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_5cobra_7solvers_5cglpk_GLP(PyObject *o) {
  struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *p = (struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *)o;
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_5cobra_7solvers_5cglpk_3GLP_3__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->exact);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_5cobra_7solvers_5cglpk_GLP(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *p = (struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *)o;
  if (p->exact) {
    e = (*v)(((PyObject*)p->exact), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_5cobra_7solvers_5cglpk_GLP(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *p = (struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *)o;
  tmp = ((PyObject*)p->exact);
  p->exact = ((PyBoolObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_5cobra_7solvers_5cglpk_3GLP_exact(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5cobra_7solvers_5cglpk_3GLP_5exact_1__get__(o);
}

static int __pyx_setprop_5cobra_7solvers_5cglpk_3GLP_exact(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5cobra_7solvers_5cglpk_3GLP_5exact_3__set__(o, v);
  }
  else {
    return __pyx_pw_5cobra_7solvers_5cglpk_3GLP_5exact_5__del__(o);
  }
}

static PyMethodDef __pyx_methods_5cobra_7solvers_5cglpk_GLP[] = {
  {"create_problem", (PyCFunction)__pyx_pw_5cobra_7solvers_5cglpk_3GLP_7create_problem, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5cobra_7solvers_5cglpk_3GLP_6create_problem},
  {"change_variable_bounds", (PyCFunction)__pyx_pw_5cobra_7solvers_5cglpk_3GLP_9change_variable_bounds, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5cobra_7solvers_5cglpk_3GLP_8change_variable_bounds},
  {"change_coefficient", (PyCFunction)__pyx_pw_5cobra_7solvers_5cglpk_3GLP_11change_coefficient, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5cobra_7solvers_5cglpk_3GLP_10change_coefficient},
  {"solve_problem", (PyCFunction)__pyx_pw_5cobra_7solvers_5cglpk_3GLP_13solve_problem, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5cobra_7solvers_5cglpk_3GLP_12solve_problem},
  {"solve", (PyCFunction)__pyx_pw_5cobra_7solvers_5cglpk_3GLP_15solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5cobra_7solvers_5cglpk_3GLP_14solve},
  {"get_status", (PyCFunction)__pyx_pw_5cobra_7solvers_5cglpk_3GLP_17get_status, METH_NOARGS, __pyx_doc_5cobra_7solvers_5cglpk_3GLP_16get_status},
  {"set_objective_sense", (PyCFunction)__pyx_pw_5cobra_7solvers_5cglpk_3GLP_19set_objective_sense, METH_O, __pyx_doc_5cobra_7solvers_5cglpk_3GLP_18set_objective_sense},
  {"set_parameter", (PyCFunction)__pyx_pw_5cobra_7solvers_5cglpk_3GLP_21set_parameter, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5cobra_7solvers_5cglpk_3GLP_20set_parameter},
  {"get_objective_value", (PyCFunction)__pyx_pw_5cobra_7solvers_5cglpk_3GLP_23get_objective_value, METH_NOARGS, __pyx_doc_5cobra_7solvers_5cglpk_3GLP_22get_objective_value},
  {"change_variable_objective", (PyCFunction)__pyx_pw_5cobra_7solvers_5cglpk_3GLP_25change_variable_objective, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5cobra_7solvers_5cglpk_3GLP_24change_variable_objective},
  {"is_mip", (PyCFunction)__pyx_pw_5cobra_7solvers_5cglpk_3GLP_27is_mip, METH_NOARGS, __pyx_doc_5cobra_7solvers_5cglpk_3GLP_26is_mip},
  {"format_solution", (PyCFunction)__pyx_pw_5cobra_7solvers_5cglpk_3GLP_29format_solution, METH_O, __pyx_doc_5cobra_7solvers_5cglpk_3GLP_28format_solution},
  {"__getstate__", (PyCFunction)__pyx_pw_5cobra_7solvers_5cglpk_3GLP_31__getstate__, METH_NOARGS, __pyx_doc_5cobra_7solvers_5cglpk_3GLP_30__getstate__},
  {"__reduce__", (PyCFunction)__pyx_pw_5cobra_7solvers_5cglpk_3GLP_33__reduce__, METH_NOARGS, __pyx_doc_5cobra_7solvers_5cglpk_3GLP_32__reduce__},
  {"__setstate__", (PyCFunction)__pyx_pw_5cobra_7solvers_5cglpk_3GLP_35__setstate__, METH_O, __pyx_doc_5cobra_7solvers_5cglpk_3GLP_34__setstate__},
  {"__copy__", (PyCFunction)__pyx_pw_5cobra_7solvers_5cglpk_3GLP_37__copy__, METH_NOARGS, __pyx_doc_5cobra_7solvers_5cglpk_3GLP_36__copy__},
  {"write", (PyCFunction)__pyx_pw_5cobra_7solvers_5cglpk_3GLP_39write, METH_O, __pyx_doc_5cobra_7solvers_5cglpk_3GLP_38write},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_5cobra_7solvers_5cglpk_GLP[] = {
  {(char *)"exact", __pyx_getprop_5cobra_7solvers_5cglpk_3GLP_exact, __pyx_setprop_5cobra_7solvers_5cglpk_3GLP_exact, __pyx_k_exact___builtin___bool, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_5cobra_7solvers_5cglpk_GLP = {
  PyVarObject_HEAD_INIT(0, 0)
  "cobra.solvers.cglpk.GLP", /*tp_name*/
  sizeof(struct __pyx_obj_5cobra_7solvers_5cglpk_GLP), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5cobra_7solvers_5cglpk_GLP, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "GLP(cobra_model=None)", /*tp_doc*/
  __pyx_tp_traverse_5cobra_7solvers_5cglpk_GLP, /*tp_traverse*/
  __pyx_tp_clear_5cobra_7solvers_5cglpk_GLP, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_5cobra_7solvers_5cglpk_GLP, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_5cobra_7solvers_5cglpk_GLP, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_5cobra_7solvers_5cglpk_3GLP_5__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_5cobra_7solvers_5cglpk_GLP, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static PyMethodDef __pyx_methods[] = {
  {"change_variable_bounds", (PyCFunction)__pyx_pw_5cobra_7solvers_5cglpk_3change_variable_bounds, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5cobra_7solvers_5cglpk_2change_variable_bounds},
  {"change_variable_objective", (PyCFunction)__pyx_pw_5cobra_7solvers_5cglpk_5change_variable_objective, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5cobra_7solvers_5cglpk_4change_variable_objective},
  {"change_coefficient", (PyCFunction)__pyx_pw_5cobra_7solvers_5cglpk_7change_coefficient, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5cobra_7solvers_5cglpk_6change_coefficient},
  {"set_parameter", (PyCFunction)__pyx_pw_5cobra_7solvers_5cglpk_9set_parameter, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5cobra_7solvers_5cglpk_8set_parameter},
  {"get_status", (PyCFunction)__pyx_pw_5cobra_7solvers_5cglpk_13get_status, METH_O, __pyx_doc_5cobra_7solvers_5cglpk_12get_status},
  {"get_objective_value", (PyCFunction)__pyx_pw_5cobra_7solvers_5cglpk_15get_objective_value, METH_O, __pyx_doc_5cobra_7solvers_5cglpk_14get_objective_value},
  {"format_solution", (PyCFunction)__pyx_pw_5cobra_7solvers_5cglpk_17format_solution, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5cobra_7solvers_5cglpk_16format_solution},
  {0, 0, 0, 0}
};

#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef __pyx_moduledef = {
  #if PY_VERSION_HEX < 0x03020000
    { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
  #else
    PyModuleDef_HEAD_INIT,
  #endif
    "cglpk",
    0, /* m_doc */
    -1, /* m_size */
    __pyx_methods /* m_methods */,
    NULL, /* m_reload */
    NULL, /* m_traverse */
    NULL, /* m_clear */
    NULL /* m_free */
};
#endif

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_kp_s_2n, __pyx_k_2n, sizeof(__pyx_k_2n), 0, 0, 1, 0},
  {&__pyx_n_s_Basic, __pyx_k_Basic, sizeof(__pyx_k_Basic), 0, 0, 1, 1},
  {&__pyx_kp_s_Bindings_to_GLPK_The_GNU_Linear, __pyx_k_Bindings_to_GLPK_The_GNU_Linear, sizeof(__pyx_k_Bindings_to_GLPK_The_GNU_Linear), 0, 0, 1, 0},
  {&__pyx_n_s_E, __pyx_k_E, sizeof(__pyx_k_E), 0, 0, 1, 1},
  {&__pyx_n_s_G, __pyx_k_G, sizeof(__pyx_k_G), 0, 0, 1, 1},
  {&__pyx_n_s_GLP_EBADB, __pyx_k_GLP_EBADB, sizeof(__pyx_k_GLP_EBADB), 0, 0, 1, 1},
  {&__pyx_n_s_GLP_EBOUND, __pyx_k_GLP_EBOUND, sizeof(__pyx_k_GLP_EBOUND), 0, 0, 1, 1},
  {&__pyx_n_s_GLP_ECOND, __pyx_k_GLP_ECOND, sizeof(__pyx_k_GLP_ECOND), 0, 0, 1, 1},
  {&__pyx_n_s_GLP_EDATA, __pyx_k_GLP_EDATA, sizeof(__pyx_k_GLP_EDATA), 0, 0, 1, 1},
  {&__pyx_n_s_GLP_EFAIL, __pyx_k_GLP_EFAIL, sizeof(__pyx_k_GLP_EFAIL), 0, 0, 1, 1},
  {&__pyx_n_s_GLP_EINSTAB, __pyx_k_GLP_EINSTAB, sizeof(__pyx_k_GLP_EINSTAB), 0, 0, 1, 1},
  {&__pyx_n_s_GLP_EITLIM, __pyx_k_GLP_EITLIM, sizeof(__pyx_k_GLP_EITLIM), 0, 0, 1, 1},
  {&__pyx_n_s_GLP_EMIPGAP, __pyx_k_GLP_EMIPGAP, sizeof(__pyx_k_GLP_EMIPGAP), 0, 0, 1, 1},
  {&__pyx_n_s_GLP_ENOCVG, __pyx_k_GLP_ENOCVG, sizeof(__pyx_k_GLP_ENOCVG), 0, 0, 1, 1},
  {&__pyx_n_s_GLP_ENODFS, __pyx_k_GLP_ENODFS, sizeof(__pyx_k_GLP_ENODFS), 0, 0, 1, 1},
  {&__pyx_n_s_GLP_ENOFEAS, __pyx_k_GLP_ENOFEAS, sizeof(__pyx_k_GLP_ENOFEAS), 0, 0, 1, 1},
  {&__pyx_n_s_GLP_ENOPFS, __pyx_k_GLP_ENOPFS, sizeof(__pyx_k_GLP_ENOPFS), 0, 0, 1, 1},
  {&__pyx_n_s_GLP_EOBJLL, __pyx_k_GLP_EOBJLL, sizeof(__pyx_k_GLP_EOBJLL), 0, 0, 1, 1},
  {&__pyx_n_s_GLP_EOBJUL, __pyx_k_GLP_EOBJUL, sizeof(__pyx_k_GLP_EOBJUL), 0, 0, 1, 1},
  {&__pyx_n_s_GLP_ERANGE, __pyx_k_GLP_ERANGE, sizeof(__pyx_k_GLP_ERANGE), 0, 0, 1, 1},
  {&__pyx_n_s_GLP_EROOT, __pyx_k_GLP_EROOT, sizeof(__pyx_k_GLP_EROOT), 0, 0, 1, 1},
  {&__pyx_n_s_GLP_ESING, __pyx_k_GLP_ESING, sizeof(__pyx_k_GLP_ESING), 0, 0, 1, 1},
  {&__pyx_n_s_GLP_ESTOP, __pyx_k_GLP_ESTOP, sizeof(__pyx_k_GLP_ESTOP), 0, 0, 1, 1},
  {&__pyx_n_s_GLP_ETMLIM, __pyx_k_GLP_ETMLIM, sizeof(__pyx_k_GLP_ETMLIM), 0, 0, 1, 1},
  {&__pyx_n_s_IOError, __pyx_k_IOError, sizeof(__pyx_k_IOError), 0, 0, 1, 1},
  {&__pyx_kp_s_Integer_overflow_d_d, __pyx_k_Integer_overflow_d_d, sizeof(__pyx_k_Integer_overflow_d_d), 0, 0, 1, 0},
  {&__pyx_n_s_L, __pyx_k_L, sizeof(__pyx_k_L), 0, 0, 1, 1},
  {&__pyx_n_s_MIP_gap, __pyx_k_MIP_gap, sizeof(__pyx_k_MIP_gap), 0, 0, 1, 1},
  {&__pyx_n_s_MIP_gap_abs, __pyx_k_MIP_gap_abs, sizeof(__pyx_k_MIP_gap_abs), 0, 0, 1, 1},
  {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
  {&__pyx_n_s_NamedTemporaryFile, __pyx_k_NamedTemporaryFile, sizeof(__pyx_k_NamedTemporaryFile), 0, 0, 1, 1},
  {&__pyx_n_s_NamedTemporaryFile_2, __pyx_k_NamedTemporaryFile_2, sizeof(__pyx_k_NamedTemporaryFile_2), 0, 0, 1, 1},
  {&__pyx_n_s_Number, __pyx_k_Number, sizeof(__pyx_k_Number), 0, 0, 1, 1},
  {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
  {&__pyx_n_s_SUPPORTS_MILP, __pyx_k_SUPPORTS_MILP, sizeof(__pyx_k_SUPPORTS_MILP), 0, 0, 1, 1},
  {&__pyx_kp_s_Unknown_file_format_for_s, __pyx_k_Unknown_file_format_for_s, sizeof(__pyx_k_Unknown_file_format_for_s), 0, 0, 1, 0},
  {&__pyx_kp_s_Unknown_python_version, __pyx_k_Unknown_python_version, sizeof(__pyx_k_Unknown_python_version), 0, 0, 1, 0},
  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
  {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1},
  {&__pyx_n_s_auto, __pyx_k_auto, sizeof(__pyx_k_auto), 0, 0, 1, 1},
  {&__pyx_n_s_bound, __pyx_k_bound, sizeof(__pyx_k_bound), 0, 0, 1, 1},
  {&__pyx_n_s_cglpk, __pyx_k_cglpk, sizeof(__pyx_k_cglpk), 0, 0, 1, 1},
  {&__pyx_n_s_change_coefficient, __pyx_k_change_coefficient, sizeof(__pyx_k_change_coefficient), 0, 0, 1, 1},
  {&__pyx_n_s_change_variable_bounds, __pyx_k_change_variable_bounds, sizeof(__pyx_k_change_variable_bounds), 0, 0, 1, 1},
  {&__pyx_n_s_change_variable_objective, __pyx_k_change_variable_objective, sizeof(__pyx_k_change_variable_objective), 0, 0, 1, 1},
  {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
  {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1},
  {&__pyx_n_s_cobra_model, __pyx_k_cobra_model, sizeof(__pyx_k_cobra_model), 0, 0, 1, 1},
  {&__pyx_n_s_cobra_solvers_cglpk, __pyx_k_cobra_solvers_cglpk, sizeof(__pyx_k_cobra_solvers_cglpk), 0, 0, 1, 1},
  {&__pyx_n_s_constraint_sense, __pyx_k_constraint_sense, sizeof(__pyx_k_constraint_sense), 0, 0, 1, 1},
  {&__pyx_n_s_create_problem, __pyx_k_create_problem, sizeof(__pyx_k_create_problem), 0, 0, 1, 1},
  {&__pyx_n_s_delete, __pyx_k_delete, sizeof(__pyx_k_delete), 0, 0, 1, 1},
  {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
  {&__pyx_n_s_dual, __pyx_k_dual, sizeof(__pyx_k_dual), 0, 0, 1, 1},
  {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1},
  {&__pyx_n_s_enter, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1},
  {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
  {&__pyx_n_s_eq, __pyx_k_eq, sizeof(__pyx_k_eq), 0, 0, 1, 1},
  {&__pyx_n_s_err, __pyx_k_err, sizeof(__pyx_k_err), 0, 0, 1, 1},
  {&__pyx_n_s_exact, __pyx_k_exact, sizeof(__pyx_k_exact), 0, 0, 1, 1},
  {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1},
  {&__pyx_n_s_failed, __pyx_k_failed, sizeof(__pyx_k_failed), 0, 0, 1, 1},
  {&__pyx_kp_s_failed_to_write_LP_to_file_s, __pyx_k_failed_to_write_LP_to_file_s, sizeof(__pyx_k_failed_to_write_LP_to_file_s), 0, 0, 1, 0},
  {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1},
  {&__pyx_n_s_format_solution, __pyx_k_format_solution, sizeof(__pyx_k_format_solution), 0, 0, 1, 1},
  {&__pyx_n_s_get_objective_value, __pyx_k_get_objective_value, sizeof(__pyx_k_get_objective_value), 0, 0, 1, 1},
  {&__pyx_n_s_get_status, __pyx_k_get_status, sizeof(__pyx_k_get_status), 0, 0, 1, 1},
  {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
  {&__pyx_kp_s_glp_simplex_failed_with_error_co, __pyx_k_glp_simplex_failed_with_error_co, sizeof(__pyx_k_glp_simplex_failed_with_error_co), 0, 0, 1, 0},
  {&__pyx_kp_s_glp_simplex_failed_with_unknown, __pyx_k_glp_simplex_failed_with_unknown, sizeof(__pyx_k_glp_simplex_failed_with_unknown), 0, 0, 1, 0},
  {&__pyx_n_s_glpk_version, __pyx_k_glpk_version, sizeof(__pyx_k_glpk_version), 0, 0, 1, 1},
  {&__pyx_n_s_gm, __pyx_k_gm, sizeof(__pyx_k_gm), 0, 0, 1, 1},
  {&__pyx_n_s_har, __pyx_k_har, sizeof(__pyx_k_har), 0, 0, 1, 1},
  {&__pyx_kp_s_home_aebrahim_cobrapy_cobra_sol, __pyx_k_home_aebrahim_cobrapy_cobra_sol, sizeof(__pyx_k_home_aebrahim_cobrapy_cobra_sol), 0, 0, 1, 0},
  {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
  {&__pyx_kp_s_ill_conditioned_matrix, __pyx_k_ill_conditioned_matrix, sizeof(__pyx_k_ill_conditioned_matrix), 0, 0, 1, 0},
  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
  {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1},
  {&__pyx_n_s_infeasible, __pyx_k_infeasible, sizeof(__pyx_k_infeasible), 0, 0, 1, 1},
  {&__pyx_n_s_integer, __pyx_k_integer, sizeof(__pyx_k_integer), 0, 0, 1, 1},
  {&__pyx_kp_s_invalid_basis, __pyx_k_invalid_basis, sizeof(__pyx_k_invalid_basis), 0, 0, 1, 0},
  {&__pyx_kp_s_invalid_bounds, __pyx_k_invalid_bounds, sizeof(__pyx_k_invalid_bounds), 0, 0, 1, 0},
  {&__pyx_kp_s_invalid_data, __pyx_k_invalid_data, sizeof(__pyx_k_invalid_data), 0, 0, 1, 0},
  {&__pyx_n_s_is_mip, __pyx_k_is_mip, sizeof(__pyx_k_is_mip), 0, 0, 1, 1},
  {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1},
  {&__pyx_n_s_iteration_limit, __pyx_k_iteration_limit, sizeof(__pyx_k_iteration_limit), 0, 0, 1, 1},
  {&__pyx_kp_s_iteration_limit_exceeded, __pyx_k_iteration_limit_exceeded, sizeof(__pyx_k_iteration_limit_exceeded), 0, 0, 1, 0},
  {&__pyx_n_s_iteritems, __pyx_k_iteritems, sizeof(__pyx_k_iteritems), 0, 0, 1, 1},
  {&__pyx_n_s_kwargs, __pyx_k_kwargs, sizeof(__pyx_k_kwargs), 0, 0, 1, 1},
  {&__pyx_kp_s_latin_1, __pyx_k_latin_1, sizeof(__pyx_k_latin_1), 0, 0, 1, 0},
  {&__pyx_n_s_lower, __pyx_k_lower, sizeof(__pyx_k_lower), 0, 0, 1, 1},
  {&__pyx_n_s_lower_bound, __pyx_k_lower_bound, sizeof(__pyx_k_lower_bound), 0, 0, 1, 1},
  {&__pyx_kp_s_lp, __pyx_k_lp, sizeof(__pyx_k_lp), 0, 0, 1, 0},
  {&__pyx_n_s_lp_2, __pyx_k_lp_2, sizeof(__pyx_k_lp_2), 0, 0, 1, 1},
  {&__pyx_n_s_lp_method, __pyx_k_lp_method, sizeof(__pyx_k_lp_method), 0, 0, 1, 1},
  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  {&__pyx_n_s_maximize, __pyx_k_maximize, sizeof(__pyx_k_maximize), 0, 0, 1, 1},
  {&__pyx_n_s_met_index, __pyx_k_met_index, sizeof(__pyx_k_met_index), 0, 0, 1, 1},
  {&__pyx_n_s_metabolites, __pyx_k_metabolites, sizeof(__pyx_k_metabolites), 0, 0, 1, 1},
  {&__pyx_n_s_metabolites_2, __pyx_k_metabolites_2, sizeof(__pyx_k_metabolites_2), 0, 0, 1, 1},
  {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
  {&__pyx_n_s_minimize, __pyx_k_minimize, sizeof(__pyx_k_minimize), 0, 0, 1, 1},
  {&__pyx_n_s_mip_gap, __pyx_k_mip_gap, sizeof(__pyx_k_mip_gap), 0, 0, 1, 1},
  {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
  {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
  {&__pyx_kp_s_mps, __pyx_k_mps, sizeof(__pyx_k_mps), 0, 0, 1, 0},
  {&__pyx_kp_s_multiple_threads_not_supported, __pyx_k_multiple_threads_not_supported, sizeof(__pyx_k_multiple_threads_not_supported), 0, 0, 1, 0},
  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
  {&__pyx_kp_s_no_convergence, __pyx_k_no_convergence, sizeof(__pyx_k_no_convergence), 0, 0, 1, 0},
  {&__pyx_kp_s_no_dual_feasible_solution, __pyx_k_no_dual_feasible_solution, sizeof(__pyx_k_no_dual_feasible_solution), 0, 0, 1, 0},
  {&__pyx_kp_s_no_primal_dual_feasible_solution, __pyx_k_no_primal_dual_feasible_solution, sizeof(__pyx_k_no_primal_dual_feasible_solution), 0, 0, 1, 0},
  {&__pyx_kp_s_no_primal_feasible_solution, __pyx_k_no_primal_feasible_solution, sizeof(__pyx_k_no_primal_feasible_solution), 0, 0, 1, 0},
  {&__pyx_n_s_normal, __pyx_k_normal, sizeof(__pyx_k_normal), 0, 0, 1, 1},
  {&__pyx_kp_s_numerical_instability, __pyx_k_numerical_instability, sizeof(__pyx_k_numerical_instability), 0, 0, 1, 0},
  {&__pyx_n_s_objective_coefficient, __pyx_k_objective_coefficient, sizeof(__pyx_k_objective_coefficient), 0, 0, 1, 1},
  {&__pyx_kp_s_objective_lower_limit_reached, __pyx_k_objective_lower_limit_reached, sizeof(__pyx_k_objective_lower_limit_reached), 0, 0, 1, 0},
  {&__pyx_n_s_objective_sense, __pyx_k_objective_sense, sizeof(__pyx_k_objective_sense), 0, 0, 1, 1},
  {&__pyx_kp_s_objective_upper_limit_reached, __pyx_k_objective_upper_limit_reached, sizeof(__pyx_k_objective_upper_limit_reached), 0, 0, 1, 0},
  {&__pyx_n_s_open, __pyx_k_open, sizeof(__pyx_k_open), 0, 0, 1, 1},
  {&__pyx_n_s_optimal, __pyx_k_optimal, sizeof(__pyx_k_optimal), 0, 0, 1, 1},
  {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1},
  {&__pyx_n_s_parameter_name, __pyx_k_parameter_name, sizeof(__pyx_k_parameter_name), 0, 0, 1, 1},
  {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
  {&__pyx_n_s_presolve, __pyx_k_presolve, sizeof(__pyx_k_presolve), 0, 0, 1, 1},
  {&__pyx_n_s_pricing, __pyx_k_pricing, sizeof(__pyx_k_pricing), 0, 0, 1, 1},
  {&__pyx_n_s_primal, __pyx_k_primal, sizeof(__pyx_k_primal), 0, 0, 1, 1},
  {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1},
  {&__pyx_n_s_pse, __pyx_k_pse, sizeof(__pyx_k_pse), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
  {&__pyx_n_s_quadratic_component, __pyx_k_quadratic_component, sizeof(__pyx_k_quadratic_component), 0, 0, 1, 1},
  {&__pyx_kp_s_quadratic_component_must_be_None, __pyx_k_quadratic_component_must_be_None, sizeof(__pyx_k_quadratic_component_must_be_None), 0, 0, 1, 0},
  {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
  {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1},
  {&__pyx_n_s_r_test, __pyx_k_r_test, sizeof(__pyx_k_r_test), 0, 0, 1, 1},
  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
  {&__pyx_n_s_reactions, __pyx_k_reactions, sizeof(__pyx_k_reactions), 0, 0, 1, 1},
  {&__pyx_n_s_read, __pyx_k_read, sizeof(__pyx_k_read), 0, 0, 1, 1},
  {&__pyx_kp_s_relative_mip_gap_tolerance_reach, __pyx_k_relative_mip_gap_tolerance_reach, sizeof(__pyx_k_relative_mip_gap_tolerance_reach), 0, 0, 1, 0},
  {&__pyx_kp_s_result_out_of_range, __pyx_k_result_out_of_range, sizeof(__pyx_k_result_out_of_range), 0, 0, 1, 0},
  {&__pyx_kp_s_root_LP_optimum_not_provided, __pyx_k_root_LP_optimum_not_provided, sizeof(__pyx_k_root_LP_optimum_not_provided), 0, 0, 1, 0},
  {&__pyx_n_s_rxn_index, __pyx_k_rxn_index, sizeof(__pyx_k_rxn_index), 0, 0, 1, 1},
  {&__pyx_kp_s_s_is_not_a_valid_objective_sens, __pyx_k_s_is_not_a_valid_objective_sens, sizeof(__pyx_k_s_is_not_a_valid_objective_sens), 0, 0, 1, 0},
  {&__pyx_n_s_scale, __pyx_k_scale, sizeof(__pyx_k_scale), 0, 0, 1, 1},
  {&__pyx_kp_s_search_terminated_by_application, __pyx_k_search_terminated_by_application, sizeof(__pyx_k_search_terminated_by_application), 0, 0, 1, 0},
  {&__pyx_n_s_set_objective_sense, __pyx_k_set_objective_sense, sizeof(__pyx_k_set_objective_sense), 0, 0, 1, 1},
  {&__pyx_n_s_set_parameter, __pyx_k_set_parameter, sizeof(__pyx_k_set_parameter), 0, 0, 1, 1},
  {&__pyx_kp_s_setting_aboslute_mip_gap_not_sup, __pyx_k_setting_aboslute_mip_gap_not_sup, sizeof(__pyx_k_setting_aboslute_mip_gap_not_sup), 0, 0, 1, 0},
  {&__pyx_kp_s_singular_matrix, __pyx_k_singular_matrix, sizeof(__pyx_k_singular_matrix), 0, 0, 1, 0},
  {&__pyx_n_s_skip, __pyx_k_skip, sizeof(__pyx_k_skip), 0, 0, 1, 1},
  {&__pyx_n_s_solution, __pyx_k_solution, sizeof(__pyx_k_solution), 0, 0, 1, 1},
  {&__pyx_n_s_solve, __pyx_k_solve, sizeof(__pyx_k_solve), 0, 0, 1, 1},
  {&__pyx_n_s_solve_problem, __pyx_k_solve_problem, sizeof(__pyx_k_solve_problem), 0, 0, 1, 1},
  {&__pyx_kp_s_solver_failed, __pyx_k_solver_failed, sizeof(__pyx_k_solver_failed), 0, 0, 1, 0},
  {&__pyx_n_s_solver_name, __pyx_k_solver_name, sizeof(__pyx_k_solver_name), 0, 0, 1, 1},
  {&__pyx_n_s_status, __pyx_k_status, sizeof(__pyx_k_status), 0, 0, 1, 1},
  {&__pyx_n_s_std, __pyx_k_std, sizeof(__pyx_k_std), 0, 0, 1, 1},
  {&__pyx_n_s_sympy, __pyx_k_sympy, sizeof(__pyx_k_sympy), 0, 0, 1, 1},
  {&__pyx_n_s_tempfile, __pyx_k_tempfile, sizeof(__pyx_k_tempfile), 0, 0, 1, 1},
  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  {&__pyx_n_s_threads, __pyx_k_threads, sizeof(__pyx_k_threads), 0, 0, 1, 1},
  {&__pyx_n_s_time_limit, __pyx_k_time_limit, sizeof(__pyx_k_time_limit), 0, 0, 1, 1},
  {&__pyx_kp_s_time_limit_exceeded, __pyx_k_time_limit_exceeded, sizeof(__pyx_k_time_limit_exceeded), 0, 0, 1, 0},
  {&__pyx_n_s_tm_lim, __pyx_k_tm_lim, sizeof(__pyx_k_tm_lim), 0, 0, 1, 1},
  {&__pyx_n_s_tol_bnd, __pyx_k_tol_bnd, sizeof(__pyx_k_tol_bnd), 0, 0, 1, 1},
  {&__pyx_n_s_tol_dj, __pyx_k_tol_dj, sizeof(__pyx_k_tol_dj), 0, 0, 1, 1},
  {&__pyx_n_s_tol_int, __pyx_k_tol_int, sizeof(__pyx_k_tol_int), 0, 0, 1, 1},
  {&__pyx_n_s_tol_piv, __pyx_k_tol_piv, sizeof(__pyx_k_tol_piv), 0, 0, 1, 1},
  {&__pyx_n_s_tolerance_feasibility, __pyx_k_tolerance_feasibility, sizeof(__pyx_k_tolerance_feasibility), 0, 0, 1, 1},
  {&__pyx_n_s_tolerance_integer, __pyx_k_tolerance_integer, sizeof(__pyx_k_tolerance_integer), 0, 0, 1, 1},
  {&__pyx_n_s_tolerance_markowitz, __pyx_k_tolerance_markowitz, sizeof(__pyx_k_tolerance_markowitz), 0, 0, 1, 1},
  {&__pyx_n_s_unbounded, __pyx_k_unbounded, sizeof(__pyx_k_unbounded), 0, 0, 1, 1},
  {&__pyx_n_s_undefined, __pyx_k_undefined, sizeof(__pyx_k_undefined), 0, 0, 1, 1},
  {&__pyx_kp_s_unknown_parameter, __pyx_k_unknown_parameter, sizeof(__pyx_k_unknown_parameter), 0, 0, 1, 0},
  {&__pyx_n_s_unlink, __pyx_k_unlink, sizeof(__pyx_k_unlink), 0, 0, 1, 1},
  {&__pyx_n_s_unlink_2, __pyx_k_unlink_2, sizeof(__pyx_k_unlink_2), 0, 0, 1, 1},
  {&__pyx_kp_s_unsupported_bound_type_s, __pyx_k_unsupported_bound_type_s, sizeof(__pyx_k_unsupported_bound_type_s), 0, 0, 1, 0},
  {&__pyx_n_s_upper_bound, __pyx_k_upper_bound, sizeof(__pyx_k_upper_bound), 0, 0, 1, 1},
  {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
  {&__pyx_n_s_variable_kind, __pyx_k_variable_kind, sizeof(__pyx_k_variable_kind), 0, 0, 1, 1},
  {&__pyx_n_s_verbose, __pyx_k_verbose, sizeof(__pyx_k_verbose), 0, 0, 1, 1},
  {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1},
  {&__pyx_n_s_warn, __pyx_k_warn, sizeof(__pyx_k_warn), 0, 0, 1, 1},
  {&__pyx_n_s_warn_2, __pyx_k_warn_2, sizeof(__pyx_k_warn_2), 0, 0, 1, 1},
  {&__pyx_n_s_warnings, __pyx_k_warnings, sizeof(__pyx_k_warnings), 0, 0, 1, 1},
  {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1},
  {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
  {&__pyx_n_s_x_dict, __pyx_k_x_dict, sizeof(__pyx_k_x_dict), 0, 0, 1, 1},
  {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1},
  {&__pyx_n_s_y_dict, __pyx_k_y_dict, sizeof(__pyx_k_y_dict), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_n_s_open); if (!__pyx_builtin_open) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_IOError = __Pyx_GetBuiltinName(__pyx_n_s_IOError); if (!__pyx_builtin_IOError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __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);

  /* "cobra/solvers/cglpk.pyx":391
 *             self.exact = value
 *         elif parameter_name == "threads":
 *             _warn("multiple threads not supported")             # <<<<<<<<<<<<<<
 *         elif parameter_name == "MIP_gap_abs":
 *             _warn("setting aboslute mip gap not supported")
 */
  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_multiple_threads_not_supported); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple_);
  __Pyx_GIVEREF(__pyx_tuple_);

  /* "cobra/solvers/cglpk.pyx":393
 *             _warn("multiple threads not supported")
 *         elif parameter_name == "MIP_gap_abs":
 *             _warn("setting aboslute mip gap not supported")             # <<<<<<<<<<<<<<
 *         elif parameter_name == "presolve":
 *             self.parameters.presolve = GLP_ON if value else GLP_OFF
 */
  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_setting_aboslute_mip_gap_not_sup); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__2);
  __Pyx_GIVEREF(__pyx_tuple__2);

  /* "cobra/solvers/cglpk.pyx":410
 *         elif parameter_name == "quadratic_component":
 *             if value is not None:
 *                 raise ValueError("quadratic component must be None for glpk")             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError("unknown parameter " + str(parameter_name))
 */
  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_quadratic_component_must_be_None); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__3);
  __Pyx_GIVEREF(__pyx_tuple__3);

  /* "cobra/solvers/cglpk.pyx":432
 *         status = self.get_status()
 *         if status != "optimal":  # todo handle other possible
 *             return Solution(None, status=status)             # <<<<<<<<<<<<<<
 *         solution = Solution(self.get_objective_value(), status=status)
 *         m = glp_get_num_rows(glp)
 */
  __pyx_tuple__4 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__4);
  __Pyx_GIVEREF(__pyx_tuple__4);

  /* "cobra/solvers/cglpk.pyx":466
 *         result = glp_write_prob(self.glp, 0, name)
 *         assert result == 0
 *         with open(name, "r") as infile:             # <<<<<<<<<<<<<<
 *             state = infile.read()
 *         _unlink(name)
 */
  __pyx_tuple__5 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__5);
  __Pyx_GIVEREF(__pyx_tuple__5);

  /* "cobra/solvers/cglpk.pyx":477
 *         cdef int result
 *         cdef char *name = NULL
 *         with _NamedTemporaryFile(mode="w", delete=False) as tempfile:             # <<<<<<<<<<<<<<
 *             name = tempfile.name
 *             tempfile.write(state)
 */
  __pyx_tuple__6 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__6);
  __Pyx_GIVEREF(__pyx_tuple__6);

  /* "cobra/solvers/cglpk.pyx":504
 *             b_name = bytes(filename, "latin-1")
 *         else:
 *             raise RuntimeError("Unknown python version")             # <<<<<<<<<<<<<<
 *         cdef char *c_name = <bytes> b_name
 *         cdef int res
 */
  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_Unknown_python_version); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__7);
  __Pyx_GIVEREF(__pyx_tuple__7);

  /* "cobra/solvers/cglpk.pyx":524
 * # wrappers for all the functions at the module level
 * create_problem = GLP.create_problem
 * def set_objective_sense(lp, objective_sense="maximize"):             # <<<<<<<<<<<<<<
 *     return lp.set_objective_sense(lp, objective_sense=objective_sense)
 * cpdef change_variable_bounds(lp, int index,
 */
  __pyx_tuple__8 = PyTuple_Pack(2, __pyx_n_s_lp_2, __pyx_n_s_objective_sense); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__8);
  __Pyx_GIVEREF(__pyx_tuple__8);
  __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_aebrahim_cobrapy_cobra_sol, __pyx_n_s_set_objective_sense, 524, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "cobra/solvers/cglpk.pyx":535
 * cpdef set_parameter(lp, parameter_name, value):
 *     return lp.set_parameter(parameter_name, value)
 * def solve_problem(lp, **kwargs):             # <<<<<<<<<<<<<<
 *     return lp.solve_problem(**kwargs)
 * cpdef get_status(lp):
 */
  __pyx_tuple__10 = PyTuple_Pack(2, __pyx_n_s_lp_2, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__10);
  __Pyx_GIVEREF(__pyx_tuple__10);
  __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_aebrahim_cobrapy_cobra_sol, __pyx_n_s_solve_problem, 535, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_InitGlobals(void) {
  __pyx_umethod_PyDict_Type_items.type = (PyObject*)&PyDict_Type;
  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_1000 = PyInt_FromLong(1000); if (unlikely(!__pyx_int_1000)) {__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 initcglpk(void); /*proto*/
PyMODINIT_FUNC initcglpk(void)
#else
PyMODINIT_FUNC PyInit_cglpk(void); /*proto*/
PyMODINIT_FUNC PyInit_cglpk(void)
#endif
{
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  #if CYTHON_REFNANNY
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
  if (!__Pyx_RefNanny) {
      PyErr_Clear();
      __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
      if (!__Pyx_RefNanny)
          Py_FatalError("failed to import 'refnanny' module");
  }
  #endif
  __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_cglpk(void)", 0);
  if (__Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #ifdef __Pyx_CyFunction_USED
  if (__pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  #ifdef __Pyx_Coroutine_USED
  if (__pyx_Coroutine_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  #ifdef __Pyx_StopAsyncIteration_USED
  if (__pyx_StopAsyncIteration_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  /*--- Library function declarations ---*/
  /*--- Threads initialization code ---*/
  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  #ifdef WITH_THREAD /* Python build with threading support? */
  PyEval_InitThreads();
  #endif
  #endif
  /*--- Module creation code ---*/
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4("cglpk", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_INCREF(__pyx_d);
  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #if CYTHON_COMPILING_IN_PYPY
  Py_INCREF(__pyx_b);
  #endif
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  /*--- Initialize various global constants etc. ---*/
  if (__Pyx_InitGlobals() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
  if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  if (__pyx_module_is_main_cobra__solvers__cglpk) {
    if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  #if PY_MAJOR_VERSION >= 3
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (!PyDict_GetItemString(modules, "cobra.solvers.cglpk")) {
      if (unlikely(PyDict_SetItemString(modules, "cobra.solvers.cglpk", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif
  /*--- Builtin init code ---*/
  if (__Pyx_InitCachedBuiltins() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Constants init code ---*/
  if (__Pyx_InitCachedConstants() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Global init code ---*/
  __pyx_v_5cobra_7solvers_5cglpk_ERROR_CODES = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_5cobra_7solvers_5cglpk_ERROR_MESSAGES = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_5cobra_7solvers_5cglpk_METHODS = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_5cobra_7solvers_5cglpk_PRICINGS = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_5cobra_7solvers_5cglpk_RATIOS = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_5cobra_7solvers_5cglpk_SCALINGS = ((PyObject*)Py_None); Py_INCREF(Py_None);
  /*--- Variable export code ---*/
  /*--- Function export code ---*/
  /*--- Type init code ---*/
  __pyx_vtabptr_5cobra_7solvers_5cglpk_GLP = &__pyx_vtable_5cobra_7solvers_5cglpk_GLP;
  __pyx_vtable_5cobra_7solvers_5cglpk_GLP.change_variable_bounds = (PyObject *(*)(struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *, int, double, double, int __pyx_skip_dispatch))__pyx_f_5cobra_7solvers_5cglpk_3GLP_change_variable_bounds;
  __pyx_vtable_5cobra_7solvers_5cglpk_GLP.set_objective_sense = (PyObject *(*)(struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5cobra_7solvers_5cglpk_3GLP_set_objective_sense;
  __pyx_vtable_5cobra_7solvers_5cglpk_GLP.set_parameter = (PyObject *(*)(struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5cobra_7solvers_5cglpk_3GLP_set_parameter;
  __pyx_vtable_5cobra_7solvers_5cglpk_GLP.get_objective_value = (PyObject *(*)(struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *, int __pyx_skip_dispatch))__pyx_f_5cobra_7solvers_5cglpk_3GLP_get_objective_value;
  __pyx_vtable_5cobra_7solvers_5cglpk_GLP.change_variable_objective = (PyObject *(*)(struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *, int, double, int __pyx_skip_dispatch))__pyx_f_5cobra_7solvers_5cglpk_3GLP_change_variable_objective;
  __pyx_vtable_5cobra_7solvers_5cglpk_GLP.is_mip = (PyObject *(*)(struct __pyx_obj_5cobra_7solvers_5cglpk_GLP *, int __pyx_skip_dispatch))__pyx_f_5cobra_7solvers_5cglpk_3GLP_is_mip;
  if (PyType_Ready(&__pyx_type_5cobra_7solvers_5cglpk_GLP) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_5cobra_7solvers_5cglpk_GLP.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_5cobra_7solvers_5cglpk_GLP.tp_dict, __pyx_vtabptr_5cobra_7solvers_5cglpk_GLP) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyObject_SetAttrString(__pyx_m, "GLP", (PyObject *)&__pyx_type_5cobra_7solvers_5cglpk_GLP) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5cobra_7solvers_5cglpk_GLP = &__pyx_type_5cobra_7solvers_5cglpk_GLP;
  /*--- 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[1]; __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[2]; __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[3]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Variable import code ---*/
  /*--- Function import code ---*/
  /*--- Execution code ---*/
  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
  if (__Pyx_patch_abc() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif

  /* "cobra/solvers/cglpk.pyx":9
 * from cpython.version cimport PY_MAJOR_VERSION
 * 
 * from tempfile import NamedTemporaryFile as _NamedTemporaryFile  # for pickling             # <<<<<<<<<<<<<<
 * from os import unlink as _unlink
 * from warnings import warn as _warn
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_NamedTemporaryFile_2);
  __Pyx_GIVEREF(__pyx_n_s_NamedTemporaryFile_2);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_NamedTemporaryFile_2);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_tempfile, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_NamedTemporaryFile_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NamedTemporaryFile, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __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;

  /* "cobra/solvers/cglpk.pyx":10
 * 
 * from tempfile import NamedTemporaryFile as _NamedTemporaryFile  # for pickling
 * from os import unlink as _unlink             # <<<<<<<<<<<<<<
 * from warnings import warn as _warn
 * 
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_unlink_2);
  __Pyx_GIVEREF(__pyx_n_s_unlink_2);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_unlink_2);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_os, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_unlink_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_unlink, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __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;

  /* "cobra/solvers/cglpk.pyx":11
 * from tempfile import NamedTemporaryFile as _NamedTemporaryFile  # for pickling
 * from os import unlink as _unlink
 * from warnings import warn as _warn             # <<<<<<<<<<<<<<
 * 
 * try:
 */
  __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(__pyx_n_s_warn_2);
  __Pyx_GIVEREF(__pyx_n_s_warn_2);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_warn_2);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_warnings, __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(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_warn_2); 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 (PyDict_SetItem(__pyx_d, __pyx_n_s_warn, __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;

  /* "cobra/solvers/cglpk.pyx":13
 * from warnings import warn as _warn
 * 
 * try:             # <<<<<<<<<<<<<<
 *     from sympy import Basic, Number
 * except:
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "cobra/solvers/cglpk.pyx":14
 * 
 * try:
 *     from sympy import Basic, Number             # <<<<<<<<<<<<<<
 * except:
 *     class Basic:
 */
      __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L2_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_n_s_Basic);
      __Pyx_GIVEREF(__pyx_n_s_Basic);
      PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Basic);
      __Pyx_INCREF(__pyx_n_s_Number);
      __Pyx_GIVEREF(__pyx_n_s_Number);
      PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_Number);
      __pyx_t_1 = __Pyx_Import(__pyx_n_s_sympy, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L2_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_Basic); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L2_error;}
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_Basic, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L2_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_Number); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L2_error;}
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_Number, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L2_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "cobra/solvers/cglpk.pyx":13
 * from warnings import warn as _warn
 * 
 * try:             # <<<<<<<<<<<<<<
 *     from sympy import Basic, Number
 * except:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L9_try_end;
    __pyx_L2_error:;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cobra/solvers/cglpk.pyx":15
 * try:
 *     from sympy import Basic, Number
 * except:             # <<<<<<<<<<<<<<
 *     class Basic:
 *         pass
 */
    /*except:*/ {
      __Pyx_AddTraceback("cobra.solvers.cglpk", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L4_except_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_t_6);

      /* "cobra/solvers/cglpk.pyx":16
 *     from sympy import Basic, Number
 * except:
 *     class Basic:             # <<<<<<<<<<<<<<
 *         pass
 *     Number = Basic
 */
      __pyx_t_7 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_Basic, __pyx_n_s_Basic, (PyObject *) NULL, __pyx_n_s_cobra_solvers_cglpk, (PyObject *) NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L4_except_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_Basic, __pyx_empty_tuple, __pyx_t_7, NULL, 0, 1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L4_except_error;}
      __Pyx_GOTREF(__pyx_t_8);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_Basic, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L4_except_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "cobra/solvers/cglpk.pyx":18
 *     class Basic:
 *         pass
 *     Number = Basic             # <<<<<<<<<<<<<<
 * 
 * __glpk_version__ = str(glp_version())
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_Basic); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L4_except_error;}
      __Pyx_GOTREF(__pyx_t_7);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_Number, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L4_except_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L3_exception_handled;
    }
    __pyx_L4_except_error:;

    /* "cobra/solvers/cglpk.pyx":13
 * from warnings import warn as _warn
 * 
 * try:             # <<<<<<<<<<<<<<
 *     from sympy import Basic, Number
 * except:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L3_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    __pyx_L9_try_end:;
  }

  /* "cobra/solvers/cglpk.pyx":20
 *     Number = Basic
 * 
 * __glpk_version__ = str(glp_version())             # <<<<<<<<<<<<<<
 * _SUPPORTS_MILP = True
 * solver_name = "cglpk"
 */
  __pyx_t_6 = __Pyx_PyBytes_FromString(glp_version()); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_glpk_version, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cobra/solvers/cglpk.pyx":21
 * 
 * __glpk_version__ = str(glp_version())
 * _SUPPORTS_MILP = True             # <<<<<<<<<<<<<<
 * solver_name = "cglpk"
 * 
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SUPPORTS_MILP, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "cobra/solvers/cglpk.pyx":22
 * __glpk_version__ = str(glp_version())
 * _SUPPORTS_MILP = True
 * solver_name = "cglpk"             # <<<<<<<<<<<<<<
 * 
 * __doc__ = """Bindings to GLPK
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_solver_name, __pyx_n_s_cglpk) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "cobra/solvers/cglpk.pyx":24
 * solver_name = "cglpk"
 * 
 * __doc__ = """Bindings to GLPK             # <<<<<<<<<<<<<<
 * 
 * The GNU Linear Programming Kit (GLPK) is released under the GPL.
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_doc, __pyx_kp_s_Bindings_to_GLPK_The_GNU_Linear) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "cobra/solvers/cglpk.pyx":35
 * 
 * cdef dict ERROR_CODES = {
 *     GLP_EBADB: "GLP_EBADB",             # <<<<<<<<<<<<<<
 *     GLP_ESING: "GLP_ESING",
 *     GLP_ECOND: "GLP_ECOND",
 */
  __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_PyInt_From_int(GLP_EBADB); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_6, __pyx_t_2, __pyx_n_s_GLP_EBADB) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cobra/solvers/cglpk.pyx":36
 * cdef dict ERROR_CODES = {
 *     GLP_EBADB: "GLP_EBADB",
 *     GLP_ESING: "GLP_ESING",             # <<<<<<<<<<<<<<
 *     GLP_ECOND: "GLP_ECOND",
 *     GLP_EBOUND: "GLP_EBOUND",
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(GLP_ESING); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_6, __pyx_t_2, __pyx_n_s_GLP_ESING) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cobra/solvers/cglpk.pyx":37
 *     GLP_EBADB: "GLP_EBADB",
 *     GLP_ESING: "GLP_ESING",
 *     GLP_ECOND: "GLP_ECOND",             # <<<<<<<<<<<<<<
 *     GLP_EBOUND: "GLP_EBOUND",
 *     GLP_EFAIL: "GLP_EFAIL",
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(GLP_ECOND); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_6, __pyx_t_2, __pyx_n_s_GLP_ECOND) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cobra/solvers/cglpk.pyx":38
 *     GLP_ESING: "GLP_ESING",
 *     GLP_ECOND: "GLP_ECOND",
 *     GLP_EBOUND: "GLP_EBOUND",             # <<<<<<<<<<<<<<
 *     GLP_EFAIL: "GLP_EFAIL",
 *     GLP_EOBJLL: "GLP_EOBJLL",
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(GLP_EBOUND); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_6, __pyx_t_2, __pyx_n_s_GLP_EBOUND) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cobra/solvers/cglpk.pyx":39
 *     GLP_ECOND: "GLP_ECOND",
 *     GLP_EBOUND: "GLP_EBOUND",
 *     GLP_EFAIL: "GLP_EFAIL",             # <<<<<<<<<<<<<<
 *     GLP_EOBJLL: "GLP_EOBJLL",
 *     GLP_EOBJUL: "GLP_EOBJUL",
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(GLP_EFAIL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_6, __pyx_t_2, __pyx_n_s_GLP_EFAIL) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cobra/solvers/cglpk.pyx":40
 *     GLP_EBOUND: "GLP_EBOUND",
 *     GLP_EFAIL: "GLP_EFAIL",
 *     GLP_EOBJLL: "GLP_EOBJLL",             # <<<<<<<<<<<<<<
 *     GLP_EOBJUL: "GLP_EOBJUL",
 *     GLP_EITLIM: "GLP_EITLIM",
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(GLP_EOBJLL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_6, __pyx_t_2, __pyx_n_s_GLP_EOBJLL) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cobra/solvers/cglpk.pyx":41
 *     GLP_EFAIL: "GLP_EFAIL",
 *     GLP_EOBJLL: "GLP_EOBJLL",
 *     GLP_EOBJUL: "GLP_EOBJUL",             # <<<<<<<<<<<<<<
 *     GLP_EITLIM: "GLP_EITLIM",
 *     GLP_ETMLIM: "GLP_ETMLIM",
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(GLP_EOBJUL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_6, __pyx_t_2, __pyx_n_s_GLP_EOBJUL) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cobra/solvers/cglpk.pyx":42
 *     GLP_EOBJLL: "GLP_EOBJLL",
 *     GLP_EOBJUL: "GLP_EOBJUL",
 *     GLP_EITLIM: "GLP_EITLIM",             # <<<<<<<<<<<<<<
 *     GLP_ETMLIM: "GLP_ETMLIM",
 *     GLP_ENOPFS: "GLP_ENOPFS",
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(GLP_EITLIM); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_6, __pyx_t_2, __pyx_n_s_GLP_EITLIM) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cobra/solvers/cglpk.pyx":43
 *     GLP_EOBJUL: "GLP_EOBJUL",
 *     GLP_EITLIM: "GLP_EITLIM",
 *     GLP_ETMLIM: "GLP_ETMLIM",             # <<<<<<<<<<<<<<
 *     GLP_ENOPFS: "GLP_ENOPFS",
 *     GLP_ENODFS: "GLP_ENODFS",
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(GLP_ETMLIM); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_6, __pyx_t_2, __pyx_n_s_GLP_ETMLIM) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cobra/solvers/cglpk.pyx":44
 *     GLP_EITLIM: "GLP_EITLIM",
 *     GLP_ETMLIM: "GLP_ETMLIM",
 *     GLP_ENOPFS: "GLP_ENOPFS",             # <<<<<<<<<<<<<<
 *     GLP_ENODFS: "GLP_ENODFS",
 *     GLP_EROOT: "GLP_EROOT",
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(GLP_ENOPFS); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_6, __pyx_t_2, __pyx_n_s_GLP_ENOPFS) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cobra/solvers/cglpk.pyx":45
 *     GLP_ETMLIM: "GLP_ETMLIM",
 *     GLP_ENOPFS: "GLP_ENOPFS",
 *     GLP_ENODFS: "GLP_ENODFS",             # <<<<<<<<<<<<<<
 *     GLP_EROOT: "GLP_EROOT",
 *     GLP_ESTOP: "GLP_ESTOP",
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(GLP_ENODFS); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_6, __pyx_t_2, __pyx_n_s_GLP_ENODFS) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cobra/solvers/cglpk.pyx":46
 *     GLP_ENOPFS: "GLP_ENOPFS",
 *     GLP_ENODFS: "GLP_ENODFS",
 *     GLP_EROOT: "GLP_EROOT",             # <<<<<<<<<<<<<<
 *     GLP_ESTOP: "GLP_ESTOP",
 *     GLP_EMIPGAP: "GLP_EMIPGAP",
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(GLP_EROOT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_6, __pyx_t_2, __pyx_n_s_GLP_EROOT) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cobra/solvers/cglpk.pyx":47
 *     GLP_ENODFS: "GLP_ENODFS",
 *     GLP_EROOT: "GLP_EROOT",
 *     GLP_ESTOP: "GLP_ESTOP",             # <<<<<<<<<<<<<<
 *     GLP_EMIPGAP: "GLP_EMIPGAP",
 *     GLP_ENOFEAS: "GLP_ENOFEAS",
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(GLP_ESTOP); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_6, __pyx_t_2, __pyx_n_s_GLP_ESTOP) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cobra/solvers/cglpk.pyx":48
 *     GLP_EROOT: "GLP_EROOT",
 *     GLP_ESTOP: "GLP_ESTOP",
 *     GLP_EMIPGAP: "GLP_EMIPGAP",             # <<<<<<<<<<<<<<
 *     GLP_ENOFEAS: "GLP_ENOFEAS",
 *     GLP_ENOCVG: "GLP_ENOCVG",
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(GLP_EMIPGAP); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_6, __pyx_t_2, __pyx_n_s_GLP_EMIPGAP) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cobra/solvers/cglpk.pyx":49
 *     GLP_ESTOP: "GLP_ESTOP",
 *     GLP_EMIPGAP: "GLP_EMIPGAP",
 *     GLP_ENOFEAS: "GLP_ENOFEAS",             # <<<<<<<<<<<<<<
 *     GLP_ENOCVG: "GLP_ENOCVG",
 *     GLP_EINSTAB: "GLP_EINSTAB",
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(GLP_ENOFEAS); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_6, __pyx_t_2, __pyx_n_s_GLP_ENOFEAS) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cobra/solvers/cglpk.pyx":50
 *     GLP_EMIPGAP: "GLP_EMIPGAP",
 *     GLP_ENOFEAS: "GLP_ENOFEAS",
 *     GLP_ENOCVG: "GLP_ENOCVG",             # <<<<<<<<<<<<<<
 *     GLP_EINSTAB: "GLP_EINSTAB",
 *     GLP_EDATA: "GLP_EDATA",
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(GLP_ENOCVG); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_6, __pyx_t_2, __pyx_n_s_GLP_ENOCVG) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cobra/solvers/cglpk.pyx":51
 *     GLP_ENOFEAS: "GLP_ENOFEAS",
 *     GLP_ENOCVG: "GLP_ENOCVG",
 *     GLP_EINSTAB: "GLP_EINSTAB",             # <<<<<<<<<<<<<<
 *     GLP_EDATA: "GLP_EDATA",
 *     GLP_ERANGE: "GLP_ERANGE"
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(GLP_EINSTAB); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_6, __pyx_t_2, __pyx_n_s_GLP_EINSTAB) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cobra/solvers/cglpk.pyx":52
 *     GLP_ENOCVG: "GLP_ENOCVG",
 *     GLP_EINSTAB: "GLP_EINSTAB",
 *     GLP_EDATA: "GLP_EDATA",             # <<<<<<<<<<<<<<
 *     GLP_ERANGE: "GLP_ERANGE"
 * }
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(GLP_EDATA); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_6, __pyx_t_2, __pyx_n_s_GLP_EDATA) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cobra/solvers/cglpk.pyx":53
 *     GLP_EINSTAB: "GLP_EINSTAB",
 *     GLP_EDATA: "GLP_EDATA",
 *     GLP_ERANGE: "GLP_ERANGE"             # <<<<<<<<<<<<<<
 * }
 * 
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(GLP_ERANGE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_6, __pyx_t_2, __pyx_n_s_GLP_ERANGE) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_XGOTREF(__pyx_v_5cobra_7solvers_5cglpk_ERROR_CODES);
  __Pyx_DECREF_SET(__pyx_v_5cobra_7solvers_5cglpk_ERROR_CODES, ((PyObject*)__pyx_t_6));
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "cobra/solvers/cglpk.pyx":57
 * 
 * cdef dict ERROR_MESSAGES = {
 *     GLP_EBADB: "invalid basis",             # <<<<<<<<<<<<<<
 *     GLP_ESING: "singular matrix",
 *     GLP_ECOND: "ill-conditioned matrix",
 */
  __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_PyInt_From_int(GLP_EBADB); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_6, __pyx_t_2, __pyx_kp_s_invalid_basis) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cobra/solvers/cglpk.pyx":58
 * cdef dict ERROR_MESSAGES = {
 *     GLP_EBADB: "invalid basis",
 *     GLP_ESING: "singular matrix",             # <<<<<<<<<<<<<<
 *     GLP_ECOND: "ill-conditioned matrix",
 *     GLP_EBOUND: "invalid bounds",
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(GLP_ESING); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_6, __pyx_t_2, __pyx_kp_s_singular_matrix) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cobra/solvers/cglpk.pyx":59
 *     GLP_EBADB: "invalid basis",
 *     GLP_ESING: "singular matrix",
 *     GLP_ECOND: "ill-conditioned matrix",             # <<<<<<<<<<<<<<
 *     GLP_EBOUND: "invalid bounds",
 *     GLP_EFAIL: "solver failed",
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(GLP_ECOND); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_6, __pyx_t_2, __pyx_kp_s_ill_conditioned_matrix) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cobra/solvers/cglpk.pyx":60
 *     GLP_ESING: "singular matrix",
 *     GLP_ECOND: "ill-conditioned matrix",
 *     GLP_EBOUND: "invalid bounds",             # <<<<<<<<<<<<<<
 *     GLP_EFAIL: "solver failed",
 *     GLP_EOBJLL: "objective lower limit reached",
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(GLP_EBOUND); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_6, __pyx_t_2, __pyx_kp_s_invalid_bounds) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cobra/solvers/cglpk.pyx":61
 *     GLP_ECOND: "ill-conditioned matrix",
 *     GLP_EBOUND: "invalid bounds",
 *     GLP_EFAIL: "solver failed",             # <<<<<<<<<<<<<<
 *     GLP_EOBJLL: "objective lower limit reached",
 *     GLP_EOBJUL: "objective upper limit reached",
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(GLP_EFAIL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_6, __pyx_t_2, __pyx_kp_s_solver_failed) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cobra/solvers/cglpk.pyx":62
 *     GLP_EBOUND: "invalid bounds",
 *     GLP_EFAIL: "solver failed",
 *     GLP_EOBJLL: "objective lower limit reached",             # <<<<<<<<<<<<<<
 *     GLP_EOBJUL: "objective upper limit reached",
 *     GLP_EITLIM: "iteration limit exceeded",
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(GLP_EOBJLL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_6, __pyx_t_2, __pyx_kp_s_objective_lower_limit_reached) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cobra/solvers/cglpk.pyx":63
 *     GLP_EFAIL: "solver failed",
 *     GLP_EOBJLL: "objective lower limit reached",
 *     GLP_EOBJUL: "objective upper limit reached",             # <<<<<<<<<<<<<<
 *     GLP_EITLIM: "iteration limit exceeded",
 *     GLP_ETMLIM: "time limit exceeded",
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(GLP_EOBJUL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_6, __pyx_t_2, __pyx_kp_s_objective_upper_limit_reached) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cobra/solvers/cglpk.pyx":64
 *     GLP_EOBJLL: "objective lower limit reached",
 *     GLP_EOBJUL: "objective upper limit reached",
 *     GLP_EITLIM: "iteration limit exceeded",             # <<<<<<<<<<<<<<
 *     GLP_ETMLIM: "time limit exceeded",
 *     GLP_ENOPFS: "no primal feasible solution",
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(GLP_EITLIM); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_6, __pyx_t_2, __pyx_kp_s_iteration_limit_exceeded) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cobra/solvers/cglpk.pyx":65
 *     GLP_EOBJUL: "objective upper limit reached",
 *     GLP_EITLIM: "iteration limit exceeded",
 *     GLP_ETMLIM: "time limit exceeded",             # <<<<<<<<<<<<<<
 *     GLP_ENOPFS: "no primal feasible solution",
 *     GLP_ENODFS: "no dual feasible solution",
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(GLP_ETMLIM); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_6, __pyx_t_2, __pyx_kp_s_time_limit_exceeded) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cobra/solvers/cglpk.pyx":66
 *     GLP_EITLIM: "iteration limit exceeded",
 *     GLP_ETMLIM: "time limit exceeded",
 *     GLP_ENOPFS: "no primal feasible solution",             # <<<<<<<<<<<<<<
 *     GLP_ENODFS: "no dual feasible solution",
 *     GLP_EROOT: "root LP optimum not provided",
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(GLP_ENOPFS); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_6, __pyx_t_2, __pyx_kp_s_no_primal_feasible_solution) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cobra/solvers/cglpk.pyx":67
 *     GLP_ETMLIM: "time limit exceeded",
 *     GLP_ENOPFS: "no primal feasible solution",
 *     GLP_ENODFS: "no dual feasible solution",             # <<<<<<<<<<<<<<
 *     GLP_EROOT: "root LP optimum not provided",
 *     GLP_ESTOP: "search terminated by application",
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(GLP_ENODFS); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_6, __pyx_t_2, __pyx_kp_s_no_dual_feasible_solution) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cobra/solvers/cglpk.pyx":68
 *     GLP_ENOPFS: "no primal feasible solution",
 *     GLP_ENODFS: "no dual feasible solution",
 *     GLP_EROOT: "root LP optimum not provided",             # <<<<<<<<<<<<<<
 *     GLP_ESTOP: "search terminated by application",
 *     GLP_EMIPGAP: "relative mip gap tolerance reached",
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(GLP_EROOT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_6, __pyx_t_2, __pyx_kp_s_root_LP_optimum_not_provided) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cobra/solvers/cglpk.pyx":69
 *     GLP_ENODFS: "no dual feasible solution",
 *     GLP_EROOT: "root LP optimum not provided",
 *     GLP_ESTOP: "search terminated by application",             # <<<<<<<<<<<<<<
 *     GLP_EMIPGAP: "relative mip gap tolerance reached",
 *     GLP_ENOFEAS: "no primal/dual feasible solution",
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(GLP_ESTOP); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_6, __pyx_t_2, __pyx_kp_s_search_terminated_by_application) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cobra/solvers/cglpk.pyx":70
 *     GLP_EROOT: "root LP optimum not provided",
 *     GLP_ESTOP: "search terminated by application",
 *     GLP_EMIPGAP: "relative mip gap tolerance reached",             # <<<<<<<<<<<<<<
 *     GLP_ENOFEAS: "no primal/dual feasible solution",
 *     GLP_ENOCVG: "no convergence",
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(GLP_EMIPGAP); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_6, __pyx_t_2, __pyx_kp_s_relative_mip_gap_tolerance_reach) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cobra/solvers/cglpk.pyx":71
 *     GLP_ESTOP: "search terminated by application",
 *     GLP_EMIPGAP: "relative mip gap tolerance reached",
 *     GLP_ENOFEAS: "no primal/dual feasible solution",             # <<<<<<<<<<<<<<
 *     GLP_ENOCVG: "no convergence",
 *     GLP_EINSTAB: "numerical instability",
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(GLP_ENOFEAS); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_6, __pyx_t_2, __pyx_kp_s_no_primal_dual_feasible_solution) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cobra/solvers/cglpk.pyx":72
 *     GLP_EMIPGAP: "relative mip gap tolerance reached",
 *     GLP_ENOFEAS: "no primal/dual feasible solution",
 *     GLP_ENOCVG: "no convergence",             # <<<<<<<<<<<<<<
 *     GLP_EINSTAB: "numerical instability",
 *     GLP_EDATA: "invalid data",
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(GLP_ENOCVG); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_6, __pyx_t_2, __pyx_kp_s_no_convergence) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cobra/solvers/cglpk.pyx":73
 *     GLP_ENOFEAS: "no primal/dual feasible solution",
 *     GLP_ENOCVG: "no convergence",
 *     GLP_EINSTAB: "numerical instability",             # <<<<<<<<<<<<<<
 *     GLP_EDATA: "invalid data",
 *     GLP_ERANGE: "result out of range"
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(GLP_EINSTAB); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_6, __pyx_t_2, __pyx_kp_s_numerical_instability) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cobra/solvers/cglpk.pyx":74
 *     GLP_ENOCVG: "no convergence",
 *     GLP_EINSTAB: "numerical instability",
 *     GLP_EDATA: "invalid data",             # <<<<<<<<<<<<<<
 *     GLP_ERANGE: "result out of range"
 * }
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(GLP_EDATA); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_6, __pyx_t_2, __pyx_kp_s_invalid_data) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cobra/solvers/cglpk.pyx":75
 *     GLP_EINSTAB: "numerical instability",
 *     GLP_EDATA: "invalid data",
 *     GLP_ERANGE: "result out of range"             # <<<<<<<<<<<<<<
 * }
 * 
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(GLP_ERANGE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_6, __pyx_t_2, __pyx_kp_s_result_out_of_range) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_XGOTREF(__pyx_v_5cobra_7solvers_5cglpk_ERROR_MESSAGES);
  __Pyx_DECREF_SET(__pyx_v_5cobra_7solvers_5cglpk_ERROR_MESSAGES, ((PyObject*)__pyx_t_6));
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "cobra/solvers/cglpk.pyx":79
 * 
 * cdef dict METHODS = {
 *     "auto": GLP_DUALP,             # <<<<<<<<<<<<<<
 *     "primal": GLP_PRIMAL,
 *     "dual": GLP_DUAL
 */
  __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_PyInt_From_int(GLP_DUALP); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_auto, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cobra/solvers/cglpk.pyx":80
 * cdef dict METHODS = {
 *     "auto": GLP_DUALP,
 *     "primal": GLP_PRIMAL,             # <<<<<<<<<<<<<<
 *     "dual": GLP_DUAL
 * }
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(GLP_PRIMAL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_primal, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cobra/solvers/cglpk.pyx":82
 *     "primal": GLP_PRIMAL,
 *     "dual": GLP_DUAL
 * }             # <<<<<<<<<<<<<<
 * 
 * cdef dict PRICINGS = {
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(GLP_DUAL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dual, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_XGOTREF(__pyx_v_5cobra_7solvers_5cglpk_METHODS);
  __Pyx_DECREF_SET(__pyx_v_5cobra_7solvers_5cglpk_METHODS, ((PyObject*)__pyx_t_6));
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "cobra/solvers/cglpk.pyx":85
 * 
 * cdef dict PRICINGS = {
 *     "std": GLP_PT_STD,             # <<<<<<<<<<<<<<
 *     "pse": GLP_PT_PSE
 * }
 */
  __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_PyInt_From_int(GLP_PT_STD); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_std, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cobra/solvers/cglpk.pyx":87
 *     "std": GLP_PT_STD,
 *     "pse": GLP_PT_PSE
 * }             # <<<<<<<<<<<<<<
 * 
 * cdef dict RATIOS = {
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(GLP_PT_PSE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_pse, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_XGOTREF(__pyx_v_5cobra_7solvers_5cglpk_PRICINGS);
  __Pyx_DECREF_SET(__pyx_v_5cobra_7solvers_5cglpk_PRICINGS, ((PyObject*)__pyx_t_6));
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "cobra/solvers/cglpk.pyx":90
 * 
 * cdef dict RATIOS = {
 *     "std": GLP_RT_STD,             # <<<<<<<<<<<<<<
 *     "har": GLP_RT_HAR
 * }
 */
  __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_PyInt_From_int(GLP_RT_STD); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_std, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cobra/solvers/cglpk.pyx":92
 *     "std": GLP_RT_STD,
 *     "har": GLP_RT_HAR
 * }             # <<<<<<<<<<<<<<
 * 
 * cdef dict SCALINGS = {
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(GLP_RT_HAR); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_har, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_XGOTREF(__pyx_v_5cobra_7solvers_5cglpk_RATIOS);
  __Pyx_DECREF_SET(__pyx_v_5cobra_7solvers_5cglpk_RATIOS, ((PyObject*)__pyx_t_6));
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "cobra/solvers/cglpk.pyx":95
 * 
 * cdef dict SCALINGS = {
 *     "auto": GLP_SF_AUTO,             # <<<<<<<<<<<<<<
 *     "gm": GLP_SF_GM,
 *     "eq": GLP_SF_EQ,
 */
  __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_PyInt_From_int(GLP_SF_AUTO); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_auto, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cobra/solvers/cglpk.pyx":96
 * cdef dict SCALINGS = {
 *     "auto": GLP_SF_AUTO,
 *     "gm": GLP_SF_GM,             # <<<<<<<<<<<<<<
 *     "eq": GLP_SF_EQ,
 *     "2n": GLP_SF_2N,
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(GLP_SF_GM); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_gm, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cobra/solvers/cglpk.pyx":97
 *     "auto": GLP_SF_AUTO,
 *     "gm": GLP_SF_GM,
 *     "eq": GLP_SF_EQ,             # <<<<<<<<<<<<<<
 *     "2n": GLP_SF_2N,
 *     "skip": GLP_SF_SKIP
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(GLP_SF_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_eq, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cobra/solvers/cglpk.pyx":98
 *     "gm": GLP_SF_GM,
 *     "eq": GLP_SF_EQ,
 *     "2n": GLP_SF_2N,             # <<<<<<<<<<<<<<
 *     "skip": GLP_SF_SKIP
 * }
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(GLP_SF_2N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_6, __pyx_kp_s_2n, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cobra/solvers/cglpk.pyx":100
 *     "2n": GLP_SF_2N,
 *     "skip": GLP_SF_SKIP
 * }             # <<<<<<<<<<<<<<
 * 
 * cdef int downcast_pos_size(Py_ssize_t size):
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(GLP_SF_SKIP); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_skip, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_XGOTREF(__pyx_v_5cobra_7solvers_5cglpk_SCALINGS);
  __Pyx_DECREF_SET(__pyx_v_5cobra_7solvers_5cglpk_SCALINGS, ((PyObject*)__pyx_t_6));
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;

  /* "cobra/solvers/cglpk.pyx":237
 *     # problem creation and modification
 *     @classmethod
 *     def create_problem(cls, cobra_model, objective_sense="maximize"):             # <<<<<<<<<<<<<<
 *         problem = cls(cobra_model)
 *         problem.set_objective_sense(objective_sense)
 */
  __pyx_t_6 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5cobra_7solvers_5cglpk_GLP, __pyx_n_s_create_problem); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);

  /* "cobra/solvers/cglpk.pyx":236
 * 
 *     # problem creation and modification
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def create_problem(cls, cobra_model, objective_sense="maximize"):
 *         problem = cls(cobra_model)
 */
  __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5cobra_7solvers_5cglpk_GLP->tp_dict, __pyx_n_s_create_problem, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_5cobra_7solvers_5cglpk_GLP);

  /* "cobra/solvers/cglpk.pyx":320
 * 
 *     @classmethod
 *     def solve(cls, cobra_model, **kwargs):             # <<<<<<<<<<<<<<
 *         problem = cls.create_problem(cobra_model)
 *         problem.solve_problem(**kwargs)
 */
  __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5cobra_7solvers_5cglpk_GLP, __pyx_n_s_solve); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);

  /* "cobra/solvers/cglpk.pyx":319
 *         return self.get_status()
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def solve(cls, cobra_model, **kwargs):
 *         problem = cls.create_problem(cobra_model)
 */
  __pyx_t_6 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5cobra_7solvers_5cglpk_GLP->tp_dict, __pyx_n_s_solve, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  PyType_Modified(__pyx_ptype_5cobra_7solvers_5cglpk_GLP);

  /* "cobra/solvers/cglpk.pyx":523
 * 
 * # wrappers for all the functions at the module level
 * create_problem = GLP.create_problem             # <<<<<<<<<<<<<<
 * def set_objective_sense(lp, objective_sense="maximize"):
 *     return lp.set_objective_sense(lp, objective_sense=objective_sense)
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_5cobra_7solvers_5cglpk_GLP), __pyx_n_s_create_problem); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_create_problem, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cobra/solvers/cglpk.pyx":524
 * # wrappers for all the functions at the module level
 * create_problem = GLP.create_problem
 * def set_objective_sense(lp, objective_sense="maximize"):             # <<<<<<<<<<<<<<
 *     return lp.set_objective_sense(lp, objective_sense=objective_sense)
 * cpdef change_variable_bounds(lp, int index,
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_5cobra_7solvers_5cglpk_1set_objective_sense, NULL, __pyx_n_s_cobra_solvers_cglpk); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_objective_sense, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cobra/solvers/cglpk.pyx":535
 * cpdef set_parameter(lp, parameter_name, value):
 *     return lp.set_parameter(parameter_name, value)
 * def solve_problem(lp, **kwargs):             # <<<<<<<<<<<<<<
 *     return lp.solve_problem(**kwargs)
 * cpdef get_status(lp):
 */
  __pyx_t_6 = PyCFunction_NewEx(&__pyx_mdef_5cobra_7solvers_5cglpk_11solve_problem, NULL, __pyx_n_s_cobra_solvers_cglpk); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_solve_problem, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cobra/solvers/cglpk.pyx":543
 * cpdef format_solution(lp, cobra_model):
 *     return lp.format_solution(cobra_model)
 * solve = GLP.solve             # <<<<<<<<<<<<<<
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_5cobra_7solvers_5cglpk_GLP), __pyx_n_s_solve); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_solve, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cobra/solvers/cglpk.pyx":1
 * # distutils: libraries=glpk             # <<<<<<<<<<<<<<
 * # cython: embedsignature=True
 * 
 */
  __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /*--- Wrapped vars code ---*/

  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_XDECREF(__pyx_t_8);
  if (__pyx_m) {
    if (__pyx_d) {
      __Pyx_AddTraceback("init cobra.solvers.cglpk", __pyx_clineno, __pyx_lineno, __pyx_filename);
    }
    Py_DECREF(__pyx_m); __pyx_m = 0;
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init cobra.solvers.cglpk");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if PY_MAJOR_VERSION < 3
  return;
  #else
  return __pyx_m;
  #endif
}

/* --- Runtime support code --- */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule((char *)modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
}
#endif

static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
    PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
    if (unlikely(!result)) {
        PyErr_Format(PyExc_NameError,
#if PY_MAJOR_VERSION >= 3
            "name '%U' is not defined", name);
#else
            "name '%.200s' is not defined", PyString_AS_STRING(name));
#endif
    }
    return result;
}

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *result;
    ternaryfunc call = func->ob_type->tp_call;
    if (unlikely(!call))
        return PyObject_Call(func, arg, kw);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = (*call)(func, arg, kw);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();
    tmp_type = tstate->curexc_type;
    tmp_value = tstate->curexc_value;
    tmp_tb = tstate->curexc_traceback;
    tstate->curexc_type = type;
    tstate->curexc_value = value;
    tstate->curexc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_Restore(type, value, tb);
#endif
}
static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyThreadState *tstate = PyThreadState_GET();
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#else
    PyErr_Fetch(type, value, tb);
#endif
}

#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
                        CYTHON_UNUSED PyObject *cause) {
    Py_XINCREF(type);
    if (!value || value == Py_None)
        value = NULL;
    else
        Py_INCREF(value);
    if (!tb || tb == Py_None)
        tb = NULL;
    else {
        Py_INCREF(tb);
        if (!PyTraceBack_Check(tb)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: arg 3 must be a traceback or None");
            goto raise_error;
        }
    }
    if (PyType_Check(type)) {
#if CYTHON_COMPILING_IN_PYPY
        if (!value) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#endif
        PyErr_NormalizeException(&type, &value, &tb);
    } else {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto raise_error;
        }
        value = type;
        type = (PyObject*) Py_TYPE(type);
        Py_INCREF(type);
        if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: exception class must be a subclass of BaseException");
            goto raise_error;
        }
    }
    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}
#else
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    PyObject* owned_instance = NULL;
    if (tb == Py_None) {
        tb = 0;
    } else if (tb && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto bad;
    }
    if (value == Py_None)
        value = 0;
    if (PyExceptionInstance_Check(type)) {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto bad;
        }
        value = type;
        type = (PyObject*) Py_TYPE(value);
    } else if (PyExceptionClass_Check(type)) {
        PyObject *instance_class = NULL;
        if (value && PyExceptionInstance_Check(value)) {
            instance_class = (PyObject*) Py_TYPE(value);
            if (instance_class != type) {
                int is_subclass = PyObject_IsSubclass(instance_class, type);
                if (!is_subclass) {
                    instance_class = NULL;
                } else if (unlikely(is_subclass == -1)) {
                    goto bad;
                } else {
                    type = instance_class;
                }
            }
        }
        if (!instance_class) {
            PyObject *args;
            if (!value)
                args = PyTuple_New(0);
            else if (PyTuple_Check(value)) {
                Py_INCREF(value);
                args = value;
            } else
                args = PyTuple_Pack(1, value);
            if (!args)
                goto bad;
            owned_instance = PyObject_Call(type, args, NULL);
            Py_DECREF(args);
            if (!owned_instance)
                goto bad;
            value = owned_instance;
            if (!PyExceptionInstance_Check(value)) {
                PyErr_Format(PyExc_TypeError,
                             "calling %R should have returned an instance of "
                             "BaseException, not %R",
                             type, Py_TYPE(value));
                goto bad;
            }
        }
    } else {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }
#if PY_VERSION_HEX >= 0x03030000
    if (cause) {
#else
    if (cause && cause != Py_None) {
#endif
        PyObject *fixed_cause;
        if (cause == Py_None) {
            fixed_cause = NULL;
        } else if (PyExceptionClass_Check(cause)) {
            fixed_cause = PyObject_CallObject(cause, NULL);
            if (fixed_cause == NULL)
                goto bad;
        } else if (PyExceptionInstance_Check(cause)) {
            fixed_cause = cause;
            Py_INCREF(fixed_cause);
        } else {
            PyErr_SetString(PyExc_TypeError,
                            "exception causes must derive from "
                            "BaseException");
            goto bad;
        }
        PyException_SetCause(value, fixed_cause);
    }
    PyErr_SetObject(type, value);
    if (tb) {
#if CYTHON_COMPILING_IN_PYPY
        PyObject *tmp_type, *tmp_value, *tmp_tb;
        PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
        Py_INCREF(tb);
        PyErr_Restore(tmp_type, tmp_value, tb);
        Py_XDECREF(tmp_tb);
#else
        PyThreadState *tstate = PyThreadState_GET();
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
#endif
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}
#endif

static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
                                  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
                                  int full_traceback, CYTHON_UNUSED int nogil) {
    PyObject *old_exc, *old_val, *old_tb;
    PyObject *ctx;
#ifdef WITH_THREAD
    PyGILState_STATE state;
    if (nogil)
        state = PyGILState_Ensure();
#endif
    __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
    if (full_traceback) {
        Py_XINCREF(old_exc);
        Py_XINCREF(old_val);
        Py_XINCREF(old_tb);
        __Pyx_ErrRestore(old_exc, old_val, old_tb);
        PyErr_PrintEx(1);
    }
    #if PY_MAJOR_VERSION < 3
    ctx = PyString_FromString(name);
    #else
    ctx = PyUnicode_FromString(name);
    #endif
    __Pyx_ErrRestore(old_exc, old_val, old_tb);
    if (!ctx) {
        PyErr_WriteUnraisable(Py_None);
    } else {
        PyErr_WriteUnraisable(ctx);
        Py_DECREF(ctx);
    }
#ifdef WITH_THREAD
    if (nogil)
        PyGILState_Release(state);
#endif
}

static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
    PyObject *result;
#if CYTHON_COMPILING_IN_CPYTHON
    result = PyDict_GetItem(__pyx_d, name);
    if (likely(result)) {
        Py_INCREF(result);
    } else {
#else
    result = PyObject_GetItem(__pyx_d, name);
    if (!result) {
        PyErr_Clear();
#endif
        result = __Pyx_GetBuiltinName(name);
    }
    return result;
}

static void __Pyx_RaiseArgtupleInvalid(
    const char* func_name,
    int exact,
    Py_ssize_t num_min,
    Py_ssize_t num_max,
    Py_ssize_t num_found)
{
    Py_ssize_t num_expected;
    const char *more_or_less;
    if (num_found < num_min) {
        num_expected = num_min;
        more_or_less = "at least";
    } else {
        num_expected = num_max;
        more_or_less = "at most";
    }
    if (exact) {
        more_or_less = "exactly";
    }
    PyErr_Format(PyExc_TypeError,
                 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
                 func_name, more_or_less, num_expected,
                 (num_expected == 1) ? "" : "s", num_found);
}

static CYTHON_INLINE int __Pyx_CheckKeywordStrings(
    PyObject *kwdict,
    const char* function_name,
    int kw_allowed)
{
    PyObject* key = 0;
    Py_ssize_t pos = 0;
#if CYTHON_COMPILING_IN_PYPY
    if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
        goto invalid_keyword;
    return 1;
#else
    while (PyDict_Next(kwdict, &pos, &key, 0)) {
        #if PY_MAJOR_VERSION < 3
        if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key)))
        #endif
            if (unlikely(!PyUnicode_Check(key)))
                goto invalid_keyword_type;
    }
    if ((!kw_allowed) && unlikely(key))
        goto invalid_keyword;
    return 1;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    return 0;
#endif
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
    return 0;
}

static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        #if PY_MAJOR_VERSION >= 3
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
        #else
        "%s() got multiple values for keyword argument '%s'", func_name,
        PyString_AsString(kw_name));
        #endif
}

static int __Pyx_ParseOptionalKeywords(
    PyObject *kwds,
    PyObject **argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject *key = 0, *value = 0;
    Py_ssize_t pos = 0;
    PyObject*** name;
    PyObject*** first_kw_arg = argnames + num_pos_args;
    while (PyDict_Next(kwds, &pos, &key, &value)) {
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            values[name-argnames] = value;
            continue;
        }
        name = first_kw_arg;
        #if PY_MAJOR_VERSION < 3
        if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
            while (*name) {
                if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
                        && _PyString_Eq(**name, key)) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    if ((**argname == key) || (
                            (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
                             && _PyString_Eq(**argname, key))) {
                        goto arg_passed_twice;
                    }
                    argname++;
                }
            }
        } else
        #endif
        if (likely(PyUnicode_Check(key))) {
            while (*name) {
                int cmp = (**name == key) ? 0 :
                #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                    (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
                #endif
                    PyUnicode_Compare(**name, key);
                if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                if (cmp == 0) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    int cmp = (**argname == key) ? 0 :
                    #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                        (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
                    #endif
                        PyUnicode_Compare(**argname, key);
                    if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                    if (cmp == 0) goto arg_passed_twice;
                    argname++;
                }
            }
        } else
            goto invalid_keyword_type;
        if (kwds2) {
            if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
        } else {
            goto invalid_keyword;
        }
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    return -1;
}

static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
    return PyObject_RichCompareBool(s1, s2, equals);
#else
    if (s1 == s2) {
        return (equals == Py_EQ);
    } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
        const char *ps1, *ps2;
        Py_ssize_t length = PyBytes_GET_SIZE(s1);
        if (length != PyBytes_GET_SIZE(s2))
            return (equals == Py_NE);
        ps1 = PyBytes_AS_STRING(s1);
        ps2 = PyBytes_AS_STRING(s2);
        if (ps1[0] != ps2[0]) {
            return (equals == Py_NE);
        } else if (length == 1) {
            return (equals == Py_EQ);
        } else {
            int result = memcmp(ps1, ps2, (size_t)length);
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
        return (equals == Py_NE);
    } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
        return (equals == Py_NE);
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
#endif
}

static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
    return PyObject_RichCompareBool(s1, s2, equals);
#else
#if PY_MAJOR_VERSION < 3
    PyObject* owned_ref = NULL;
#endif
    int s1_is_unicode, s2_is_unicode;
    if (s1 == s2) {
        goto return_eq;
    }
    s1_is_unicode = PyUnicode_CheckExact(s1);
    s2_is_unicode = PyUnicode_CheckExact(s2);
#if PY_MAJOR_VERSION < 3
    if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
        owned_ref = PyUnicode_FromObject(s2);
        if (unlikely(!owned_ref))
            return -1;
        s2 = owned_ref;
        s2_is_unicode = 1;
    } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
        owned_ref = PyUnicode_FromObject(s1);
        if (unlikely(!owned_ref))
            return -1;
        s1 = owned_ref;
        s1_is_unicode = 1;
    } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
        return __Pyx_PyBytes_Equals(s1, s2, equals);
    }
#endif
    if (s1_is_unicode & s2_is_unicode) {
        Py_ssize_t length;
        int kind;
        void *data1, *data2;
        if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
            return -1;
        length = __Pyx_PyUnicode_GET_LENGTH(s1);
        if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
            goto return_ne;
        }
        kind = __Pyx_PyUnicode_KIND(s1);
        if (kind != __Pyx_PyUnicode_KIND(s2)) {
            goto return_ne;
        }
        data1 = __Pyx_PyUnicode_DATA(s1);
        data2 = __Pyx_PyUnicode_DATA(s2);
        if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
            goto return_ne;
        } else if (length == 1) {
            goto return_eq;
        } else {
            int result = memcmp(data1, data2, (size_t)(length * kind));
            #if PY_MAJOR_VERSION < 3
            Py_XDECREF(owned_ref);
            #endif
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & s2_is_unicode) {
        goto return_ne;
    } else if ((s2 == Py_None) & s1_is_unicode) {
        goto return_ne;
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
return_eq:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_EQ);
return_ne:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_NE);
#endif
}

#if CYTHON_USE_PYLONG_INTERNALS
  #include "longintrepr.h"
#endif

#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
    if (op1 == op2) {
        Py_RETURN_TRUE;
    }
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long a = PyInt_AS_LONG(op1);
        if (a == b) {
            Py_RETURN_TRUE;
        } else {
            Py_RETURN_FALSE;
        }
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a;
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                #if PyLong_SHIFT < 30 && PyLong_SHIFT != 15
                default: return PyLong_Type.tp_richcompare(op1, op2, Py_EQ);
                #else
                default: Py_RETURN_FALSE;
                #endif
            }
        }
            if (a == b) {
                Py_RETURN_TRUE;
            } else {
                Py_RETURN_FALSE;
            }
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
            if ((double)a == (double)b) {
                Py_RETURN_TRUE;
            } else {
                Py_RETURN_FALSE;
            }
    }
    return PyObject_RichCompare(op1, op2, Py_EQ);
}
#endif

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
}

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
    PyObject *self, *result;
    PyCFunction cfunc;
    cfunc = PyCFunction_GET_FUNCTION(func);
    self = PyCFunction_GET_SELF(func);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = cfunc(self, arg);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#else
    if (likely(PyCFunction_Check(func))) {
#endif
        if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
            return __Pyx_PyObject_CallMethO(func, NULL);
        }
    }
    return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
}
#endif

#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_New(1);
    if (unlikely(!args)) return NULL;
    Py_INCREF(arg);
    PyTuple_SET_ITEM(args, 0, arg);
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#else
    if (likely(PyCFunction_Check(func))) {
#endif
        if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
            return __Pyx_PyObject_CallMethO(func, arg);
        }
    }
    return __Pyx__PyObject_CallOneArg(func, arg);
}
#else
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_Pack(1, arg);
    if (unlikely(!args)) return NULL;
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
#endif

static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
    PyObject *method, *result = NULL;
    method = __Pyx_PyObject_GetAttrStr(obj, method_name);
    if (unlikely(!method)) goto bad;
#if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyMethod_Check(method))) {
        PyObject *self = PyMethod_GET_SELF(method);
        if (likely(self)) {
            PyObject *function = PyMethod_GET_FUNCTION(method);
            result = __Pyx_PyObject_CallOneArg(function, self);
            Py_DECREF(method);
            return result;
        }
    }
#endif
    result = __Pyx_PyObject_CallNoArg(method);
    Py_DECREF(method);
bad:
    return result;
}

static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
    PyErr_Format(PyExc_ValueError,
                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
                 index, (index == 1) ? "" : "s");
}

static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
    PyErr_Format(PyExc_ValueError,
                 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
}

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_RaiseNoneNotIterableError(void) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
}

static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
    if (t == Py_None) {
      __Pyx_RaiseNoneNotIterableError();
    } else if (PyTuple_GET_SIZE(t) < index) {
      __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t));
    } else {
      __Pyx_RaiseTooManyValuesError(index);
    }
}

static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
                                             int is_tuple, int has_known_size, int decref_tuple) {
    Py_ssize_t index;
    PyObject *value1 = NULL, *value2 = NULL, *iter = NULL;
    if (!is_tuple && unlikely(!PyTuple_Check(tuple))) {
        iternextfunc iternext;
        iter = PyObject_GetIter(tuple);
        if (unlikely(!iter)) goto bad;
        if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; }
        iternext = Py_TYPE(iter)->tp_iternext;
        value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; }
        value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; }
        if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad;
        Py_DECREF(iter);
    } else {
        if (!has_known_size && unlikely(PyTuple_GET_SIZE(tuple) != 2)) {
            __Pyx_UnpackTupleError(tuple, 2);
            goto bad;
        }
#if CYTHON_COMPILING_IN_PYPY
        value1 = PySequence_ITEM(tuple, 0);
        if (unlikely(!value1)) goto bad;
        value2 = PySequence_ITEM(tuple, 1);
        if (unlikely(!value2)) goto bad;
#else
        value1 = PyTuple_GET_ITEM(tuple, 0);
        value2 = PyTuple_GET_ITEM(tuple, 1);
        Py_INCREF(value1);
        Py_INCREF(value2);
#endif
        if (decref_tuple) { Py_DECREF(tuple); }
    }
    *pvalue1 = value1;
    *pvalue2 = value2;
    return 0;
unpacking_failed:
    if (!has_known_size && __Pyx_IterFinish() == 0)
        __Pyx_RaiseNeedMoreValuesError(index);
bad:
    Py_XDECREF(iter);
    Py_XDECREF(value1);
    Py_XDECREF(value2);
    if (decref_tuple) { Py_XDECREF(tuple); }
    return -1;
}

static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name,
                                                   Py_ssize_t* p_orig_length, int* p_source_is_dict) {
    is_dict = is_dict || likely(PyDict_CheckExact(iterable));
    *p_source_is_dict = is_dict;
#if !CYTHON_COMPILING_IN_PYPY
    if (is_dict) {
        *p_orig_length = PyDict_Size(iterable);
        Py_INCREF(iterable);
        return iterable;
    }
#endif
    *p_orig_length = 0;
    if (method_name) {
        PyObject* iter;
        iterable = __Pyx_PyObject_CallMethod0(iterable, method_name);
        if (!iterable)
            return NULL;
#if !CYTHON_COMPILING_IN_PYPY
        if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable))
            return iterable;
#endif
        iter = PyObject_GetIter(iterable);
        Py_DECREF(iterable);
        return iter;
    }
    return PyObject_GetIter(iterable);
}
static CYTHON_INLINE int __Pyx_dict_iter_next(
        PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos,
        PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) {
    PyObject* next_item;
#if !CYTHON_COMPILING_IN_PYPY
    if (source_is_dict) {
        PyObject *key, *value;
        if (unlikely(orig_length != PyDict_Size(iter_obj))) {
            PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration");
            return -1;
        }
        if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) {
            return 0;
        }
        if (pitem) {
            PyObject* tuple = PyTuple_New(2);
            if (unlikely(!tuple)) {
                return -1;
            }
            Py_INCREF(key);
            Py_INCREF(value);
            PyTuple_SET_ITEM(tuple, 0, key);
            PyTuple_SET_ITEM(tuple, 1, value);
            *pitem = tuple;
        } else {
            if (pkey) {
                Py_INCREF(key);
                *pkey = key;
            }
            if (pvalue) {
                Py_INCREF(value);
                *pvalue = value;
            }
        }
        return 1;
    } else if (PyTuple_CheckExact(iter_obj)) {
        Py_ssize_t pos = *ppos;
        if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0;
        *ppos = pos + 1;
        next_item = PyTuple_GET_ITEM(iter_obj, pos);
        Py_INCREF(next_item);
    } else if (PyList_CheckExact(iter_obj)) {
        Py_ssize_t pos = *ppos;
        if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0;
        *ppos = pos + 1;
        next_item = PyList_GET_ITEM(iter_obj, pos);
        Py_INCREF(next_item);
    } else
#endif
    {
        next_item = PyIter_Next(iter_obj);
        if (unlikely(!next_item)) {
            return __Pyx_IterFinish();
        }
    }
    if (pitem) {
        *pitem = next_item;
    } else if (pkey && pvalue) {
        if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1))
            return -1;
    } else if (pkey) {
        *pkey = next_item;
    } else {
        *pvalue = next_item;
    }
    return 1;
}

static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (!j) return NULL;
    r = PyObject_GetItem(o, j);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
    if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
        PyObject *r = PyList_GET_ITEM(o, i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
    if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
        PyObject *r = PyTuple_GET_ITEM(o, i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
                                                     CYTHON_NCP_UNUSED int wraparound,
                                                     CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) {
            PyObject *r = PyList_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    }
    else if (PyTuple_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
        if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
            PyObject *r = PyTuple_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    } else {
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_item)) {
            if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (PyErr_ExceptionMatches(PyExc_OverflowError))
                        PyErr_Clear();
                    else
                        return NULL;
                }
            }
            return m->sq_item(o, i);
        }
    }
#else
    if (is_list || PySequence_Check(o)) {
        return PySequence_GetItem(o, i);
    }
#endif
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}

static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
    PyObject *method;
    method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name);
    if (unlikely(!method))
        return -1;
    target->method = method;
#if CYTHON_COMPILING_IN_CPYTHON
    #if PY_MAJOR_VERSION >= 3
    if (likely(PyObject_TypeCheck(method, &PyMethodDescr_Type)))
    #endif
    {
        PyMethodDescrObject *descr = (PyMethodDescrObject*) method;
        target->func = descr->d_method->ml_meth;
        target->flag = descr->d_method->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_O | METH_NOARGS);
    }
#endif
    return 0;
}

static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
    PyObject *args, *result = NULL;
    if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
#if CYTHON_COMPILING_IN_CPYTHON
    args = PyTuple_New(1);
    if (unlikely(!args)) goto bad;
    Py_INCREF(self);
    PyTuple_SET_ITEM(args, 0, self);
#else
    args = PyTuple_Pack(1, self);
    if (unlikely(!args)) goto bad;
#endif
    result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
    Py_DECREF(args);
bad:
    return result;
}

static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d) {
    if (PY_MAJOR_VERSION >= 3)
        return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyDict_Type_items, d);
    else
        return PyDict_Items(d);
}

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 (local_tb) {
        if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
            goto bad;
    }
    #endif
    Py_XINCREF(local_tb);
    Py_XINCREF(local_type);
    Py_XINCREF(local_value);
    *type = local_type;
    *value = local_value;
    *tb = local_tb;
#if CYTHON_COMPILING_IN_CPYTHON
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = local_type;
    tstate->exc_value = local_value;
    tstate->exc_traceback = local_tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_SetExcInfo(local_type, local_value, local_tb);
#endif
    return 0;
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
}

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 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 double __Pyx__PyObject_AsDouble(PyObject* obj) {
    PyObject* float_value;
#if CYTHON_COMPILING_IN_PYPY
    float_value = PyNumber_Float(obj);  if (0) goto bad;
#else
    PyNumberMethods *nb = Py_TYPE(obj)->tp_as_number;
    if (likely(nb) && likely(nb->nb_float)) {
        float_value = nb->nb_float(obj);
        if (likely(float_value) && unlikely(!PyFloat_Check(float_value))) {
            PyErr_Format(PyExc_TypeError,
                "__float__ returned non-float (type %.200s)",
                Py_TYPE(float_value)->tp_name);
            Py_DECREF(float_value);
            goto bad;
        }
    } else if (PyUnicode_CheckExact(obj) || PyBytes_CheckExact(obj)) {
#if PY_MAJOR_VERSION >= 3
        float_value = PyFloat_FromString(obj);
#else
        float_value = PyFloat_FromString(obj, 0);
#endif
    } else {
        PyObject* args = PyTuple_New(1);
        if (unlikely(!args)) goto bad;
        PyTuple_SET_ITEM(args, 0, obj);
        float_value = PyObject_Call((PyObject*)&PyFloat_Type, args, 0);
        PyTuple_SET_ITEM(args, 0, 0);
        Py_DECREF(args);
    }
#endif
    if (likely(float_value)) {
        double value = PyFloat_AS_DOUBLE(float_value);
        Py_DECREF(float_value);
        return value;
    }
bad:
    return (double)-1;
}

static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (likely(PyObject_TypeCheck(obj, type)))
        return 1;
    PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
                 Py_TYPE(obj)->tp_name, type->tp_name);
    return 0;
}

static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
    int r;
    if (!j) return -1;
    r = PyObject_SetItem(o, j, v);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list,
                                               CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
        if ((!boundscheck) || likely((n >= 0) & (n < PyList_GET_SIZE(o)))) {
            PyObject* old = PyList_GET_ITEM(o, n);
            Py_INCREF(v);
            PyList_SET_ITEM(o, n, v);
            Py_DECREF(old);
            return 1;
        }
    } else {
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_ass_item)) {
            if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (PyErr_ExceptionMatches(PyExc_OverflowError))
                        PyErr_Clear();
                    else
                        return -1;
                }
            }
            return m->sq_ass_item(o, i, v);
        }
    }
#else
#if CYTHON_COMPILING_IN_PYPY
    if (is_list || (PySequence_Check(o) && !PyDict_Check(o))) {
#else
    if (is_list || PySequence_Check(o)) {
#endif
        return PySequence_SetItem(o, i, v);
    }
#endif
    return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v);
}

static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
    PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
}

static int __Pyx_PyBytes_SingleTailmatch(PyObject* self, PyObject* arg,
                                         Py_ssize_t start, Py_ssize_t end, int direction) {
    const char* self_ptr = PyBytes_AS_STRING(self);
    Py_ssize_t self_len = PyBytes_GET_SIZE(self);
    const char* sub_ptr;
    Py_ssize_t sub_len;
    int retval;
    Py_buffer view;
    view.obj = NULL;
    if ( PyBytes_Check(arg) ) {
        sub_ptr = PyBytes_AS_STRING(arg);
        sub_len = PyBytes_GET_SIZE(arg);
    }
#if PY_MAJOR_VERSION < 3
    else if ( PyUnicode_Check(arg) ) {
        return (int) PyUnicode_Tailmatch(self, arg, start, end, direction);
    }
#endif
    else {
        if (unlikely(PyObject_GetBuffer(self, &view, PyBUF_SIMPLE) == -1))
            return -1;
        sub_ptr = (const char*) view.buf;
        sub_len = view.len;
    }
    if (end > self_len)
        end = self_len;
    else if (end < 0)
        end += self_len;
    if (end < 0)
        end = 0;
    if (start < 0)
        start += self_len;
    if (start < 0)
        start = 0;
    if (direction > 0) {
        if (end-sub_len > start)
            start = end - sub_len;
    }
    if (start + sub_len <= end)
        retval = !memcmp(self_ptr+start, sub_ptr, (size_t)sub_len);
    else
        retval = 0;
    if (view.obj)
        PyBuffer_Release(&view);
    return retval;
}
static int __Pyx_PyBytes_Tailmatch(PyObject* self, PyObject* substr,
                                   Py_ssize_t start, Py_ssize_t end, int direction) {
    if (unlikely(PyTuple_Check(substr))) {
        Py_ssize_t i, count = PyTuple_GET_SIZE(substr);
        for (i = 0; i < count; i++) {
            int result;
#if CYTHON_COMPILING_IN_CPYTHON
            result = __Pyx_PyBytes_SingleTailmatch(self, PyTuple_GET_ITEM(substr, i),
                                                   start, end, direction);
#else
            PyObject* sub = PySequence_ITEM(substr, i);
            if (unlikely(!sub)) return -1;
            result = __Pyx_PyBytes_SingleTailmatch(self, sub, start, end, direction);
            Py_DECREF(sub);
#endif
            if (result) {
                return result;
            }
        }
        return 0;
    }
    return __Pyx_PyBytes_SingleTailmatch(self, substr, start, end, direction);
}

static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
#if PY_VERSION_HEX >= 0x02070000
    PyObject *ob = PyCapsule_New(vtable, 0, 0);
#else
    PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
#endif
    if (!ob)
        goto bad;
    if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
        goto bad;
    Py_DECREF(ob);
    return 0;
bad:
    Py_XDECREF(ob);
    return -1;
}

static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
    PyObject *empty_list = 0;
    PyObject *module = 0;
    PyObject *global_dict = 0;
    PyObject *empty_dict = 0;
    PyObject *list;
    #if PY_VERSION_HEX < 0x03030000
    PyObject *py_import;
    py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
    if (!py_import)
        goto bad;
    #endif
    if (from_list)
        list = from_list;
    else {
        empty_list = PyList_New(0);
        if (!empty_list)
            goto bad;
        list = empty_list;
    }
    global_dict = PyModule_GetDict(__pyx_m);
    if (!global_dict)
        goto bad;
    empty_dict = PyDict_New();
    if (!empty_dict)
        goto bad;
    {
        #if PY_MAJOR_VERSION >= 3
        if (level == -1) {
            if (strchr(__Pyx_MODULE_NAME, '.')) {
                #if PY_VERSION_HEX < 0x03030000
                PyObject *py_level = PyInt_FromLong(1);
                if (!py_level)
                    goto bad;
                module = PyObject_CallFunctionObjArgs(py_import,
                    name, global_dict, empty_dict, list, py_level, NULL);
                Py_DECREF(py_level);
                #else
                module = PyImport_ImportModuleLevelObject(
                    name, global_dict, empty_dict, list, 1);
                #endif
                if (!module) {
                    if (!PyErr_ExceptionMatches(PyExc_ImportError))
                        goto bad;
                    PyErr_Clear();
                }
            }
            level = 0;
        }
        #endif
        if (!module) {
            #if PY_VERSION_HEX < 0x03030000
            PyObject *py_level = PyInt_FromLong(level);
            if (!py_level)
                goto bad;
            module = PyObject_CallFunctionObjArgs(py_import,
                name, global_dict, empty_dict, list, py_level, NULL);
            Py_DECREF(py_level);
            #else
            module = PyImport_ImportModuleLevelObject(
                name, global_dict, empty_dict, list, level);
            #endif
        }
    }
bad:
    #if PY_VERSION_HEX < 0x03030000
    Py_XDECREF(py_import);
    #endif
    Py_XDECREF(empty_list);
    Py_XDECREF(empty_dict);
    return module;
}

static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
    PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
    if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Format(PyExc_ImportError,
        #if PY_MAJOR_VERSION < 3
            "cannot import name %.230s", PyString_AS_STRING(name));
        #else
            "cannot import name %S", name);
        #endif
    }
    return value;
}

static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
    Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
    for (i=0; i < nbases; i++) {
        PyTypeObject *tmptype;
        PyObject *tmp = PyTuple_GET_ITEM(bases, i);
        tmptype = Py_TYPE(tmp);
#if PY_MAJOR_VERSION < 3
        if (tmptype == &PyClass_Type)
            continue;
#endif
        if (!metaclass) {
            metaclass = tmptype;
            continue;
        }
        if (PyType_IsSubtype(metaclass, tmptype))
            continue;
        if (PyType_IsSubtype(tmptype, metaclass)) {
            metaclass = tmptype;
            continue;
        }
        PyErr_SetString(PyExc_TypeError,
                        "metaclass conflict: "
                        "the metaclass of a derived class "
                        "must be a (non-strict) subclass "
                        "of the metaclasses of all its bases");
        return NULL;
    }
    if (!metaclass) {
#if PY_MAJOR_VERSION < 3
        metaclass = &PyClass_Type;
#else
        metaclass = &PyType_Type;
#endif
    }
    Py_INCREF((PyObject*) metaclass);
    return (PyObject*) metaclass;
}

static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
                                           PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
    PyObject *ns;
    if (metaclass) {
        PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
        if (prep) {
            PyObject *pargs = PyTuple_Pack(2, name, bases);
            if (unlikely(!pargs)) {
                Py_DECREF(prep);
                return NULL;
            }
            ns = PyObject_Call(prep, pargs, mkw);
            Py_DECREF(prep);
            Py_DECREF(pargs);
        } else {
            if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
                return NULL;
            PyErr_Clear();
            ns = PyDict_New();
        }
    } else {
        ns = PyDict_New();
    }
    if (unlikely(!ns))
        return NULL;
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad;
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
    if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
    return ns;
bad:
    Py_DECREF(ns);
    return NULL;
}
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
                                      PyObject *dict, PyObject *mkw,
                                      int calculate_metaclass, int allow_py2_metaclass) {
    PyObject *result, *margs;
    PyObject *owned_metaclass = NULL;
    if (allow_py2_metaclass) {
        owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
        if (owned_metaclass) {
            metaclass = owned_metaclass;
        } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
            PyErr_Clear();
        } else {
            return NULL;
        }
    }
    if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
        metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
        Py_XDECREF(owned_metaclass);
        if (unlikely(!metaclass))
            return NULL;
        owned_metaclass = metaclass;
    }
    margs = PyTuple_Pack(3, name, bases, dict);
    if (unlikely(!margs)) {
        result = NULL;
    } else {
        result = PyObject_Call(metaclass, margs, mkw);
        Py_DECREF(margs);
    }
    Py_XDECREF(owned_metaclass);
    return result;
}

static PyObject *__Pyx_GetNameInClass(PyObject *nmspace, PyObject *name) {
    PyObject *result;
    result = __Pyx_PyObject_GetAttrStr(nmspace, name);
    if (!result)
        result = __Pyx_GetModuleGlobalName(name);
    return result;
}

static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
    int start = 0, mid = 0, end = count - 1;
    if (end >= 0 && code_line > entries[end].code_line) {
        return count;
    }
    while (start < end) {
        mid = start + (end - start) / 2;
        if (code_line < entries[mid].code_line) {
            end = mid;
        } else if (code_line > entries[mid].code_line) {
             start = mid + 1;
        } else {
            return mid;
        }
    }
    if (code_line <= entries[mid].code_line) {
        return mid;
    } else {
        return mid + 1;
    }
}
static PyCodeObject *__pyx_find_code_object(int code_line) {
    PyCodeObject* code_object;
    int pos;
    if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
        return NULL;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
        return NULL;
    }
    code_object = __pyx_code_cache.entries[pos].code_object;
    Py_INCREF(code_object);
    return code_object;
}
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
    int pos, i;
    __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
    if (unlikely(!code_line)) {
        return;
    }
    if (unlikely(!entries)) {
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
        if (likely(entries)) {
            __pyx_code_cache.entries = entries;
            __pyx_code_cache.max_count = 64;
            __pyx_code_cache.count = 1;
            entries[0].code_line = code_line;
            entries[0].code_object = code_object;
            Py_INCREF(code_object);
        }
        return;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
        PyCodeObject* tmp = entries[pos].code_object;
        entries[pos].code_object = code_object;
        Py_DECREF(tmp);
        return;
    }
    if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
        int new_max = __pyx_code_cache.max_count + 64;
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
            __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
        if (unlikely(!entries)) {
            return;
        }
        __pyx_code_cache.entries = entries;
        __pyx_code_cache.max_count = new_max;
    }
    for (i=__pyx_code_cache.count; i>pos; i--) {
        entries[i] = entries[i-1];
    }
    entries[pos].code_line = code_line;
    entries[pos].code_object = code_object;
    __pyx_code_cache.count++;
    Py_INCREF(code_object);
}

#include "compile.h"
#include "frameobject.h"
#include "traceback.h"
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
            const char *funcname, int c_line,
            int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    #if PY_MAJOR_VERSION < 3
    py_srcfile = PyString_FromString(filename);
    #else
    py_srcfile = PyUnicode_FromString(filename);
    #endif
    if (!py_srcfile) goto bad;
    if (c_line) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #endif
    }
    else {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromString(funcname);
        #else
        py_funcname = PyUnicode_FromString(funcname);
        #endif
    }
    if (!py_funcname) goto bad;
    py_code = __Pyx_PyCode_New(
        0,
        0,
        0,
        0,
        0,
        __pyx_empty_bytes, /*PyObject *code,*/
        __pyx_empty_tuple, /*PyObject *consts,*/
        __pyx_empty_tuple, /*PyObject *names,*/
        __pyx_empty_tuple, /*PyObject *varnames,*/
        __pyx_empty_tuple, /*PyObject *freevars,*/
        __pyx_empty_tuple, /*PyObject *cellvars,*/
        py_srcfile,   /*PyObject *filename,*/
        py_funcname,  /*PyObject *name,*/
        py_line,
        __pyx_empty_bytes  /*PyObject *lnotab*/
    );
    Py_DECREF(py_srcfile);
    Py_DECREF(py_funcname);
    return py_code;
bad:
    Py_XDECREF(py_srcfile);
    Py_XDECREF(py_funcname);
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyFrameObject *py_frame = 0;
    py_code = __pyx_find_code_object(c_line ? c_line : py_line);
    if (!py_code) {
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) goto bad;
        __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
    }
    py_frame = PyFrame_New(
        PyThreadState_GET(), /*PyThreadState *tstate,*/
        py_code,             /*PyCodeObject *code,*/
        __pyx_d,      /*PyObject *globals,*/
        0                    /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    py_frame->f_lineno = py_line;
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
    const int neg_one = (int) -1, const_zero = (int) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
        }
    } else {
        if (sizeof(int) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(int),
                                     little, !is_unsigned);
    }
}

#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
    {\
        func_type value = func_value;\
        if (sizeof(target_type) < sizeof(func_type)) {\
            if (unlikely(value != (func_type) (target_type) value)) {\
                func_type zero = 0;\
                if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
                    return (target_type) -1;\
                if (is_unsigned && unlikely(value < zero))\
                    goto raise_neg_overflow;\
                else\
                    goto raise_overflow;\
            }\
        }\
        return (target_type) value;\
    }

static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
    const int neg_one = (int) -1, const_zero = (int) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(int) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (int) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case  1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
                case 2:
                    if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
                            return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
                            return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
                            return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (int) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(int) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) digits[0])
                case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                            return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                            return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
                            return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(int) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
            } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            int val;
            PyObject *v = __Pyx_PyNumber_Int(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (int) -1;
        }
    } else {
        int val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (int) -1;
        val = __Pyx_PyInt_As_int(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to int");
    return (int) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to int");
    return (int) -1;
}

#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3
static PyObject *__Pyx_GetStdout(void) {
    PyObject *f = PySys_GetObject((char *)"stdout");
    if (!f) {
        PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout");
    }
    return f;
}
static int __Pyx_Print(PyObject* f, PyObject *arg_tuple, int newline) {
    int i;
    if (!f) {
        if (!(f = __Pyx_GetStdout()))
            return -1;
    }
    Py_INCREF(f);
    for (i=0; i < PyTuple_GET_SIZE(arg_tuple); i++) {
        PyObject* v;
        if (PyFile_SoftSpace(f, 1)) {
            if (PyFile_WriteString(" ", f) < 0)
                goto error;
        }
        v = PyTuple_GET_ITEM(arg_tuple, i);
        if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0)
            goto error;
        if (PyString_Check(v)) {
            char *s = PyString_AsString(v);
            Py_ssize_t len = PyString_Size(v);
            if (len > 0) {
                switch (s[len-1]) {
                    case ' ': break;
                    case '\f': case '\r': case '\n': case '\t': case '\v':
                        PyFile_SoftSpace(f, 0);
                        break;
                    default:  break;
                }
            }
        }
    }
    if (newline) {
        if (PyFile_WriteString("\n", f) < 0)
            goto error;
        PyFile_SoftSpace(f, 0);
    }
    Py_DECREF(f);
    return 0;
error:
    Py_DECREF(f);
    return -1;
}
#else
static int __Pyx_Print(PyObject* stream, PyObject *arg_tuple, int newline) {
    PyObject* kwargs = 0;
    PyObject* result = 0;
    PyObject* end_string;
    if (unlikely(!__pyx_print)) {
        __pyx_print = PyObject_GetAttr(__pyx_b, __pyx_n_s_print);
        if (!__pyx_print)
            return -1;
    }
    if (stream) {
        kwargs = PyDict_New();
        if (unlikely(!kwargs))
            return -1;
        if (unlikely(PyDict_SetItem(kwargs, __pyx_n_s_file, stream) < 0))
            goto bad;
        if (!newline) {
            end_string = PyUnicode_FromStringAndSize(" ", 1);
            if (unlikely(!end_string))
                goto bad;
            if (PyDict_SetItem(kwargs, __pyx_n_s_end, end_string) < 0) {
                Py_DECREF(end_string);
                goto bad;
            }
            Py_DECREF(end_string);
        }
    } else if (!newline) {
        if (unlikely(!__pyx_print_kwargs)) {
            __pyx_print_kwargs = PyDict_New();
            if (unlikely(!__pyx_print_kwargs))
                return -1;
            end_string = PyUnicode_FromStringAndSize(" ", 1);
            if (unlikely(!end_string))
                return -1;
            if (PyDict_SetItem(__pyx_print_kwargs, __pyx_n_s_end, end_string) < 0) {
                Py_DECREF(end_string);
                return -1;
            }
            Py_DECREF(end_string);
        }
        kwargs = __pyx_print_kwargs;
    }
    result = PyObject_Call(__pyx_print, arg_tuple, kwargs);
    if (unlikely(kwargs) && (kwargs != __pyx_print_kwargs))
        Py_DECREF(kwargs);
    if (!result)
        return -1;
    Py_DECREF(result);
    return 0;
bad:
    if (kwargs != __pyx_print_kwargs)
        Py_XDECREF(kwargs);
    return -1;
}
#endif

#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3
static int __Pyx_PrintOne(PyObject* f, PyObject *o) {
    if (!f) {
        if (!(f = __Pyx_GetStdout()))
            return -1;
    }
    Py_INCREF(f);
    if (PyFile_SoftSpace(f, 0)) {
        if (PyFile_WriteString(" ", f) < 0)
            goto error;
    }
    if (PyFile_WriteObject(o, f, Py_PRINT_RAW) < 0)
        goto error;
    if (PyFile_WriteString("\n", f) < 0)
        goto error;
    Py_DECREF(f);
    return 0;
error:
    Py_DECREF(f);
    return -1;
    /* the line below is just to avoid C compiler
     * warnings about unused functions */
    return __Pyx_Print(f, NULL, 0);
}
#else
static int __Pyx_PrintOne(PyObject* stream, PyObject *o) {
    int res;
    PyObject* arg_tuple = PyTuple_Pack(1, o);
    if (unlikely(!arg_tuple))
        return -1;
    res = __Pyx_Print(stream, arg_tuple, 1);
    Py_DECREF(arg_tuple);
    return res;
}
#endif

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
    const long neg_one = (long) -1, const_zero = (long) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(long) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
        }
    } else {
        if (sizeof(long) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(long),
                                     little, !is_unsigned);
    }
}

static PyObject* __Pyx_Method_ClassMethod(PyObject *method) {
#if CYTHON_COMPILING_IN_PYPY
    if (PyObject_TypeCheck(method, &PyWrapperDescr_Type)) {
        return PyClassMethod_New(method);
    }
#else
    static PyTypeObject *methoddescr_type = NULL;
    if (methoddescr_type == NULL) {
       PyObject *meth = PyObject_GetAttrString((PyObject*)&PyList_Type, "append");
       if (!meth) return NULL;
       methoddescr_type = Py_TYPE(meth);
       Py_DECREF(meth);
    }
    if (PyObject_TypeCheck(method, methoddescr_type)) {
        PyMethodDescrObject *descr = (PyMethodDescrObject *)method;
        #if PY_VERSION_HEX < 0x03020000
        PyTypeObject *d_type = descr->d_type;
        #else
        PyTypeObject *d_type = descr->d_common.d_type;
        #endif
        return PyDescr_NewClassMethod(d_type, descr->d_method);
    }
#endif
    else if (PyMethod_Check(method)) {
        return PyClassMethod_New(PyMethod_GET_FUNCTION(method));
    }
    else if (PyCFunction_Check(method)) {
        return PyClassMethod_New(method);
    }
#ifdef __Pyx_CyFunction_USED
    else if (PyObject_TypeCheck(method, __pyx_CyFunctionType)) {
        return PyClassMethod_New(method);
    }
#endif
    PyErr_SetString(PyExc_TypeError,
                   "Class-level classmethod() can only be called on "
                   "a method_descriptor or instance method.");
    return NULL;
}

static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
    const long neg_one = (long) -1, const_zero = (long) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(long) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (long) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case  1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
                            return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
                            return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
                            return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (long) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(long) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) digits[0])
                case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(long) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
            } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            long val;
            PyObject *v = __Pyx_PyNumber_Int(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (long) -1;
        }
    } else {
        long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (long) -1;
        val = __Pyx_PyInt_As_long(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to long");
    return (long) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to long");
    return (long) -1;
}

static int __Pyx_check_binary_version(void) {
    char ctversion[4], rtversion[4];
    PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
    PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
    if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
        char message[200];
        PyOS_snprintf(message, sizeof(message),
                      "compiletime version %s of module '%.100s' "
                      "does not match runtime version %s",
                      ctversion, __Pyx_MODULE_NAME, rtversion);
        return PyErr_WarnEx(NULL, message, 1);
    }
    return 0;
}

#ifndef __PYX_HAVE_RT_ImportModule
#define __PYX_HAVE_RT_ImportModule
static PyObject *__Pyx_ImportModule(const char *name) {
    PyObject *py_name = 0;
    PyObject *py_module = 0;
    py_name = __Pyx_PyIdentifier_FromString(name);
    if (!py_name)
        goto bad;
    py_module = PyImport_Import(py_name);
    Py_DECREF(py_name);
    return py_module;
bad:
    Py_XDECREF(py_name);
    return 0;
}
#endif

#ifndef __PYX_HAVE_RT_ImportType
#define __PYX_HAVE_RT_ImportType
static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
    size_t size, int strict)
{
    PyObject *py_module = 0;
    PyObject *result = 0;
    PyObject *py_name = 0;
    char warning[200];
    Py_ssize_t basicsize;
#ifdef Py_LIMITED_API
    PyObject *py_basicsize;
#endif
    py_module = __Pyx_ImportModule(module_name);
    if (!py_module)
        goto bad;
    py_name = __Pyx_PyIdentifier_FromString(class_name);
    if (!py_name)
        goto bad;
    result = PyObject_GetAttr(py_module, py_name);
    Py_DECREF(py_name);
    py_name = 0;
    Py_DECREF(py_module);
    py_module = 0;
    if (!result)
        goto bad;
    if (!PyType_Check(result)) {
        PyErr_Format(PyExc_TypeError,
            "%.200s.%.200s is not a type object",
            module_name, class_name);
        goto bad;
    }
#ifndef Py_LIMITED_API
    basicsize = ((PyTypeObject *)result)->tp_basicsize;
#else
    py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
    if (!py_basicsize)
        goto bad;
    basicsize = PyLong_AsSsize_t(py_basicsize);
    Py_DECREF(py_basicsize);
    py_basicsize = 0;
    if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
        goto bad;
#endif
    if (!strict && (size_t)basicsize > size) {
        PyOS_snprintf(warning, sizeof(warning),
            "%s.%s size changed, may indicate binary incompatibility",
            module_name, class_name);
        if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
    }
    else if ((size_t)basicsize != size) {
        PyErr_Format(PyExc_ValueError,
            "%.200s.%.200s has the wrong size, try recompiling",
            module_name, class_name);
        goto bad;
    }
    return (PyTypeObject *)result;
bad:
    Py_XDECREF(py_module);
    Py_XDECREF(result);
    return NULL;
}
#endif

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        #if PY_MAJOR_VERSION < 3
        if (t->is_unicode) {
            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
        } else if (t->intern) {
            *t->p = PyString_InternFromString(t->s);
        } else {
            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
        }
        #else
        if (t->is_unicode | t->is_str) {
            if (t->intern) {
                *t->p = PyUnicode_InternFromString(t->s);
            } else if (t->encoding) {
                *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
            } else {
                *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
            }
        } else {
            *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
        }
        #endif
        if (!*t->p)
            return -1;
        ++t;
    }
    return 0;
}

static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
    return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
}
static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
    Py_ssize_t ignore;
    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
}
static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
#if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
    if (
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
            __Pyx_sys_getdefaultencoding_not_ascii &&
#endif
            PyUnicode_Check(o)) {
#if PY_VERSION_HEX < 0x03030000
        char* defenc_c;
        PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
        if (!defenc) return NULL;
        defenc_c = PyBytes_AS_STRING(defenc);
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        {
            char* end = defenc_c + PyBytes_GET_SIZE(defenc);
            char* c;
            for (c = defenc_c; c < end; c++) {
                if ((unsigned char) (*c) >= 128) {
                    PyUnicode_AsASCIIString(o);
                    return NULL;
                }
            }
        }
#endif
        *length = PyBytes_GET_SIZE(defenc);
        return defenc_c;
#else
        if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        if (PyUnicode_IS_ASCII(o)) {
            *length = PyUnicode_GET_LENGTH(o);
            return PyUnicode_AsUTF8(o);
        } else {
            PyUnicode_AsASCIIString(o);
            return NULL;
        }
#else
        return PyUnicode_AsUTF8AndSize(o, length);
#endif
#endif
    } else
#endif
#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
    if (PyByteArray_Check(o)) {
        *length = PyByteArray_GET_SIZE(o);
        return PyByteArray_AS_STRING(o);
    } else
#endif
    {
        char* result;
        int r = PyBytes_AsStringAndSize(o, &result, length);
        if (unlikely(r < 0)) {
            return NULL;
        } else {
            return result;
        }
    }
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
  PyNumberMethods *m;
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_MAJOR_VERSION < 3
  if (PyInt_Check(x) || PyLong_Check(x))
#else
  if (PyLong_Check(x))
#endif
    return __Pyx_NewRef(x);
  m = Py_TYPE(x)->tp_as_number;
#if PY_MAJOR_VERSION < 3
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = PyNumber_Long(x);
  }
#else
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Long(x);
  }
#endif
  if (res) {
#if PY_MAJOR_VERSION < 3
    if (!PyInt_Check(res) && !PyLong_Check(res)) {
#else
    if (!PyLong_Check(res)) {
#endif
      PyErr_Format(PyExc_TypeError,
                   "__%.4s__ returned non-%.4s (type %.200s)",
                   name, name, Py_TYPE(res)->tp_name);
      Py_DECREF(res);
      return NULL;
    }
  }
  else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_TypeError,
                    "an integer is required");
  }
  return res;
}
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject *x;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_CheckExact(b))) {
    if (sizeof(Py_ssize_t) >= sizeof(long))
        return PyInt_AS_LONG(b);
    else
        return PyInt_AsSsize_t(x);
  }
#endif
  if (likely(PyLong_CheckExact(b))) {
    #if CYTHON_USE_PYLONG_INTERNALS
    const digit* digits = ((PyLongObject*)b)->ob_digit;
    const Py_ssize_t size = Py_SIZE(b);
    if (likely(__Pyx_sst_abs(size) <= 1)) {
        ival = likely(size) ? digits[0] : 0;
        if (size == -1) ival = -ival;
        return ival;
    } else {
      switch (size) {
         case 2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
      }
    }
    #endif
    return PyLong_AsSsize_t(b);
  }
  x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
    return PyInt_FromSize_t(ival);
}


#endif /* Py_PYTHON_H */
