/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 3.0.11
 *
 * This file is not intended to be easily readable and contains a number of
 * coding conventions designed to improve portability and efficiency. Do not make
 * changes to this file unless you know what you are doing--modify the SWIG
 * interface file instead.
 * ----------------------------------------------------------------------------- */

#include <cmath>
#ifdef _XOPEN_SOURCE
#undef _XOPEN_SOURCE
#endif
#ifdef _POSIX_C_SOURCE
#undef _POSIX_C_SOURCE
#endif


#define SWIG_PYTHON_OUTPUT_TUPLE


#define SWIGMATLAB
#define SWIG_name_d      "casadi"
#define SWIG_name        casadi

#define SWIG_op_prefix        "op_"
#define SWIG_pkg_name        "casadi"
#define SwigVar_mxArray mxArray*
#define SWIG_DIRECTORS


#ifdef __cplusplus
/* SwigValueWrapper is described in swig.swg */
template<typename T> class SwigValueWrapper {
  struct SwigMovePointer {
    T *ptr;
    SwigMovePointer(T *p) : ptr(p) { }
    ~SwigMovePointer() { delete ptr; }
    SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; }
  } pointer;
  SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
  SwigValueWrapper(const SwigValueWrapper<T>& rhs);
public:
  SwigValueWrapper() : pointer(0) { }
  SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; }
  operator T&() const { return *pointer.ptr; }
  T *operator&() { return pointer.ptr; }
};

template <typename T> T SwigValueInit() {
  return T();
}
#endif

/* -----------------------------------------------------------------------------
 *  This section contains generic SWIG labels for method/variable
 *  declarations/attributes, and other compiler dependent labels.
 * ----------------------------------------------------------------------------- */

/* template workaround for compilers that cannot correctly implement the C++ standard */
#ifndef SWIGTEMPLATEDISAMBIGUATOR
# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
#  define SWIGTEMPLATEDISAMBIGUATOR template
# elif defined(__HP_aCC)
/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
#  define SWIGTEMPLATEDISAMBIGUATOR template
# else
#  define SWIGTEMPLATEDISAMBIGUATOR
# endif
#endif

/* inline attribute */
#ifndef SWIGINLINE
# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
#   define SWIGINLINE inline
# else
#   define SWIGINLINE
# endif
#endif

/* attribute recognised by some compilers to avoid 'unused' warnings */
#ifndef SWIGUNUSED
# if defined(__GNUC__)
#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
#     define SWIGUNUSED __attribute__ ((__unused__))
#   else
#     define SWIGUNUSED
#   endif
# elif defined(__ICC)
#   define SWIGUNUSED __attribute__ ((__unused__))
# else
#   define SWIGUNUSED
# endif
#endif

#ifndef SWIG_MSC_UNSUPPRESS_4505
# if defined(_MSC_VER)
#   pragma warning(disable : 4505) /* unreferenced local function has been removed */
# endif
#endif

#ifndef SWIGUNUSEDPARM
# ifdef __cplusplus
#   define SWIGUNUSEDPARM(p)
# else
#   define SWIGUNUSEDPARM(p) p SWIGUNUSED
# endif
#endif

/* internal SWIG method */
#ifndef SWIGINTERN
# define SWIGINTERN static SWIGUNUSED
#endif

/* internal inline SWIG method */
#ifndef SWIGINTERNINLINE
# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
#endif

/* exporting methods */
#if defined(__GNUC__)
#  if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
#    ifndef GCC_HASCLASSVISIBILITY
#      define GCC_HASCLASSVISIBILITY
#    endif
#  endif
#endif

#ifndef SWIGEXPORT
# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
#   if defined(STATIC_LINKED)
#     define SWIGEXPORT
#   else
#     define SWIGEXPORT __declspec(dllexport)
#   endif
# else
#   if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
#     define SWIGEXPORT __attribute__ ((visibility("default")))
#   else
#     define SWIGEXPORT
#   endif
# endif
#endif

/* calling conventions for Windows */
#ifndef SWIGSTDCALL
# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
#   define SWIGSTDCALL __stdcall
# else
#   define SWIGSTDCALL
# endif
#endif

/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
# define _CRT_SECURE_NO_DEPRECATE
#endif

/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
# define _SCL_SECURE_NO_DEPRECATE
#endif

/* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */
#if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES)
# define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
#endif

/* Intel's compiler complains if a variable which was never initialised is
 * cast to void, which is a common idiom which we use to indicate that we
 * are aware a variable isn't used.  So we just silence that warning.
 * See: https://github.com/swig/swig/issues/192 for more discussion.
 */
#ifdef __INTEL_COMPILER
# pragma warning disable 592
#endif


/* Workaround, Octave's mex.h lacks uint64_t */
#include <stdint.h>
/* MATLAB's C-API */
#include <mex.h>
/* MISC C libraries */
#include <math.h>
#include <string.h>
#include <stdarg.h>
#include <stdio.h>
#include <limits.h>

/* -----------------------------------------------------------------------------
 * swigrun.swg
 *
 * This file contains generic C API SWIG runtime support for pointer
 * type checking.
 * ----------------------------------------------------------------------------- */

/* This should only be incremented when either the layout of swig_type_info changes,
   or for whatever reason, the runtime changes incompatibly */
#define SWIG_RUNTIME_VERSION "4"

/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
#ifdef SWIG_TYPE_TABLE
# define SWIG_QUOTE_STRING(x) #x
# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
#else
# define SWIG_TYPE_TABLE_NAME
#endif

/*
  You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
  creating a static or dynamic library from the SWIG runtime code.
  In 99.9% of the cases, SWIG just needs to declare them as 'static'.

  But only do this if strictly necessary, ie, if you have problems
  with your compiler or suchlike.
*/

#ifndef SWIGRUNTIME
# define SWIGRUNTIME SWIGINTERN
#endif

#ifndef SWIGRUNTIMEINLINE
# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
#endif

/*  Generic buffer size */
#ifndef SWIG_BUFFER_SIZE
# define SWIG_BUFFER_SIZE 1024
#endif

/* Flags for pointer conversions */
#define SWIG_POINTER_DISOWN        0x1
#define SWIG_CAST_NEW_MEMORY       0x2

/* Flags for new pointer objects */
#define SWIG_POINTER_OWN           0x1


/*
   Flags/methods for returning states.

   The SWIG conversion methods, as ConvertPtr, return an integer
   that tells if the conversion was successful or not. And if not,
   an error code can be returned (see swigerrors.swg for the codes).

   Use the following macros/flags to set or process the returning
   states.

   In old versions of SWIG, code such as the following was usually written:

     if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
       // success code
     } else {
       //fail code
     }

   Now you can be more explicit:

    int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
    if (SWIG_IsOK(res)) {
      // success code
    } else {
      // fail code
    }

   which is the same really, but now you can also do

    Type *ptr;
    int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
    if (SWIG_IsOK(res)) {
      // success code
      if (SWIG_IsNewObj(res) {
        ...
	delete *ptr;
      } else {
        ...
      }
    } else {
      // fail code
    }

   I.e., now SWIG_ConvertPtr can return new objects and you can
   identify the case and take care of the deallocation. Of course that
   also requires SWIG_ConvertPtr to return new result values, such as

      int SWIG_ConvertPtr(obj, ptr,...) {
        if (<obj is ok>) {
          if (<need new object>) {
            *ptr = <ptr to new allocated object>;
            return SWIG_NEWOBJ;
          } else {
            *ptr = <ptr to old object>;
            return SWIG_OLDOBJ;
          }
        } else {
          return SWIG_BADOBJ;
        }
      }

   Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
   more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
   SWIG errors code.

   Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
   allows to return the 'cast rank', for example, if you have this

       int food(double)
       int fooi(int);

   and you call

      food(1)   // cast rank '1'  (1 -> 1.0)
      fooi(1)   // cast rank '0'

   just use the SWIG_AddCast()/SWIG_CheckState()
*/

#define SWIG_OK                    (0)
#define SWIG_ERROR                 (-1)
#define SWIG_IsOK(r)               (r >= 0)
#define SWIG_ArgError(r)           ((r != SWIG_ERROR) ? r : SWIG_TypeError)

/* The CastRankLimit says how many bits are used for the cast rank */
#define SWIG_CASTRANKLIMIT         (1 << 8)
/* The NewMask denotes the object was created (using new/malloc) */
#define SWIG_NEWOBJMASK            (SWIG_CASTRANKLIMIT  << 1)
/* The TmpMask is for in/out typemaps that use temporal objects */
#define SWIG_TMPOBJMASK            (SWIG_NEWOBJMASK << 1)
/* Simple returning values */
#define SWIG_BADOBJ                (SWIG_ERROR)
#define SWIG_OLDOBJ                (SWIG_OK)
#define SWIG_NEWOBJ                (SWIG_OK | SWIG_NEWOBJMASK)
#define SWIG_TMPOBJ                (SWIG_OK | SWIG_TMPOBJMASK)
/* Check, add and del mask methods */
#define SWIG_AddNewMask(r)         (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
#define SWIG_DelNewMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
#define SWIG_IsNewObj(r)           (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
#define SWIG_AddTmpMask(r)         (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
#define SWIG_DelTmpMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
#define SWIG_IsTmpObj(r)           (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))

/* Cast-Rank Mode */
#if defined(SWIG_CASTRANK_MODE)
#  ifndef SWIG_TypeRank
#    define SWIG_TypeRank             unsigned long
#  endif
#  ifndef SWIG_MAXCASTRANK            /* Default cast allowed */
#    define SWIG_MAXCASTRANK          (2)
#  endif
#  define SWIG_CASTRANKMASK          ((SWIG_CASTRANKLIMIT) -1)
#  define SWIG_CastRank(r)           (r & SWIG_CASTRANKMASK)
SWIGINTERNINLINE int SWIG_AddCast(int r) {
  return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
}
SWIGINTERNINLINE int SWIG_CheckState(int r) {
  return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
}
#else /* no cast-rank mode */
#  define SWIG_AddCast(r) (r)
#  define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
#endif


#include <string.h>

#ifdef __cplusplus
extern "C" {
#endif

typedef void *(*swig_converter_func)(void *, int *);
typedef struct swig_type_info *(*swig_dycast_func)(void **);

/* Structure to store information on one type */
typedef struct swig_type_info {
  const char             *name;			/* mangled name of this type */
  const char             *str;			/* human readable name of this type */
  swig_dycast_func        dcast;		/* dynamic cast function down a hierarchy */
  struct swig_cast_info  *cast;			/* linked list of types that can cast into this type */
  void                   *clientdata;		/* language specific type data */
  int                    owndata;		/* flag if the structure owns the clientdata */
} swig_type_info;

/* Structure to store a type and conversion function used for casting */
typedef struct swig_cast_info {
  swig_type_info         *type;			/* pointer to type that is equivalent to this type */
  swig_converter_func     converter;		/* function to cast the void pointers */
  struct swig_cast_info  *next;			/* pointer to next cast in linked list */
  struct swig_cast_info  *prev;			/* pointer to the previous cast */
} swig_cast_info;

/* Structure used to store module information
 * Each module generates one structure like this, and the runtime collects
 * all of these structures and stores them in a circularly linked list.*/
typedef struct swig_module_info {
  swig_type_info         **types;		/* Array of pointers to swig_type_info structures that are in this module */
  size_t                 size;		        /* Number of types in this module */
  struct swig_module_info *next;		/* Pointer to next element in circularly linked list */
  swig_type_info         **type_initial;	/* Array of initially generated type structures */
  swig_cast_info         **cast_initial;	/* Array of initially generated casting structures */
  void                    *clientdata;		/* Language specific module data */
} swig_module_info;

/*
  Compare two type names skipping the space characters, therefore
  "char*" == "char *" and "Class<int>" == "Class<int >", etc.

  Return 0 when the two name types are equivalent, as in
  strncmp, but skipping ' '.
*/
SWIGRUNTIME int
SWIG_TypeNameComp(const char *f1, const char *l1,
		  const char *f2, const char *l2) {
  for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
    while ((*f1 == ' ') && (f1 != l1)) ++f1;
    while ((*f2 == ' ') && (f2 != l2)) ++f2;
    if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
  }
  return (int)((l1 - f1) - (l2 - f2));
}

/*
  Check type equivalence in a name list like <name1>|<name2>|...
  Return 0 if equal, -1 if nb < tb, 1 if nb > tb
*/
SWIGRUNTIME int
SWIG_TypeCmp(const char *nb, const char *tb) {
  int equiv = 1;
  const char* te = tb + strlen(tb);
  const char* ne = nb;
  while (equiv != 0 && *ne) {
    for (nb = ne; *ne; ++ne) {
      if (*ne == '|') break;
    }
    equiv = SWIG_TypeNameComp(nb, ne, tb, te);
    if (*ne) ++ne;
  }
  return equiv;
}

/*
  Check type equivalence in a name list like <name1>|<name2>|...
  Return 0 if not equal, 1 if equal
*/
SWIGRUNTIME int
SWIG_TypeEquiv(const char *nb, const char *tb) {
  return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0;
}

/*
  Check the typename
*/
SWIGRUNTIME swig_cast_info *
SWIG_TypeCheck(const char *c, swig_type_info *ty) {
  if (ty) {
    swig_cast_info *iter = ty->cast;
    while (iter) {
      if (strcmp(iter->type->name, c) == 0) {
        if (iter == ty->cast)
          return iter;
        /* Move iter to the top of the linked list */
        iter->prev->next = iter->next;
        if (iter->next)
          iter->next->prev = iter->prev;
        iter->next = ty->cast;
        iter->prev = 0;
        if (ty->cast) ty->cast->prev = iter;
        ty->cast = iter;
        return iter;
      }
      iter = iter->next;
    }
  }
  return 0;
}

/*
  Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
*/
SWIGRUNTIME swig_cast_info *
SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
  if (ty) {
    swig_cast_info *iter = ty->cast;
    while (iter) {
      if (iter->type == from) {
        if (iter == ty->cast)
          return iter;
        /* Move iter to the top of the linked list */
        iter->prev->next = iter->next;
        if (iter->next)
          iter->next->prev = iter->prev;
        iter->next = ty->cast;
        iter->prev = 0;
        if (ty->cast) ty->cast->prev = iter;
        ty->cast = iter;
        return iter;
      }
      iter = iter->next;
    }
  }
  return 0;
}

/*
  Cast a pointer up an inheritance hierarchy
*/
SWIGRUNTIMEINLINE void *
SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
  return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
}

/*
   Dynamic pointer casting. Down an inheritance hierarchy
*/
SWIGRUNTIME swig_type_info *
SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
  swig_type_info *lastty = ty;
  if (!ty || !ty->dcast) return ty;
  while (ty && (ty->dcast)) {
    ty = (*ty->dcast)(ptr);
    if (ty) lastty = ty;
  }
  return lastty;
}

/*
  Return the name associated with this type
*/
SWIGRUNTIMEINLINE const char *
SWIG_TypeName(const swig_type_info *ty) {
  return ty->name;
}

/*
  Return the pretty name associated with this type,
  that is an unmangled type name in a form presentable to the user.
*/
SWIGRUNTIME const char *
SWIG_TypePrettyName(const swig_type_info *type) {
  /* The "str" field contains the equivalent pretty names of the
     type, separated by vertical-bar characters.  We choose
     to print the last name, as it is often (?) the most
     specific. */
  if (!type) return NULL;
  if (type->str != NULL) {
    const char *last_name = type->str;
    const char *s;
    for (s = type->str; *s; s++)
      if (*s == '|') last_name = s+1;
    return last_name;
  }
  else
    return type->name;
}

/*
   Set the clientdata field for a type
*/
SWIGRUNTIME void
SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
  swig_cast_info *cast = ti->cast;
  /* if (ti->clientdata == clientdata) return; */
  ti->clientdata = clientdata;

  while (cast) {
    if (!cast->converter) {
      swig_type_info *tc = cast->type;
      if (!tc->clientdata) {
	SWIG_TypeClientData(tc, clientdata);
      }
    }
    cast = cast->next;
  }
}
SWIGRUNTIME void
SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
  SWIG_TypeClientData(ti, clientdata);
  ti->owndata = 1;
}

/*
  Search for a swig_type_info structure only by mangled name
  Search is a O(log #types)

  We start searching at module start, and finish searching when start == end.
  Note: if start == end at the beginning of the function, we go all the way around
  the circular list.
*/
SWIGRUNTIME swig_type_info *
SWIG_MangledTypeQueryModule(swig_module_info *start,
                            swig_module_info *end,
		            const char *name) {
  swig_module_info *iter = start;
  do {
    if (iter->size) {
      size_t l = 0;
      size_t r = iter->size - 1;
      do {
	/* since l+r >= 0, we can (>> 1) instead (/ 2) */
	size_t i = (l + r) >> 1;
	const char *iname = iter->types[i]->name;
	if (iname) {
	  int compare = strcmp(name, iname);
	  if (compare == 0) {
	    return iter->types[i];
	  } else if (compare < 0) {
	    if (i) {
	      r = i - 1;
	    } else {
	      break;
	    }
	  } else if (compare > 0) {
	    l = i + 1;
	  }
	} else {
	  break; /* should never happen */
	}
      } while (l <= r);
    }
    iter = iter->next;
  } while (iter != end);
  return 0;
}

/*
  Search for a swig_type_info structure for either a mangled name or a human readable name.
  It first searches the mangled names of the types, which is a O(log #types)
  If a type is not found it then searches the human readable names, which is O(#types).

  We start searching at module start, and finish searching when start == end.
  Note: if start == end at the beginning of the function, we go all the way around
  the circular list.
*/
SWIGRUNTIME swig_type_info *
SWIG_TypeQueryModule(swig_module_info *start,
                     swig_module_info *end,
		     const char *name) {
  /* STEP 1: Search the name field using binary search */
  swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
  if (ret) {
    return ret;
  } else {
    /* STEP 2: If the type hasn't been found, do a complete search
       of the str field (the human readable name) */
    swig_module_info *iter = start;
    do {
      size_t i = 0;
      for (; i < iter->size; ++i) {
	if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
	  return iter->types[i];
      }
      iter = iter->next;
    } while (iter != end);
  }

  /* neither found a match */
  return 0;
}

/*
   Pack binary data into a string
*/
SWIGRUNTIME char *
SWIG_PackData(char *c, void *ptr, size_t sz) {
  static const char hex[17] = "0123456789abcdef";
  const unsigned char *u = (unsigned char *) ptr;
  const unsigned char *eu =  u + sz;
  for (; u != eu; ++u) {
    unsigned char uu = *u;
    *(c++) = hex[(uu & 0xf0) >> 4];
    *(c++) = hex[uu & 0xf];
  }
  return c;
}

/*
   Unpack binary data from a string
*/
SWIGRUNTIME const char *
SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
  unsigned char *u = (unsigned char *) ptr;
  const unsigned char *eu = u + sz;
  for (; u != eu; ++u) {
    char d = *(c++);
    unsigned char uu;
    if ((d >= '0') && (d <= '9'))
      uu = (unsigned char)((d - '0') << 4);
    else if ((d >= 'a') && (d <= 'f'))
      uu = (unsigned char)((d - ('a'-10)) << 4);
    else
      return (char *) 0;
    d = *(c++);
    if ((d >= '0') && (d <= '9'))
      uu |= (unsigned char)(d - '0');
    else if ((d >= 'a') && (d <= 'f'))
      uu |= (unsigned char)(d - ('a'-10));
    else
      return (char *) 0;
    *u = uu;
  }
  return c;
}

/*
   Pack 'void *' into a string buffer.
*/
SWIGRUNTIME char *
SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
  char *r = buff;
  if ((2*sizeof(void *) + 2) > bsz) return 0;
  *(r++) = '_';
  r = SWIG_PackData(r,&ptr,sizeof(void *));
  if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
  strcpy(r,name);
  return buff;
}

SWIGRUNTIME const char *
SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
  if (*c != '_') {
    if (strcmp(c,"NULL") == 0) {
      *ptr = (void *) 0;
      return name;
    } else {
      return 0;
    }
  }
  return SWIG_UnpackData(++c,ptr,sizeof(void *));
}

SWIGRUNTIME char *
SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
  char *r = buff;
  size_t lname = (name ? strlen(name) : 0);
  if ((2*sz + 2 + lname) > bsz) return 0;
  *(r++) = '_';
  r = SWIG_PackData(r,ptr,sz);
  if (lname) {
    strncpy(r,name,lname+1);
  } else {
    *r = 0;
  }
  return buff;
}

SWIGRUNTIME const char *
SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
  if (*c != '_') {
    if (strcmp(c,"NULL") == 0) {
      memset(ptr,0,sz);
      return name;
    } else {
      return 0;
    }
  }
  return SWIG_UnpackData(++c,ptr,sz);
}

#ifdef __cplusplus
}
#endif

/*  Errors in SWIG */
#define  SWIG_UnknownError    	   -1
#define  SWIG_IOError        	   -2
#define  SWIG_RuntimeError   	   -3
#define  SWIG_IndexError     	   -4
#define  SWIG_TypeError      	   -5
#define  SWIG_DivisionByZero 	   -6
#define  SWIG_OverflowError  	   -7
#define  SWIG_SyntaxError    	   -8
#define  SWIG_ValueError     	   -9
#define  SWIG_SystemError    	   -10
#define  SWIG_AttributeError 	   -11
#define  SWIG_MemoryError    	   -12
#define  SWIG_NullReferenceError   -13



/* Last error */
static int SWIG_lasterror_code = 0;
static char SWIG_lasterror_msg[1024];
SWIGRUNTIME void SWIG_Error(int code, const char *format, ...) {
  SWIG_lasterror_code = code;
  va_list arg;
  va_start(arg, format);
  vsnprintf(SWIG_lasterror_msg, sizeof(SWIG_lasterror_msg), format, arg);
  va_end(arg);
}

SWIGRUNTIME const char* SWIG_ErrorType(int code) {
  switch (code) {
  case SWIG_MemoryError:
    return "SWIG:MemoryError";
  case SWIG_IOError:
    return "SWIG:IOError";
  case SWIG_RuntimeError:
    return "SWIG:RuntimeError";
  case SWIG_IndexError:
    return "SWIG:IndexError";
  case SWIG_TypeError:
    return "SWIG:TypeError";
  case SWIG_DivisionByZero:
    return "SWIG:DivisionByZero";
  case SWIG_OverflowError:
    return "SWIG:OverflowError";
  case SWIG_SyntaxError:
    return "SWIG:SyntaxError";
  case SWIG_ValueError:
    return "SWIG:ValueError";
  case SWIG_SystemError:
    return "SWIG:SystemError";
  case SWIG_AttributeError:
    return "SWIG:AttributeError";
  }
  return "SWIG:UnknownError";
}

SWIGRUNTIME int SWIG_check_num_args(const char *func_name, int num_args, int max_args, int min_args, int varargs) {
  if (num_args > max_args && !varargs) {
    SWIG_Error(SWIG_RuntimeError, "function %s takes at most %i arguments", func_name, max_args);
  } else if (num_args < min_args) {
    SWIG_Error(SWIG_RuntimeError, "function %s requires at least %i arguments", func_name, min_args);
  } else {
    return 1;
  }
  return 0;
}

#define SWIG_fail                                       goto fail

#define SWIG_Matlab_ConvertPtr(obj, pptr, type, flags)  SWIG_Matlab_ConvertPtrAndOwn(obj, pptr, type, flags, 0)
#define SWIG_ConvertPtr(obj, pptr, type, flags)         SWIG_Matlab_ConvertPtr(obj, pptr, type, flags)
#define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own)  SWIG_Matlab_ConvertPtrAndOwn(obj, pptr, type, flags, own)
#define SWIG_ConvertPtr(obj, pptr, type, flags)         SWIG_Matlab_ConvertPtr(obj, pptr, type, flags)
#define SWIG_NewPointerObj(ptr, type, flags)            SWIG_Matlab_NewPointerObj(ptr, type, flags)
#define swig_owntype                                    int

#define SWIG_ConvertPacked(obj, ptr, sz, ty)            SWIG_Matlab_ConvertPacked(obj, ptr, sz, ty)
#define SWIG_NewPackedObj(ptr, sz, type)                SWIG_Matlab_NewPackedObj(ptr, sz, type)

#define SWIG_ConvertFunctionPtr(obj, pptr, type)        SWIG_ConvertPtr(obj, pptr, type, 0)
#define SWIG_NewFunctionPtrObj(ptr, type)               SWIG_NewPointerObj(ptr, type, 0)

#define SWIG_ConvertMember(obj, ptr, sz, ty)            SWIG_Matlab_ConvertPacked(obj, ptr, sz, ty)
#define SWIG_NewMemberObj(ptr, sz, type)                SWIG_Matlab_NewPackedObj(ptr, sz, type)

#define SWIG_GetModule(clientdata)                      SWIG_Matlab_GetModule(clientdata)
#define SWIG_SetModule(clientdata, pointer)             SWIG_Matlab_SetModule(pointer);
#define SWIG_MODULE_CLIENTDATA_TYPE void*

#define Matlab_Error_Occurred() 0
#define SWIG_Matlab_AddErrorMsg(msg) {;}

SWIGRUNTIME swig_module_info *SWIG_Matlab_GetModule(void *clientdata);
SWIGRUNTIME void SWIG_Matlab_SetModule(swig_module_info *pointer);

/* For backward compatibility only */
#define SWIG_POINTER_EXCEPTION  0
#define SWIG_arg_fail(arg)      0

/* Pointer to C/C++ object, including type information and reference counters */
typedef struct SwigPtr {
  void *ptr;
  swig_type_info *type;
  int own;
  void *self;
  struct SwigPtr* next;
} SwigPtr;
static swig_module_info *saved_swig_module = 0;

/* Add new pointer object to the memory allocator
   Returns the location of the new element by reference and a return flag by value.
 */
int SWIG_Matlab_NewPointer(SwigPtr** swig_ptr, void *ptr, swig_type_info *type, int own) {
  /* Check input arguments */
  if (!swig_ptr || !type) return 1;

  /* Allocate memory */
  SwigPtr *obj=(SwigPtr *)malloc(sizeof(SwigPtr));
  if (!obj) return 1;

  /* Initialize object */
  obj->ptr = ptr;
  obj->type = type;
  obj->own = own;
  obj->self = obj;
  obj->next = 0;

  /* Return memory reference and successful return */
  *swig_ptr = obj;
  return 0;
}

/* Free pointer object
   Returns a void* with the object to be freed (if any)
 */
void* SWIG_Matlab_DeletePointer(SwigPtr* p) {
  /* Quick return if null pointer? */
  if (p==0) return 0;

  /* Clear and free */
  void* ret = p->own ? p->ptr : 0;
  p->ptr=0;
  p->type=0;
  p->own=0;
  p->self=0;
  p->next=0;
  free(p);
  return ret;
}

/* This should probably be moved somewhere else */
#ifdef __cplusplus
extern "C"
#endif /* cplusplus */
void SWIG_Matlab_ExitFcn(void) {
  /* Unused at the moment */
}

SWIGRUNTIME int
SWIG_Matlab_CallInterp(int nlhs, mxArray *plhs[], int nrhs,
                       mxArray *prhs[], const char *functionName) {
#ifdef HAVE_OCTAVE
  return mexCallMATLAB(nlhs, plhs, nrhs, prhs, functionName);
#else
  mxArray* ex = mexCallMATLABWithTrap(nlhs, plhs, nrhs, prhs, functionName);
  if (ex) {
    mxDestroyArray(ex);
    return 1;
  } else {
    return 0;
  }
#endif
}

SWIGRUNTIME void SWIG_Matlab_Error(const char *message) {
#ifdef HAVE_OCTAVE
    mexErrMsgTxt(message);
#else
    mxArray *msg = mxCreateString(message);
    mexCallMATLAB(0, 0, 1, &msg, "error");
    mxDestroyArray(msg);
#endif
}

SWIGRUNTIME void SWIG_Matlab_ErrorId(const char *errorid, const char *message) {
#ifdef HAVE_OCTAVE
    mexErrMsgIdAndTxt(errorid, message);
#else
    mxArray *msg = mxCreateString(message);
    mxArray *id  = mxCreateString(errorid);
    mxArray *s  = mxCreateString("%s");
    mxArray *arg[3] = {id, s, msg};
    mexCallMATLAB(0, 0, 3, arg, "error");
    mxDestroyArray(msg);
    mxDestroyArray(id);
    mxDestroyArray(s);
#endif
}

SWIGRUNTIME mxArray*
SWIG_Matlab_CallInterpEx(int nlhs, mxArray *plhs[], int nrhs,
                       mxArray *prhs[], const char *functionName) {
#ifdef HAVE_OCTAVE
  int flag = mexCallMATLAB(nlhs, plhs, nrhs, prhs, functionName);
  if (flag) {
    SWIG_Matlab_ErrorId("SWIG:CallInterpEx","Not implemented for Octave");
  }
  return 0;
#else
  return mexCallMATLABWithTrap(nlhs, plhs, nrhs, prhs, functionName);
#endif
}

/* Convert a packed value value */
SWIGRUNTIME int
SWIG_Matlab_ConvertPacked(mxArray* SWIGUNUSEDPARM(pm), void* SWIGUNUSEDPARM(ptr), size_t SWIGUNUSEDPARM(sz), swig_type_info* SWIGUNUSEDPARM(ty)) {
  SWIG_Matlab_ErrorId("SWIG:ConvertPacked","Not implemented");
  return SWIG_ERROR;
}

/* Runtime API implementation */
SWIGRUNTIME mxArray* SWIG_Matlab_NewPointerObj(void *ptr, swig_type_info *type, int flags) {
  /* Ownership? */
  int own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0;

  /* Allocate a pointer object */
  SwigPtr* swig_ptr = 0;
  if (SWIG_Matlab_NewPointer(&swig_ptr, ptr, type, own)) {
    SWIG_Matlab_ErrorId("SWIG:NewPointerObj","Cannot allocate pointer");
  }

  /* Create a SwigRef instance */
  mxArray* pm = 0;
  int ex = SWIG_Matlab_CallInterp(1, &pm, 0, 0, "SwigRef");
  if (ex) SWIG_Matlab_ErrorId("SWIG:NewPointerObj", "Cannot create SwigRef instance");

  /* Set pointer property */
  mxArray *pm_ptr = mxCreateNumericMatrix(1, 1, mxUINT64_CLASS, mxREAL);
  *(uint64_T *)mxGetData(pm_ptr) = (uint64_T)swig_ptr;
  if(!pm_ptr) SWIG_Matlab_ErrorId("SWIG:NewPointerObj", "mxCreateNumericMatrix failed");

#ifdef HAVE_OCTAVE
  mxArray *rhs[2] = {pm, pm_ptr};
  mexCallMATLAB(0, 0, 2, rhs, "SwigSet");
#else
  mxSetProperty(pm, 0, "swigPtr", pm_ptr);
#endif
  mxDestroyArray(pm_ptr);

  /* Create a proxy class of the desired type */
  if (type->clientdata) {
    const char* matlab_classname = (const char *)type->clientdata;
    mxArray* pm_test = 0;
    ex = SWIG_Matlab_CallInterp(1, &pm_test, 1, &pm, matlab_classname);
    if (ex) {
      mexWarnMsgIdAndTxt("SWIG:NewPointerObj",
                         "NewPointerObj problem. creating SwigRef as opposed to %s", matlab_classname);
    } else {
      mxDestroyArray(pm);
      pm = pm_test;
    }
  }

  return pm;
}

/* Create a new packed object */

SWIGRUNTIMEINLINE mxArray*
SWIG_Matlab_NewPackedObj(void* SWIGUNUSEDPARM(ptr), size_t SWIGUNUSEDPARM(sz), swig_type_info* SWIGUNUSEDPARM(type)) {
  SWIG_Matlab_ErrorId("SWIG:NewPackedOb","Not implemented");
  return 0;
}

SWIGRUNTIME int SWIG_Matlab_isOwned(mxArray* pm) {
  // Short-circuit for non-class types
  if (mxIsNumeric(pm) || mxIsLogical(pm) || mxIsCell(pm) || mxIsChar(pm)) return 0;
/* Get index, represented as a uint64_T scalar */
#ifdef HAVE_OCTAVE
  mxArray *pm_ptr;
  mexCallMATLAB(1, &pm_ptr, 1, &pm, "SwigGet");
#else
  mxArray *pm_ptr = mxGetProperty(pm, 0, "swigPtr");
#endif
  if(!pm_ptr || mxGetNumberOfElements(pm_ptr) != 1 ||
     mxGetClassID(pm_ptr) != mxUINT64_CLASS || mxIsComplex(pm_ptr)) {
    if(pm_ptr) mxDestroyArray(pm_ptr);
    return SWIG_ERROR;
  }
  SwigPtr* p = (SwigPtr*)(*(uint64_T*)mxGetData(pm_ptr));
  mxDestroyArray(pm_ptr);

  return p ? p->own : 0;
}

SWIGRUNTIME SwigPtr* SWIG_Matlab_getSwigPtr(mxArray* pm) {
  // Short-circuit for non-class types
  if (mxIsNumeric(pm) || mxIsLogical(pm) || mxIsCell(pm) || mxIsChar(pm)) return 0;
/* Get index, represented as a uint64_T scalar */
#ifdef HAVE_OCTAVE
  mxArray *pm_ptr;
  mexCallMATLAB(1, &pm_ptr, 1, &pm, "SwigGet");
#else
  mxArray *pm_ptr = mxGetProperty(pm, 0, "swigPtr");
#endif
  if(!pm_ptr || mxGetNumberOfElements(pm_ptr) != 1 ||
     mxGetClassID(pm_ptr) != mxUINT64_CLASS || mxIsComplex(pm_ptr)) {
    if(pm_ptr) mxDestroyArray(pm_ptr);
    return 0;
  }
  SwigPtr* p = (SwigPtr*)(*(uint64_T*)mxGetData(pm_ptr));
  mxDestroyArray(pm_ptr);

  /* Consistency check */
  if (p->self != p) return 0;

  /* Get pointer object */
  return p;
}

SWIGRUNTIME int SWIG_Matlab_ConvertPtrAndOwn(mxArray* pm, void **ptr, swig_type_info *type, int flags, int *own) {
  // Short-circuit for non-class types
  if (mxIsNumeric(pm) || mxIsLogical(pm) || mxIsCell(pm) || mxIsChar(pm)) return SWIG_ERROR;
  /* Get index, represented as a uint64_T scalar */
#ifdef HAVE_OCTAVE
  mxArray *pm_ptr;
  mexCallMATLAB(1, &pm_ptr, 1, &pm, "SwigGet");
#else
  mxArray *pm_ptr = mxGetProperty(pm, 0, "swigPtr");
#endif
  if(!pm_ptr || mxGetNumberOfElements(pm_ptr) != 1 ||
     mxGetClassID(pm_ptr) != mxUINT64_CLASS || mxIsComplex(pm_ptr)){
    if(pm_ptr) mxDestroyArray(pm_ptr);
    return SWIG_ERROR;
  }
  SwigPtr* swig_ptr = (SwigPtr*)(*(uint64_T*)mxGetData(pm_ptr));
  mxDestroyArray(pm_ptr);

  /* Get pointer object */
  if (!swig_ptr) return SWIG_ERROR;

  swig_cast_info *tc;
  int same_type = 0;
  SwigPtr* p=swig_ptr;
  while (p) {
    /* Loop over types */
    swig_type_info *p_type = p->type;

    /* No type cast needed */
    if (p_type==type || !type) {
      same_type = 1;
      break;
    }

    /* Check if type conversion is possible */
    tc = SWIG_TypeCheck(p_type->name, type);
    if (tc) break;

    /* Check next type */
    p = p->next;
  }

  /* Conversion not possible */
  if (!same_type && !tc) return SWIG_ERROR;

  /* Get data */
  if (ptr) *ptr = p->ptr;
  if (own) *own = p->own;

  /* Set ownership marker to false? */
  if(flags & SWIG_POINTER_DISOWN){
    SWIG_Matlab_DeletePointer(swig_ptr);
  }

  /* No type cast needed */
  if (same_type || !ptr) {
    return SWIG_OK;
  }

  /* Do type-cast */
  int newmemory = 0;
  *ptr = SWIG_TypeCast(tc, *ptr, &newmemory);
  if (newmemory == SWIG_CAST_NEW_MEMORY) {
    if (own) {
      *own = *own | SWIG_CAST_NEW_MEMORY;
    } else {
      /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */
      SWIG_Matlab_ErrorId("SWIG:ConvertPointerObj", "SWIG error in converting pointer. Bad typemap?");
      return SWIG_ERROR;
    }
  }
  return SWIG_OK;
}

SWIGRUNTIME swig_module_info *SWIG_Matlab_GetModule(void *SWIGUNUSEDPARM(clientdata)) {
  if (!saved_swig_module) {
    /* First call for this module, fetch pointer from MATLAB */
    mxArray* mem = 0;
    int flag = mexCallMATLAB(1, &mem, 0, 0, "SwigMem");
    if (flag || !mem) SWIG_Matlab_ErrorId("SWIG:GetModule", "Cannot call SwigMem");
    /* On first call, mem is an empty matrix */
    if (mxGetNumberOfElements(mem)!= 0) {
      if (!mxIsStruct(mem)) {
        SWIG_Matlab_ErrorId("SWIG:GetModule", "Corrupted memory");
      }
      mxArray *module = mxGetField(mem, 0,
        "swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME);
      if (module && mxGetNumberOfElements(module) == 1 && mxGetClassID(module) == mxUINT64_CLASS && !mxIsComplex(module)) {
        /* Cast memory as a pointer */
        saved_swig_module = (swig_module_info*)(*(uint64_T*)mxGetData(module));
      }
    }
    mxDestroyArray(mem);
  }
  return saved_swig_module;
}

SWIGRUNTIME void SWIG_Matlab_SetModule(swig_module_info *pointer) {
  mxArray* mem = 0;
  const char *fields[1] = {"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME};
  int flag = mexCallMATLAB(1, &mem, 0, 0, "SwigMem");
  if (flag || !mem) SWIG_Matlab_ErrorId("SWIG:SetModule", "Cannot call SwigMem");
  /* Under normal circumstances, swigMem is an empty matrix */
  /* but is not required to be for a valid call to SWIG_Matlab_SetModule() */
  if (mxGetNumberOfElements(mem) == 0) {
    mxDestroyArray(mem);
    mem = mxCreateStructMatrix(1,1,1,fields);
    if(!mem) SWIG_Matlab_ErrorId("SWIG:SetModule","mxCreateStructMatrix failed");
    mxArray *module = mxCreateNumericMatrix(1, 1, mxUINT64_CLASS, mxREAL);
    if(!module) SWIG_Matlab_ErrorId("SWIG:SetModule","mxCreateNumericMatrix failed");
    *(uint64_T *)mxGetData(module) = (uint64_T)pointer;
    mxSetField(mem, 0, fields[0], module);
  } else {
    int nfields = 0;
    int fieldNum = 0;
    /* Add to existing mem if not the same */
    if (!mxIsStruct(mem)) {
      SWIG_Matlab_ErrorId("SWIG:SetModule", "Corrupted memory");
    }
    nfields = mxGetNumberOfFields(mem);
    /* Check if same type table */
    int ii;
    for (ii=0; ii<nfields; ++ii){
      if(strcmp(mxGetFieldNameByNumber(mem, ii), fields[0]) == 0) {
        mxDestroyArray(mem);
        return;
      }
    }
    fieldNum = mxAddField(mem, fields[0]);
    if (fieldNum < 0) SWIG_Matlab_ErrorId("SWIG:SetModule", "Error adding field to SwigMem");
    mxArray *module = mxCreateNumericMatrix(1, 1, mxUINT64_CLASS, mxREAL);
    if(!module) SWIG_Matlab_ErrorId("SWIG:SetModule","mxCreateNumericMatrix failed");
    *(uint64_T *)mxGetData(module) = (uint64_T)pointer;
    mxSetFieldByNumber(mem, 0, fieldNum, module);
  }
  /* Set variable in SwigMem */
  flag = mexCallMATLAB(0, 0, 1, &mem, "SwigMem");
  mxDestroyArray(mem);
  if (flag) {
    SWIG_Matlab_ErrorId("SWIG:SetModule", "Could not set variable in SwigMem.\n");
  }
  saved_swig_module = pointer;
}

/* HACK HACK */
#define SWIG_Matlab_SetConstant(dummy1,dummy2,pm) (pm)

/* Convert Matlab arguments to a type description
 *
 * You must call SWIG_Python_str_DelForPy3() on the result after usage
*/
SWIGRUNTIME const char*
SWIG_Matlab_ArgsTypeDesc(int argc, mxArray *argv[]) {
  mxArray* mem = 0;
  const char* type_name = 0;
  int flag = mexCallMATLAB(1, &mem, argc, argv, "SwigType");
  if (!flag && mxIsChar(mem)) type_name = mxArrayToString(mem);
  return type_name;
}

#ifdef __cplusplus
#include <streambuf>
#include <iostream>
namespace swig {
  // Stream buffer to allow redirecting output to MATLAB
  class SWIG_Matlab_streambuf : public std::streambuf {
  public:
    SWIG_Matlab_streambuf() {}
  protected:
    virtual int_type overflow(int_type ch) {
      if(ch != traits_type::eof()) {
        mexPrintf("%c", static_cast<char>(ch));
      }
      return ch;
    }
    virtual std::streamsize xsputn(const char* s, std::streamsize num) {
      // Pass straight to mexPrintf without buffering
      mexPrintf("%.*s", static_cast<int>(num), s);
      return num;
    }
  };

  // Instantiation
  static SWIG_Matlab_streambuf SWIG_Matlab_buf;
} // namespace swig
#endif /* cplusplus */



#define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0) 

#define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else 



  #define SWIG_exception(code, msg) do { SWIG_Error(code, msg); SWIG_fail;; } while(0) 

/* -----------------------------------------------------------------------------
 * director.swg
 *
 * This file contains support for director classes so that Matlab proxy
 * methods can be called from C++.
 * ----------------------------------------------------------------------------- */

#ifndef SWIG_DIRECTOR_MATLAB_HEADER_
#define SWIG_DIRECTOR_MATLAB_HEADER_

#include <string>
#include <sstream>
#include <iostream>
#include <exception>
#include <vector>
#include <map>

/*
  Use -DSWIG_DIRECTOR_NO_UEH if you prefer to avoid the use of the
  Undefined Exception Handler provided by swig.
*/
#ifndef SWIG_DIRECTOR_NO_UEH
#ifndef SWIG_DIRECTOR_UEH
#define SWIG_DIRECTOR_UEH
#endif
#endif


/*
  Use -DSWIG_DIRECTOR_STATIC if you prefer to avoid the use of the
  'Swig' namespace. This could be useful for multi-modules projects.
*/
#ifdef SWIG_DIRECTOR_STATIC
/* Force anonymous (static) namespace */
#define Swig
#endif

# define SWIG_DIRECTOR_CAST(ARG) dynamic_cast<Swig::Director *>(ARG)
# define SWIG_DIRECTOR_RGTR(ARG1, ARG2)

extern "C" {
  struct swig_type_info;

  mxArray *mxCreateSharedDataCopy(const mxArray *mx);
  //mxArray *mxCreateReference(const mxArray *mx);

struct mxArray_Tag_Partial {
    void *name_or_CrossLinkReverse;
    mxClassID ClassID;
    int VariableType;
    mxArray *CrossLink;
    size_t ndim;
    unsigned int RefCount; /* Number of sub-elements identical to this one */
};

mxArray *mxCreateReference(const mxArray *mx)
{
    struct mxArray_Tag_Partial *my = (struct mxArray_Tag_Partial *) mx;
    ++my->RefCount;
    return (mxArray *) mx;
}
}



namespace Swig {

  /* memory handler */
  struct GCItem {
    virtual ~GCItem() {}

    virtual int get_own() const {
      return 0;
    }
  };

  struct GCItem_var {
    GCItem_var(GCItem *item = 0) : _item(item) {
    }

    GCItem_var& operator=(GCItem *item) {
      GCItem *tmp = _item;
      _item = item;
      delete tmp;
      return *this;
    }

    ~GCItem_var() {
      delete _item;
    }

    GCItem * operator->() const {
      return _item;
    }

  private:
    GCItem *_item;
  };

  struct GCItem_Object : GCItem {
    GCItem_Object(int own) : _own(own) {
    }

    virtual ~GCItem_Object() {
    }

    int get_own() const {
      return _own;
    }

  private:
    int _own;
  };

  template <typename Type>
  struct GCItem_T : GCItem {
    GCItem_T(Type *ptr) : _ptr(ptr) {
    }

    virtual ~GCItem_T() {
      delete _ptr;
    }

  private:
    Type *_ptr;
  };

  template <typename Type>
  struct GCArray_T : GCItem {
    GCArray_T(Type *ptr) : _ptr(ptr) {
    }

    virtual ~GCArray_T() {
      delete[] _ptr;
    }

  private:
    Type *_ptr;
  };

  /* base class for director exceptions */
  class DirectorException : public std::exception {
  protected:
    std::string swig_msg;
  public:
    DirectorException(const char *error, const char *hdr ="", const char *msg ="") : swig_msg(hdr) {
      if (msg[0]) {
        swig_msg += " ";
        swig_msg += msg;
      }
    }

    virtual ~DirectorException() throw() {
    }

    /* Deprecated, use what() instead */
    const char *getMessage() const {
      return what();
    }

    const char *what() const throw() {
      return swig_msg.c_str();
    }

    static void raise(const char *error, const char *msg) {
      throw DirectorException(error, msg);
    }

    static void raise(const char *msg) {
      raise("SWIG:DirectorRuntimeError", msg);
    }
  };

  /* unknown exception handler  */
  class UnknownExceptionHandler {
  };

  /* type mismatch in the return value from a matlab method call */
  class DirectorTypeMismatchException : public DirectorException {
  public:
    DirectorTypeMismatchException(const char *error, const char *msg)
      : DirectorException(error, "SWIG director type mismatch", msg) {
    }

    DirectorTypeMismatchException(const char *msg="")
      : DirectorException("SWIG:DirectorRuntimeError", "SWIG director type mismatch", msg) {
    }

    static void raise(const char *error, const char *msg) {
      throw DirectorTypeMismatchException(error, msg);
    }

    static void raise(const char *msg) {
      throw DirectorTypeMismatchException(msg);
    }
  };

  /* any matlab exception that occurs during a director method call */
  class DirectorMethodException : public DirectorException {
  public:
    DirectorMethodException(const char *msg = "")
      : DirectorException("SWIG:DirectorRuntimeError", "SWIG director method error.", msg) {
    }

    static void raise(const char *msg) {
      throw DirectorMethodException(msg);
    }
  };

  /* attempt to call a pure virtual method via a director method */
  class DirectorPureVirtualException : public DirectorException {
  public:
    DirectorPureVirtualException(const char *msg = "")
      : DirectorException("SWIG:DirectorRuntimeError", "SWIG director pure virtual method called", msg) {
    }

    static void raise(const char *msg) {
      throw DirectorPureVirtualException(msg);
    }
  };



# define SWIG_GUARD(mutex)


  /* director base class */
  class Director {
  private:
    /* reference counter */
    mutable int swig_refcount;

    /* flag indicating whether the object is owned by matlab or c++ */
    mutable bool swig_disown_flag;

    /* Name of field in MATLAB */
    std::string fieldname() const {
      std::stringstream ss;
      ss << "x" << this;
      return ss.str();
    }

    /* decrement the reference count of the wrapped matlab object */
    void swig_decref() {
      if (swig_disown_flag) {
        //mexPrintf("decref to %d\n", swig_refcount-1);

        if (--swig_refcount==0) {
          // Delete MATLAB storage
          std::string fname = fieldname();
          mxArray* field = mxCreateString(fname.c_str());
          mxArray* empty = mxCreateDoubleMatrix(0, 0, mxREAL);
          mxArray* rhs[2] = {field, empty};
          int error = SWIG_Matlab_CallInterp(0, 0, 2, rhs, "SwigStorage");
          mxDestroyArray(field);
          mxDestroyArray(empty);
          if (error) {
            SWIG_Matlab_ErrorId("SWIG:Director:swig_decref", "Cannot call SwigStorage");
          }
        }
      }
    }

  public:
    /* Constructor */
    Director(mxArray *self) : swig_refcount(0), swig_disown_flag(false) {
      // Save MATLAB in SwigStorage
      std::string fname = fieldname();
      mxArray* field = mxCreateString(fname.c_str());
      mxArray* rhs[2] = {field, self};
      int error = SWIG_Matlab_CallInterp(0, 0, 2, rhs, "SwigStorage");
      mxDestroyArray(field);
      if (error) {
        SWIG_Matlab_ErrorId("SWIG:Director:Director", "Cannot call SwigStorage");
      }
    }

    /* discard our reference at destruction */
    virtual ~Director() {
      //mexPrintf("Calling destructor\n");
      swig_decref();
    }

    /* return a pointer to the wrapped object */
    mxArray *swig_get_self() const {
      // Save MATLAB in SwigStorage
      std::string fname = fieldname();
      mxArray* field = mxCreateString(fname.c_str());
      mxArray* swig_self = 0;
      int error = SWIG_Matlab_CallInterp(1, &swig_self, 1, &field, "SwigStorage");
      mxDestroyArray(field);
      if (error) {
        SWIG_Matlab_ErrorId("SWIG:Director:Director", "Cannot call SwigStorage");
      }
      return swig_self;
    }

    /* acquire ownership of the wrapped object */
    void swig_disown() const {
      if (!swig_disown_flag) {
        swig_disown_flag=true;
        swig_incref();
      }
    }

    /* increase the reference count of the wrapped object */
    void swig_incref() const {
      if (swig_disown_flag) {
        swig_refcount++;
        //mexPrintf("incref to %d\n", swig_refcount);
      }
    }

    /* methods to implement pseudo protected director members */
    virtual bool swig_get_inner(const char * /* swig_protected_method_name */) const {
      return true;
    }

    virtual void swig_set_inner(const char * /* swig_protected_method_name */, bool /* swig_val */) const {
    }

  /* ownership management */
  private:
    typedef std::map<void *, GCItem_var> swig_ownership_map;
    mutable swig_ownership_map swig_owner;

  public:
    template <typename Type>
    void swig_acquire_ownership_array(Type *vptr) const {
      if (vptr) {
        SWIG_GUARD(swig_mutex_own);
        swig_owner[vptr] = new GCArray_T<Type>(vptr);
      }
    }

    template <typename Type>
    void swig_acquire_ownership(Type *vptr) const {
      if (vptr) {
        SWIG_GUARD(swig_mutex_own);
        swig_owner[vptr] = new GCItem_T<Type>(vptr);
      }
    }

    void swig_acquire_ownership_obj(void *vptr, int own) const {
      if (vptr && own) {
        SWIG_GUARD(swig_mutex_own);
        swig_owner[vptr] = new GCItem_Object(own);
      }
    }

    int swig_release_ownership(void *vptr) const {
      int own = 0;
      if (vptr) {
        SWIG_GUARD(swig_mutex_own);
        swig_ownership_map::iterator iter = swig_owner.find(vptr);
        if (iter != swig_owner.end()) {
          own = iter->second->get_own();
          swig_owner.erase(iter);
        }
      }
      return own;
    }

  };

}

#endif

/* -------- TYPES TABLE (BEGIN) -------- */

#define SWIGTYPE_p_AuxOut swig_types[0]
#define SWIGTYPE_p_Dict swig_types[1]
#define SWIGTYPE_p_MXDict swig_types[2]
#define SWIGTYPE_p_allocator_type swig_types[3]
#define SWIGTYPE_p_casadi__Callback swig_types[4]
#define SWIGTYPE_p_casadi__CasadiMeta swig_types[5]
#define SWIGTYPE_p_casadi__CodeGenerator swig_types[6]
#define SWIGTYPE_p_casadi__DaeBuilder swig_types[7]
#define SWIGTYPE_p_casadi__DeserializerBase swig_types[8]
#define SWIGTYPE_p_casadi__DeserializingStream swig_types[9]
#define SWIGTYPE_p_casadi__FileDeserializer swig_types[10]
#define SWIGTYPE_p_casadi__FileSerializer swig_types[11]
#define SWIGTYPE_p_casadi__Function swig_types[12]
#define SWIGTYPE_p_casadi__GenericExpressionCommon swig_types[13]
#define SWIGTYPE_p_casadi__GenericMatrixCommon swig_types[14]
#define SWIGTYPE_p_casadi__GenericMatrixT_casadi__MX_t swig_types[15]
#define SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_casadi__SXElem_t_t swig_types[16]
#define SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_double_t_t swig_types[17]
#define SWIGTYPE_p_casadi__GenericType swig_types[18]
#define SWIGTYPE_p_casadi__GlobalOptions swig_types[19]
#define SWIGTYPE_p_casadi__Importer swig_types[20]
#define SWIGTYPE_p_casadi__IndexAbstraction swig_types[21]
#define SWIGTYPE_p_casadi__Linsol swig_types[22]
#define SWIGTYPE_p_casadi__MX swig_types[23]
#define SWIGTYPE_p_casadi__MatrixCommon swig_types[24]
#define SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t swig_types[25]
#define SWIGTYPE_p_casadi__MatrixT_double_t swig_types[26]
#define SWIGTYPE_p_casadi__MatrixT_long_long_t swig_types[27]
#define SWIGTYPE_p_casadi__MetaCon swig_types[28]
#define SWIGTYPE_p_casadi__MetaVar swig_types[29]
#define SWIGTYPE_p_casadi__NlpBuilder swig_types[30]
#define SWIGTYPE_p_casadi__Opti swig_types[31]
#define SWIGTYPE_p_casadi__OptiAdvanced swig_types[32]
#define SWIGTYPE_p_casadi__OptiCallback swig_types[33]
#define SWIGTYPE_p_casadi__OptiSol swig_types[34]
#define SWIGTYPE_p_casadi__PrintableCommon swig_types[35]
#define SWIGTYPE_p_casadi__SXElem swig_types[36]
#define SWIGTYPE_p_casadi__SerializerBase swig_types[37]
#define SWIGTYPE_p_casadi__SerializingStream swig_types[38]
#define SWIGTYPE_p_casadi__SharedObject swig_types[39]
#define SWIGTYPE_p_casadi__SharedObjectInternal swig_types[40]
#define SWIGTYPE_p_casadi__Slice swig_types[41]
#define SWIGTYPE_p_casadi__Sparsity swig_types[42]
#define SWIGTYPE_p_casadi__SparsityInterfaceCommon swig_types[43]
#define SWIGTYPE_p_casadi__StringDeserializer swig_types[44]
#define SWIGTYPE_p_casadi__StringSerializer swig_types[45]
#define SWIGTYPE_p_casadi__WeakRef swig_types[46]
#define SWIGTYPE_p_casadi__XmlFile swig_types[47]
#define SWIGTYPE_p_char swig_types[48]
#define SWIGTYPE_p_const_reference swig_types[49]
#define SWIGTYPE_p_difference_type swig_types[50]
#define SWIGTYPE_p_double swig_types[51]
#define SWIGTYPE_p_first_type swig_types[52]
#define SWIGTYPE_p_key_type swig_types[53]
#define SWIGTYPE_p_long_long swig_types[54]
#define SWIGTYPE_p_mapped_type swig_types[55]
#define SWIGTYPE_p_p_double swig_types[56]
#define SWIGTYPE_p_reference swig_types[57]
#define SWIGTYPE_p_second_type swig_types[58]
#define SWIGTYPE_p_size_type swig_types[59]
#define SWIGTYPE_p_std__initializer_listT_casadi__MX_t swig_types[60]
#define SWIGTYPE_p_std__initializer_listT_casadi__MatrixT_casadi__SXElem_t_t swig_types[61]
#define SWIGTYPE_p_std__istream swig_types[62]
#define SWIGTYPE_p_std__mapT_std__string_casadi__GenericType_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_casadi__GenericType_t_t_t swig_types[63]
#define SWIGTYPE_p_std__mapT_std__string_casadi__MX_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_casadi__MX_t_t_t swig_types[64]
#define SWIGTYPE_p_std__mapT_std__string_casadi__MatrixT_casadi__SXElem_t_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_casadi__MatrixT_casadi__SXElem_t_t_t_t swig_types[65]
#define SWIGTYPE_p_std__mapT_std__string_casadi__MatrixT_double_t_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_casadi__MatrixT_double_t_t_t_t swig_types[66]
#define SWIGTYPE_p_std__mapT_std__string_casadi__Sparsity_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_casadi__Sparsity_t_t_t swig_types[67]
#define SWIGTYPE_p_std__ostream swig_types[68]
#define SWIGTYPE_p_std__pairT_casadi__Slice_casadi__Slice_t swig_types[69]
#define SWIGTYPE_p_std__string swig_types[70]
#define SWIGTYPE_p_std__vectorT_casadi__Linsol_std__allocatorT_casadi__Linsol_t_t swig_types[71]
#define SWIGTYPE_p_std__vectorT_casadi__MX_std__allocatorT_casadi__MX_t_t swig_types[72]
#define SWIGTYPE_p_std__vectorT_casadi__MatrixT_casadi__SXElem_t_std__allocatorT_casadi__MatrixT_casadi__SXElem_t_t_t swig_types[73]
#define SWIGTYPE_p_std__vectorT_casadi__MatrixT_double_t_std__allocatorT_casadi__MatrixT_double_t_t_t swig_types[74]
#define SWIGTYPE_p_std__vectorT_std__vectorT_casadi__MX_std__allocatorT_casadi__MX_t_t_std__allocatorT_std__vectorT_casadi__MX_std__allocatorT_casadi__MX_t_t_t_t swig_types[75]
#define SWIGTYPE_p_std__vectorT_std__vectorT_casadi__MatrixT_casadi__SXElem_t_std__allocatorT_casadi__MatrixT_casadi__SXElem_t_t_t_std__allocatorT_std__vectorT_casadi__MatrixT_casadi__SXElem_t_std__allocatorT_casadi__MatrixT_casadi__SXElem_t_t_t_t_t swig_types[76]
#define SWIGTYPE_p_std__vectorT_std__vectorT_casadi__MatrixT_double_t_std__allocatorT_casadi__MatrixT_double_t_t_t_std__allocatorT_std__vectorT_casadi__MatrixT_double_t_std__allocatorT_casadi__MatrixT_double_t_t_t_t_t swig_types[77]
#define SWIGTYPE_p_swig__MatlabSwigIterator swig_types[78]
#define SWIGTYPE_p_value_type swig_types[79]
static swig_type_info *swig_types[81];
static swig_module_info swig_module = {swig_types, 80, 0, 0, 0, 0};
#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)

/* -------- TYPES TABLE (END) -------- */


#define SWIGVERSION 0x030011 
#define SWIG_VERSION SWIGVERSION


#define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a)) 
#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a)) 


#include <stdexcept>


#include <casadi/casadi.hpp>
#include <casadi/core/casadi_interrupt.hpp>


SWIGINTERN swig_type_info*
SWIG_pchar_descriptor(void)
{
  static int init = 0;
  static swig_type_info* info = 0;
  if (!init) {
    info = SWIG_TypeQuery("_p_char");
    init = 1;
  }
  return info;
}


SWIGINTERNINLINE mxArray*
SWIG_FromCharPtrAndSize(const char* carray, size_t size)
{
   mwSize dims[2] = {1,(mwSize)size};
   mxArray* ret = mxCreateCharArray((mwSize)2,dims);
   if(!ret) SWIG_Matlab_ErrorId("SWIG:FromCharPtrAndSize","mxCreateCharArray failed");
   mxChar *ret_data = (mxChar *)mxGetData(ret);
   size_t i;
   for(i=0; i<size; ++i) ret_data[i] = carray[i];
   return ret;  
}


SWIGINTERNINLINE mxArray* 
SWIG_FromCharPtr(const char *cptr)
{ 
  return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0));
}


  SWIGINTERNINLINE mxArray* SWIG_From_long    (long value)
    {    
      mxArray* out = mxCreateNumericMatrix(1,1,mxINT64_CLASS,mxREAL);
      *((int64_T*)mxGetData(out)) = (int64_T)value;
      return out;
    }


SWIGINTERNINLINE mxArray*
SWIG_From_int  (int value)
{    
  return SWIG_From_long  (value);
}


  namespace casadi {
    // Redirect printout to mexPrintf
    static void mexlogger(const char* s, std::streamsize num, bool error) {
      if (!casadi::InterruptHandler::is_main_thread()) {
        casadi::Logger::writeDefault(s, num, error);
        return;
      }
      mexPrintf("%.*s", static_cast<int>(num), s);
    }

#ifdef HAVE_OCTAVE
    // Flush the command window buffer (needed in gui mode)
    static void mexflush(bool error) {
    }
    // Never for Octave
    static bool mexcheckinterrupted() {
      return false;
    }
    void mexclearinterrupted() {

    }
#else
    // Undocumented matlab feature
    extern "C" bool utIsInterruptPending(void);
    extern "C" void utSetInterruptPending(bool);

    static bool mexcheckinterrupted() {
      if (!casadi::InterruptHandler::is_main_thread()) return false;
      return utIsInterruptPending();
    }

    void mexclearinterrupted() {
      utSetInterruptPending(false);
    }

    // Flush the command window buffer (needed in gui mode)
    static void mexflush(bool error) {
      if (!casadi::InterruptHandler::is_main_thread()) {
        casadi::Logger::flushDefault(error);
        return;
      }
      if (!mexcheckinterrupted()) {
        if (mexEvalString("drawnow('update');pause(0.0001);")) {
          utSetInterruptPending(true);
        }
      }
    }
#endif

  }


#include <stdexcept>


#if defined(__GNUC__)
#  if __GNUC__ == 2 && __GNUC_MINOR <= 96
#     define SWIG_STD_NOMODERN_STL
#  endif
#endif


#include <string>


#include <stddef.h>


#include <iostream>

  
namespace swig {
  struct stop_iteration {
  };

  struct MatlabSwigIterator {
  private:
    mxArray* _seq;

  protected:
    MatlabSwigIterator(mxArray* seq) : _seq(seq)
    {
      (void)_seq;
    }
      
  public:
    virtual ~MatlabSwigIterator() {}

    virtual mxArray* value() const = 0;

    virtual MatlabSwigIterator *incr(size_t n = 1) = 0;

    virtual MatlabSwigIterator *decr(size_t n = 1)
    {
      throw stop_iteration();
    }

    virtual ptrdiff_t distance(const MatlabSwigIterator &x) const
    {
      throw std::invalid_argument("operation not supported");
    }

    virtual bool equal (const MatlabSwigIterator &x) const
    {
      throw std::invalid_argument("operation not supported");
    }
    
    virtual MatlabSwigIterator *copy() const = 0;

    mxArray* next()
    {
      mxArray* obj = value();
      incr();
      return obj;
    }

    mxArray* previous()
    {
      decr();
      return value();
    }

    MatlabSwigIterator *advance(ptrdiff_t n)
    {
      return  (n > 0) ?  incr(n) : decr(-n);
    }
      
    bool operator == (const MatlabSwigIterator& x)  const
    {
      return equal(x);
    }
      
    bool operator != (const MatlabSwigIterator& x) const
    {
      return ! operator==(x);
    }

    MatlabSwigIterator* operator ++ () {
      incr();
      return this;
    }

    MatlabSwigIterator* operator -- () {
      decr();
      return this;
    }
      
    MatlabSwigIterator* operator + (ptrdiff_t n) const
    {
      return copy()->advance(n);
    }

    MatlabSwigIterator* operator - (ptrdiff_t n) const
    {
      return copy()->advance(-n);
    }
      
    ptrdiff_t operator - (const MatlabSwigIterator& x) const
    {
      return x.distance(*this);
    }
      
    static swig_type_info* descriptor() {
      static int init = 0;
      static swig_type_info* desc = 0;
      if (!init) {
	desc = SWIG_TypeQuery("swig::MatlabSwigIterator *");
	init = 1;
      }	
      return desc;
    }    
  };
}


  SWIGINTERN int SWIG_AsVal_unsigned_SS_long (mxArray* pm, unsigned long* val)
    {
      if(mxGetNumberOfElements(pm)!=1) return SWIG_TypeError;
      switch(mxGetClassID(pm)){
      case mxINT8_CLASS:
        if(val) *val = (unsigned long)(*(int8_T*)mxGetData(pm)); break;
      case mxUINT8_CLASS:
        if(val) *val = (unsigned long)(*(uint8_T*)mxGetData(pm)); break;
      case mxINT16_CLASS:
        if(val) *val = (unsigned long)(*(int16_T*)mxGetData(pm)); break;
      case mxUINT16_CLASS:
        if(val) *val = (unsigned long)(*(uint16_T*)mxGetData(pm)); break;
      case mxINT32_CLASS:
        if(val) *val = (unsigned long)(*(int32_T*)mxGetData(pm)); break;
      case mxUINT32_CLASS:
        if(val) *val = (unsigned long)(*(uint32_T*)mxGetData(pm)); break;
      case mxINT64_CLASS:
        if(val) *val = (unsigned long)(*(int64_T*)mxGetData(pm)); break;
      case mxUINT64_CLASS: 
        if(val) *val = (unsigned long)(*(uint64_T*)mxGetData(pm)); break;
      case mxDOUBLE_CLASS:
      {
	double v=mxGetScalar(pm);
	if(v!=floor(v)) return SWIG_TypeError;
        if(val) *val = (unsigned long)v;
        break;
      }
      default: return SWIG_TypeError;
      }
      return SWIG_OK;
    }


  SWIGINTERN int SWIG_AsVal_unsigned_SS_long_SS_long (mxArray* pm, unsigned long long* val)
    {
      if(mxGetNumberOfElements(pm)!=1) return SWIG_TypeError;
      switch(mxGetClassID(pm)){
      case mxINT8_CLASS:
        if(val) *val = (unsigned long long)(*(int8_T*)mxGetData(pm)); break;
      case mxUINT8_CLASS:
        if(val) *val = (unsigned long long)(*(uint8_T*)mxGetData(pm)); break;
      case mxINT16_CLASS:
        if(val) *val = (unsigned long long)(*(int16_T*)mxGetData(pm)); break;
      case mxUINT16_CLASS:
        if(val) *val = (unsigned long long)(*(uint16_T*)mxGetData(pm)); break;
      case mxINT32_CLASS:
        if(val) *val = (unsigned long long)(*(int32_T*)mxGetData(pm)); break;
      case mxUINT32_CLASS:
        if(val) *val = (unsigned long long)(*(uint32_T*)mxGetData(pm)); break;
      case mxINT64_CLASS:
        if(val) *val = (unsigned long long)(*(int64_T*)mxGetData(pm)); break;
      case mxUINT64_CLASS: 
        if(val) *val = (unsigned long long)(*(uint64_T*)mxGetData(pm)); break;
      case mxDOUBLE_CLASS:
      {
	double v=mxGetScalar(pm);
	if(v!=floor(v)) return SWIG_TypeError;
        if(val) *val = (unsigned long long)v;
        break;
      }
      default: return SWIG_TypeError;
      }
      return SWIG_OK;
    }


SWIGINTERNINLINE int
SWIG_AsVal_size_t (mxArray* obj, size_t *val)
{
  int res = SWIG_TypeError;
#ifdef SWIG_LONG_LONG_AVAILABLE
  if (sizeof(size_t) <= sizeof(unsigned long)) {
#endif
    unsigned long v;
    res = SWIG_AsVal_unsigned_SS_long (obj, val ? &v : 0);
    if (SWIG_IsOK(res) && val) *val = static_cast< size_t >(v);
#ifdef SWIG_LONG_LONG_AVAILABLE
  } else if (sizeof(size_t) <= sizeof(unsigned long long)) {
    unsigned long long v;
    res = SWIG_AsVal_unsigned_SS_long_SS_long (obj, val ? &v : 0);
    if (SWIG_IsOK(res) && val) *val = static_cast< size_t >(v);
  }
#endif
  return res;
}


  SWIGINTERNINLINE mxArray* SWIG_From_long_SS_long    (long long value)
    {    
      mxArray* out = mxCreateNumericMatrix(1,1,mxINT64_CLASS,mxREAL);
      *((int64_T*)mxGetData(out)) = (int64_T)value;
      return out;
    }


SWIGINTERNINLINE mxArray*
SWIG_From_ptrdiff_t  (ptrdiff_t value)
{    
#ifdef SWIG_LONG_LONG_AVAILABLE
  if (sizeof(ptrdiff_t) <= sizeof(long)) {
#endif
    return SWIG_From_long  (static_cast< long >(value));
#ifdef SWIG_LONG_LONG_AVAILABLE
  } else {
    /* assume sizeof(ptrdiff_t) <= sizeof(long long) */
    return SWIG_From_long_SS_long  (static_cast< long long >(value));
  }
#endif
}


SWIGINTERNINLINE mxArray*
  SWIG_From_bool  (bool value)
{
  return mxCreateLogicalScalar(value);
}


  SWIGINTERN int SWIG_AsVal_long (mxArray* pm, long* val)
    {
      if(mxGetNumberOfElements(pm)!=1) return SWIG_TypeError;
      switch(mxGetClassID(pm)){
      case mxINT8_CLASS:
        if(val) *val = (long)(*(int8_T*)mxGetData(pm)); break;
      case mxUINT8_CLASS:
        if(val) *val = (long)(*(uint8_T*)mxGetData(pm)); break;
      case mxINT16_CLASS:
        if(val) *val = (long)(*(int16_T*)mxGetData(pm)); break;
      case mxUINT16_CLASS:
        if(val) *val = (long)(*(uint16_T*)mxGetData(pm)); break;
      case mxINT32_CLASS:
        if(val) *val = (long)(*(int32_T*)mxGetData(pm)); break;
      case mxUINT32_CLASS:
        if(val) *val = (long)(*(uint32_T*)mxGetData(pm)); break;
      case mxINT64_CLASS:
        if(val) *val = (long)(*(int64_T*)mxGetData(pm)); break;
      case mxUINT64_CLASS: 
        if(val) *val = (long)(*(uint64_T*)mxGetData(pm)); break;
      case mxDOUBLE_CLASS:
      {
	double v=mxGetScalar(pm);
	if(v!=floor(v)) return SWIG_TypeError;
        if(val) *val = (long)v;
        break;
      }
      default: return SWIG_TypeError;
      }
      return SWIG_OK;
    }


  SWIGINTERN int SWIG_AsVal_long_SS_long (mxArray* pm, long long* val)
    {
      if(mxGetNumberOfElements(pm)!=1) return SWIG_TypeError;
      switch(mxGetClassID(pm)){
      case mxINT8_CLASS:
        if(val) *val = (long long)(*(int8_T*)mxGetData(pm)); break;
      case mxUINT8_CLASS:
        if(val) *val = (long long)(*(uint8_T*)mxGetData(pm)); break;
      case mxINT16_CLASS:
        if(val) *val = (long long)(*(int16_T*)mxGetData(pm)); break;
      case mxUINT16_CLASS:
        if(val) *val = (long long)(*(uint16_T*)mxGetData(pm)); break;
      case mxINT32_CLASS:
        if(val) *val = (long long)(*(int32_T*)mxGetData(pm)); break;
      case mxUINT32_CLASS:
        if(val) *val = (long long)(*(uint32_T*)mxGetData(pm)); break;
      case mxINT64_CLASS:
        if(val) *val = (long long)(*(int64_T*)mxGetData(pm)); break;
      case mxUINT64_CLASS: 
        if(val) *val = (long long)(*(uint64_T*)mxGetData(pm)); break;
      case mxDOUBLE_CLASS:
      {
	double v=mxGetScalar(pm);
	if(v!=floor(v)) return SWIG_TypeError;
        if(val) *val = (long long)v;
        break;
      }
      default: return SWIG_TypeError;
      }
      return SWIG_OK;
    }


SWIGINTERNINLINE int
SWIG_AsVal_ptrdiff_t (mxArray* obj, ptrdiff_t *val)
{
  int res = SWIG_TypeError;
#ifdef SWIG_LONG_LONG_AVAILABLE
  if (sizeof(ptrdiff_t) <= sizeof(long)) {
#endif
    long v;
    res = SWIG_AsVal_long (obj, val ? &v : 0);
    if (SWIG_IsOK(res) && val) *val = static_cast< ptrdiff_t >(v);
#ifdef SWIG_LONG_LONG_AVAILABLE
  } else if (sizeof(ptrdiff_t) <= sizeof(long long)) {
    long long v;
    res = SWIG_AsVal_long_SS_long (obj, val ? &v : 0);
    if (SWIG_IsOK(res) && val) *val = static_cast< ptrdiff_t >(v);
  }
#endif
  return res;
}


#include <algorithm>


#include <vector>


#include <utility>


#include <map>


#include <algorithm>


#define SWIG_Error_return(code, msg)  { std::cerr << "Error occured in CasADi SWIG interface code:" << std::endl << "  "<< msg << std::endl;SWIG_Error(code, msg); return 0; }


namespace swig {
  template <class Type>
  struct noconst_traits {
    typedef Type noconst_type;
  };

  template <class Type>
  struct noconst_traits<const Type> {
    typedef Type noconst_type;
  };

  /*
    type categories
  */
  struct pointer_category { };
  struct value_category { };

  /*
    General traits that provides type_name and type_info
  */
  template <class Type> struct traits { };

  template <class Type>
  inline const char* type_name() {
    return traits<typename noconst_traits<Type >::noconst_type >::type_name();
  }

  template <class Type> struct traits_info {
    static swig_type_info *type_query(std::string name) {
      name += " *";
      return SWIG_TypeQuery(name.c_str());
    }
    static swig_type_info *type_info() {
      static swig_type_info *info = type_query(type_name<Type>());
      return info;
    }
  };

  /*
    Partial specialization for pointers (traits_info)
  */
  template <class Type> struct traits_info<Type *> {
    static swig_type_info *type_query(std::string name) {
      name += " *";
      return SWIG_TypeQuery(name.c_str());
    }
    static swig_type_info *type_info() {
      static swig_type_info *info = type_query(type_name<Type>());
      return info;
    }
  };

  template <class Type>
  inline swig_type_info *type_info() {
    return traits_info<Type>::type_info();
  }

  /*
    Partial specialization for pointers (traits)
  */
  template <class Type> struct traits <Type *> {
    typedef pointer_category category;
    static std::string make_ptr_name(const char* name) {
      std::string ptrname = name;
      ptrname += " *";
      return ptrname;
    }
    static const char* type_name() {
      static std::string name = make_ptr_name(swig::type_name<Type>());
      return name.c_str();
    }
  };

  template <class Type, class Category>
  struct traits_as { };

  template <class Type, class Category>
  struct traits_check { };

}


namespace swig {  
// Traits that provides the from method
  template <class Type> struct traits_from_ptr {
    static mxArray* from(Type *val, int owner = 0) {
      return SWIG_NewPointerObj(val, type_info<Type>(), owner);
    }
  };

  template <class Type> struct traits_from {
    static mxArray* from(const Type& val) {
      return traits_from_ptr<Type>::from(new Type(val), 1);
    }
  };

  template <class Type> struct traits_from<Type *> {
    static mxArray* from(Type* val) {
      return traits_from_ptr<Type>::from(val, 0);
    }
  };

  template <class Type> struct traits_from<const Type *> {
    static mxArray* from(const Type* val) {
      return traits_from_ptr<Type>::from(const_cast<Type*>(val), 0);
    }
  };


  template <class Type>
  inline mxArray* from(const Type& val) {
    return traits_from<Type>::from(val);
  }

  template <class Type>
  inline mxArray* from_ptr(Type* val, int owner) {
    return traits_from_ptr<Type>::from(val, owner);
  }

    // Traits that provides the asval/as/check method
  template <class Type>
  struct traits_asptr {   
    static int asptr(mxArray* pm, Type **val) {
      Type *p;
      int res = SWIG_ConvertPtr(pm, (void**)&p, type_info<Type>(), 0);
      if (SWIG_IsOK(res)) {
	if (val) *val = p;
      }
      return res;
    }
  }; 

  template <class Type>
  inline int asptr(mxArray* pm, Type **vptr) {
    return traits_asptr<Type>::asptr(pm, vptr);
  }

  template <class Type> 
  struct traits_asval {
    static int asval(mxArray* pm, Type *val) {
      if (val) {
	Type *p = 0;
	int res = traits_asptr<Type>::asptr(pm, &p);
	if (!SWIG_IsOK(res)) return res;	
	if (p) {
	  typedef typename noconst_traits<Type>::noconst_type noconst_type;
	  *(const_cast<noconst_type*>(val)) = *p;
	  if (SWIG_IsNewObj(res)){
	    delete p;
	    res = SWIG_DelNewMask(res);
	  }
	  return res;
	} else {
	  return SWIG_ERROR;
	}
      } else {
	return traits_asptr<Type>::asptr(pm, (Type **)(0));
      }
    }
  };

  template <class Type> struct traits_asval<Type*> {
    static int asval(mxArray* pm, Type **val) {
      if (val) {
        typedef typename noconst_traits<Type>::noconst_type noconst_type;
        noconst_type *p = 0;
        int res = traits_asptr<noconst_type>::asptr(pm,  &p);
        if (SWIG_IsOK(res)) {
          *(const_cast<noconst_type**>(val)) = p;
	}
	return res;
      } else {
	return traits_asptr<Type>::asptr(pm, (Type **)(0));
      }
    }
  };
  
  template <class Type>
  inline int asval(mxArray* pm, Type *val) {
    return traits_asval<Type>::asval(pm, val);
  }

  template <class Type> 
  struct traits_as<Type, value_category> {
    static Type as(mxArray* pm, bool throw_error) {
      Type v;
      int res = asval(pm, &v);
      if (mxGetClassID(pm) == mxUNKNOWN_CLASS || !SWIG_IsOK(res)) {
	if (!Matlab_Error_Occurred()) {
	  SWIG_Error(SWIG_TypeError,  swig::type_name<Type>());
	}
	if (throw_error) throw std::invalid_argument("bad type");
      }
      return v;
    }
  };

  template <class Type> 
  struct traits_as<Type, pointer_category> {
    static Type as(mxArray* pm, bool throw_error) {
      Type *v = 0;      
      int res = traits_asptr<Type>::asptr(pm, &v);
      if (SWIG_IsOK(res) && v) {
	if (SWIG_IsNewObj(res)) {
	  Type r(*v);
	  delete v;
	  return r;
	} else {
	  return *v;
	}
      } else {
	// Uninitialized return value, no Type() constructor required.
	static Type *v_def = (Type*) malloc(sizeof(Type));
	if (!Matlab_Error_Occurred()) {
	  SWIG_Error(SWIG_TypeError,  swig::type_name<Type>());
	}
	if (throw_error) throw std::invalid_argument("bad type");
        memset(static_cast<void *>(v_def),0,sizeof(Type));
	return *v_def;
      }
    }
  };

  template <class Type> 
  struct traits_as<Type*, pointer_category> {
    static Type* as(mxArray* pm, bool throw_error) {
      Type *v = 0;      
      int res = traits_asptr<Type>::asptr(pm, &v);
      if (SWIG_IsOK(res)) {
	return v;
      } else {
	if (!Matlab_Error_Occurred()) {
	  SWIG_Error(SWIG_TypeError,  swig::type_name<Type>());
	}
	if (throw_error) throw std::invalid_argument("bad type");
	return 0;
      }
    }
  };
    
  template <class Type>
  inline Type as(mxArray* pm, bool te = false) {
    return traits_as<Type, typename traits<Type>::category>::as(pm, te);
  }

  template <class Type> 
  struct traits_check<Type, value_category> {
    static bool check(mxArray* obj) {
      int res = asval(obj, (Type *)(0));
      return SWIG_IsOK(res) ? true : false;
    }
  };

  template <class Type> 
  struct traits_check<Type, pointer_category> {
    static bool check(mxArray* obj) {
      int res = asptr(obj, (Type **)(0));
      return SWIG_IsOK(res) ? true : false;
    }
  };

  template <class Type>
  inline bool check(mxArray* obj) {
    return traits_check<Type, typename traits<Type>::category>::check(obj);
  }
}


#include <functional>

namespace std {













}

namespace swig {
  inline size_t
  check_index(ptrdiff_t i, size_t size, bool insert = false) {
    if ( i < 0 ) {
      if ((size_t) (-i) <= size)
	return (size_t) (i + size);
    } else if ( (size_t) i < size ) {
      return (size_t) i;
    } else if (insert && ((size_t) i == size)) {
      return size;
    }

    throw std::out_of_range("index out of range");
  }

  inline size_t
  slice_index(ptrdiff_t i, size_t size) {
    if ( i < 0 ) {
      if ((size_t) (-i) <= size) {
	return (size_t) (i + size);
      } else {
	throw std::out_of_range("index out of range");
      }
    } else {
      return ( (size_t) i < size ) ? ((size_t) i) : size;
    }
  }

  template <class Sequence, class Difference>
  inline typename Sequence::iterator
  getpos(Sequence* self, Difference i)  {
    typename Sequence::iterator pos = self->begin();
    std::advance(pos, check_index(i,self->size()));
    return pos;
  }

  template <class Sequence, class Difference>
  inline typename Sequence::const_iterator
  cgetpos(const Sequence* self, Difference i)  {
    typename Sequence::const_iterator pos = self->begin();
    std::advance(pos, check_index(i,self->size()));
    return pos;
  }

  template <class Sequence, class Difference>
  inline Sequence*
  getslice(const Sequence* self, Difference i, Difference j) {
    typename Sequence::size_type size = self->size();
    typename Sequence::size_type ii = swig::check_index(i, size);
    typename Sequence::size_type jj = swig::slice_index(j, size);

    if (jj > ii) {
      typename Sequence::const_iterator vb = self->begin();
      typename Sequence::const_iterator ve = self->begin();
      std::advance(vb,ii);
      std::advance(ve,jj);
      return new Sequence(vb, ve);
    } else {
      return new Sequence();
    }
  }

  template <class Sequence, class Difference, class InputSeq>
  inline void
  setslice(Sequence* self, Difference i, Difference j, const InputSeq& v) {
    typename Sequence::size_type size = self->size();
    typename Sequence::size_type ii = swig::check_index(i, size, true);
    typename Sequence::size_type jj = swig::slice_index(j, size);
    if (jj < ii) jj = ii;
    size_t ssize = jj - ii;
    if (ssize <= v.size()) {
      typename Sequence::iterator sb = self->begin();
      typename InputSeq::const_iterator vmid = v.begin();
      std::advance(sb,ii);
      std::advance(vmid, jj - ii);
      self->insert(std::copy(v.begin(), vmid, sb), vmid, v.end());
    } else {
      typename Sequence::iterator sb = self->begin();
      typename Sequence::iterator se = self->begin();
      std::advance(sb,ii);
      std::advance(se,jj);
      self->erase(sb,se);
      sb = self->begin();
      std::advance(sb,ii);
      self->insert(sb, v.begin(), v.end());
    }
  }

  template <class Sequence, class Difference>
  inline void
  delslice(Sequence* self, Difference i, Difference j) {
    typename Sequence::size_type size = self->size();
    typename Sequence::size_type ii = swig::check_index(i, size, true);
    typename Sequence::size_type jj = swig::slice_index(j, size);
    if (jj > ii) {
      typename Sequence::iterator sb = self->begin();
      typename Sequence::iterator se = self->begin();
      std::advance(sb,ii);
      std::advance(se,jj);
      self->erase(sb,se);
    }
  }
}


#if defined(__SUNPRO_CC) && defined(_RWSTD_VER)
#  if !defined(SWIG_NO_STD_NOITERATOR_TRAITS_STL)
#    define SWIG_STD_NOITERATOR_TRAITS_STL
#  endif
#endif

#if !defined(SWIG_STD_NOITERATOR_TRAITS_STL)
#include <iterator>
#else
namespace std {
  template <class Iterator>
  struct iterator_traits {
    typedef ptrdiff_t difference_type;
    typedef typename Iterator::value_type value_type;
  };

  template <class Iterator, class Category,class T, class Reference, class Pointer, class Distance>
  struct iterator_traits<__reverse_bi_iterator<Iterator,Category,T,Reference,Pointer,Distance> > {
    typedef Distance difference_type;
    typedef T value_type;
  };

  template <class T>
  struct iterator_traits<T*> {
    typedef T value_type;
    typedef ptrdiff_t difference_type;
  };

  template<typename _InputIterator>
  inline typename iterator_traits<_InputIterator>::difference_type
  distance(_InputIterator __first, _InputIterator __last)
  {
    typename iterator_traits<_InputIterator>::difference_type __n = 0;
    while (__first != __last) {
      ++__first; ++__n;
    }
    return __n;
  }
}
#endif


namespace swig {
  template<typename OutIterator>
  class MatlabSwigIterator_T :  public MatlabSwigIterator
  {
  public:
    typedef OutIterator out_iterator;
    typedef typename std::iterator_traits<out_iterator>::value_type value_type;    
    typedef MatlabSwigIterator_T<out_iterator> self_type;

    MatlabSwigIterator_T(out_iterator curr, mxArray* seq)
      : MatlabSwigIterator(seq), current(curr)
    {
    }

    const out_iterator& get_current() const
    {
      return current;
    }

    
    bool equal (const MatlabSwigIterator &iter) const
    {
      const self_type *iters = dynamic_cast<const self_type *>(&iter);
      if (iters) {
	return (current == iters->get_current());
      } else {
	throw std::invalid_argument("bad iterator type");
      }
    }
    
    ptrdiff_t distance(const MatlabSwigIterator &iter) const
    {
      const self_type *iters = dynamic_cast<const self_type *>(&iter);
      if (iters) {
	return std::distance(current, iters->get_current());
      } else {
	throw std::invalid_argument("bad iterator type");
      }
    }    
    
  protected:
    out_iterator current;
  };
  
  template <class ValueType>
  struct from_oper 
  {
    typedef const ValueType& argument_type;
    typedef mxArray* result_type;
    result_type operator()(argument_type v) const
    {
      return swig::from(v);
    }
  };

  template<typename OutIterator, 
	   typename ValueType = typename std::iterator_traits<OutIterator>::value_type,
	   typename FromOper = from_oper<ValueType> >
  class MatlabSwigIteratorOpen_T :  public MatlabSwigIterator_T<OutIterator>
  {
  public:
    FromOper from;
    typedef OutIterator out_iterator;
    typedef ValueType value_type;
    typedef MatlabSwigIterator_T<out_iterator>  base;
    typedef MatlabSwigIteratorOpen_T<OutIterator, ValueType, FromOper> self_type;
    
    MatlabSwigIteratorOpen_T(out_iterator curr, mxArray* seq)
      : MatlabSwigIterator_T<OutIterator>(curr, seq)
    {
    }
    
    mxArray* value() const {
      return from(static_cast<const value_type&>(*(base::current)));
    }
    
    MatlabSwigIterator *copy() const
    {
      return new self_type(*this);
    }

    MatlabSwigIterator *incr(size_t n = 1)
    {
      while (n--) {
	++base::current;
      }
      return this;
    }

    MatlabSwigIterator *decr(size_t n = 1)
    {
      while (n--) {
	--base::current;
      }
      return this;
    }
  };

  template<typename OutIterator, 
	   typename ValueType = typename std::iterator_traits<OutIterator>::value_type,
	   typename FromOper = from_oper<ValueType> >
  class MatlabSwigIteratorClosed_T :  public MatlabSwigIterator_T<OutIterator>
  {
  public:
    FromOper from;
    typedef OutIterator out_iterator;
    typedef ValueType value_type;
    typedef MatlabSwigIterator_T<out_iterator>  base;    
    typedef MatlabSwigIteratorClosed_T<OutIterator, ValueType, FromOper> self_type;
    
    MatlabSwigIteratorClosed_T(out_iterator curr, out_iterator first, out_iterator last, mxArray* seq)
      : MatlabSwigIterator_T<OutIterator>(curr, seq), begin(first), end(last)
    {
    }
    
    mxArray* value() const {
      if (base::current == end) {
	throw stop_iteration();
      } else {
	return from(static_cast<const value_type&>(*(base::current)));
      }
    }
    
    MatlabSwigIterator *copy() const
    {
      return new self_type(*this);
    }

    MatlabSwigIterator *incr(size_t n = 1)
    {
      while (n--) {
	if (base::current == end) {
	  throw stop_iteration();
	} else {
	  ++base::current;
	}
      }
      return this;
    }

    MatlabSwigIterator *decr(size_t n = 1)
    {
      while (n--) {
	if (base::current == begin) {
	  throw stop_iteration();
	} else {
	  --base::current;
	}
      }
      return this;
    }

  private:
    out_iterator begin;
    out_iterator end;
  };

  template<typename OutIter>
  inline MatlabSwigIterator*
  make_output_iterator(const OutIter& current, const OutIter& begin,const OutIter& end, mxArray* seq = 0 /* KT mxArray()*/)
  {
    return new MatlabSwigIteratorClosed_T<OutIter>(current, begin, end, seq);
  }

  template<typename OutIter>
  inline MatlabSwigIterator*
  make_output_iterator(const OutIter& current, mxArray* seq = 0 /* KT mxArray()*/)
  {
    return new MatlabSwigIteratorOpen_T<OutIter>(current, seq);
  }
}


namespace swig
{
  template <class T>
    struct MatlabSequence_Ref // * matlab can't support these, because of how assignment works
  {
    MatlabSequence_Ref(mxArray* const seq, int index)
      : _seq(seq), _index(index)
    {
    }

    operator T () const
    {
      //      swig::SwigVar_PyObject item = MatlabSequence_GetItem(_seq, _index);
      mxArray* item; // * todo
      try {
	return swig::as<T>(item, true);
      } catch (std::exception& e) {
	char msg[1024];
	sprintf(msg, "in sequence element %d ", _index);
	if (!Matlab_Error_Occurred()) {
	  SWIG_Error(SWIG_TypeError,  swig::type_name<T>());
	}
	SWIG_Matlab_AddErrorMsg(msg);
	SWIG_Matlab_AddErrorMsg(e.what());
	throw;
      }
    }

    MatlabSequence_Ref& operator=(const T& v)
    {
      //      MatlabSequence_SetItem(_seq, _index, swig::from<T>(v));
      // * todo
      return *this;
    }

  private:
    mxArray* _seq;
    int _index;
  };

  template <class T>
  struct MatlabSequence_ArrowProxy
  {
    MatlabSequence_ArrowProxy(const T& x): m_value(x) {}
    const T* operator->() const { return &m_value; }
    operator const T*() const { return &m_value; }
    T m_value;
  };

  template <class T, class Reference >
  struct MatlabSequence_InputIterator
  {
    typedef MatlabSequence_InputIterator<T, Reference > self;

    typedef std::random_access_iterator_tag iterator_category;
    typedef Reference reference;
    typedef T value_type;
    typedef T* pointer;
    typedef int difference_type;

    MatlabSequence_InputIterator()
    {
    }

    MatlabSequence_InputIterator(mxArray* const seq, int index)
      : _seq(seq), _index(index)
    {
    }

    reference operator*() const
    {
      return reference(_seq, _index);
    }

    MatlabSequence_ArrowProxy<T>
    operator->() const {
      return MatlabSequence_ArrowProxy<T>(operator*());
    }

    bool operator==(const self& ri) const
    {
      return (_index == ri._index);
    }

    bool operator!=(const self& ri) const
    {
      return !(operator==(ri));
    }

    self& operator ++ ()
    {
      ++_index;
      return *this;
    }

    self& operator -- ()
    {
      --_index;
      return *this;
    }

    self& operator += (difference_type n)
    {
      _index += n;
      return *this;
    }

    self operator +(difference_type n) const
    {
      return self(_seq, _index + n);
    }

    self& operator -= (difference_type n)
    {
      _index -= n;
      return *this;
    }

    self operator -(difference_type n) const
    {
      return self(_seq, _index - n);
    }

    difference_type operator - (const self& ri) const
    {
      return _index - ri._index;
    }

    bool operator < (const self& ri) const
    {
      return _index < ri._index;
    }

    reference
    operator[](difference_type n) const
    {
      return reference(_seq, _index + n);
    }

  private:
    mxArray* _seq;
    difference_type _index;
  };

  template <class T>
  struct MatlabSequence_Cont
  {
    typedef MatlabSequence_Ref<T> reference;
    typedef const MatlabSequence_Ref<T> const_reference;
    typedef T value_type;
    typedef T* pointer;
    typedef int difference_type;
    typedef int size_type;
    typedef const pointer const_pointer;
    typedef MatlabSequence_InputIterator<T, reference> iterator;
    typedef MatlabSequence_InputIterator<T, const_reference> const_iterator;

    MatlabSequence_Cont(mxArray* const seq) : _seq(seq)
    {
      // * assert that we have map type etc.
      /*
      if (!MatlabSequence_Check(seq)) {
	throw std::invalid_argument("a sequence is expected");
      }
      _seq = seq;
      Py_INCREF(_seq);
      */
    }

    ~MatlabSequence_Cont()
    {
    }

    size_type size() const
    {
      //      return static_cast<size_type>(MatlabSequence_Size(_seq));
      return 0; // * todo
    }

    bool empty() const
    {
      return size() == 0;
    }

    iterator begin()
    {
      return iterator(_seq, 0);
    }

    const_iterator begin() const
    {
      return const_iterator(_seq, 0);
    }

    iterator end()
    {
      return iterator(_seq, size());
    }

    const_iterator end() const
    {
      return const_iterator(_seq, size());
    }

    reference operator[](difference_type n)
    {
      return reference(_seq, n);
    }

    const_reference operator[](difference_type n)  const
    {
      return const_reference(_seq, n);
    }

    bool check(bool set_err = true) const
    {
      int s = size();
      for (int i = 0; i < s; ++i) {
	//	swig::SwigVar_PyObject item = MatlabSequence_GetItem(_seq, i);
	mxArray* item; // * todo
	if (!swig::check<value_type>(item)) {
	  if (set_err) {
	    char msg[1024];
	    sprintf(msg, "in sequence element %d", i);
	    SWIG_Error(SWIG_RuntimeError, msg);
	  }
	  return false;
	}
      }
      return true;
    }

  private:
    mxArray* _seq;
  };

}


  namespace casadi {
    /// Helper function: Convert ':' to Slice
    inline Slice char2Slice(char ch) {
      casadi_assert_dev(ch==':');
      return Slice();
    }
  } // namespace casadi



  namespace casadi {
    /* Check if Null or None */
    bool is_null(mxArray *p);

    /* Typemaps from CasADi types to types in the interfaced language:
     *
     * to_ptr: Converts a pointer in interfaced language to C++:
     *   Input: GUESTOBJECT pointer p
     *   Output: Pointer to pointer: At input, pointer to pointer to temporary
     *   The routine will either:
     *     - Do nothing, if 0
     *     - Change the pointer
     *     - Change the temporary object
     *   Returns true upon success, else false
     *
     * from_ptr: Converts result from CasADi to interfaced language
     */

    // Basic types
    bool to_ptr(mxArray *p, bool** m);
    mxArray* from_ptr(const bool *a);
    bool to_ptr(mxArray *p, casadi_int** m);
    mxArray* from_ptr(const casadi_int *a);
    bool to_ptr(mxArray *p, double** m);
    mxArray* from_ptr(const double *a);
    bool to_ptr(mxArray *p, std::string** m);
    mxArray* from_ptr(const std::string *a);

    // std::vector

    bool to_ptr(mxArray *p, std::vector<double> **m);
    mxArray* from_ptr(const std::vector<double> *a);
    bool to_ptr(mxArray *p, std::vector<casadi_int>** m);
    mxArray* from_ptr(const std::vector<casadi_int> *a);
    bool to_ptr(mxArray *p, const std::vector<bool> **m);
    mxArray* from_ptr(const std::vector<bool> *a);
    bool to_ptr(mxArray *p, std::vector<std::string>** m);
    mxArray* from_ptr(const std::vector<std::string> *a);

    template<typename M> bool to_ptr(mxArray *p, std::vector<M>** m);
    template<typename M> bool to_ptr(mxArray *p, std::vector< std::vector<M> >** m);
    template<typename M> mxArray* from_ptr(const std::vector<M> *a);

    // std::pair

    bool to_ptr(mxArray *p, std::pair<casadi_int, casadi_int>** m);
    mxArray* from_ptr(const std::pair<casadi_int, casadi_int>* a);

    template<typename M1, typename M2> bool to_ptr(mxArray *p, std::pair<M1, M2>** m);
    template<typename M1, typename M2> mxArray* from_ptr(const std::pair<M1, M2>* a);

    // std::map
    template<typename M> bool to_ptr(mxArray *p, std::map<std::string, M>** m);
    template<typename M> mxArray* from_ptr(const std::map<std::string, M> *a);

    // Slice
    bool to_ptr(mxArray *p, casadi::Slice** m);
    mxArray* from_ptr(const casadi::Slice *a);

    // Sparsity
    bool to_ptr(mxArray *p, casadi::Sparsity** m);
    mxArray* from_ptr(const casadi::Sparsity *a);

    // Matrix<>
    bool to_ptr(mxArray *p, casadi::DM** m);
    mxArray* from_ptr(const casadi::DM *a);
    bool to_ptr(mxArray *p, casadi::IM** m);
    mxArray* from_ptr(const casadi::IM *a);
    bool to_ptr(mxArray *p, casadi::SX** m);
    mxArray* from_ptr(const casadi::SX *a);

    // MX
    bool to_ptr(mxArray *p, casadi::MX** m);
    mxArray* from_ptr(const casadi::MX *a);

    // Function
    bool to_ptr(mxArray *p, casadi::Function** m);
    mxArray* from_ptr(const casadi::Function *a);

    // SXElem
    bool to_ptr(mxArray *p, casadi::SXElem** m);
    mxArray* from_ptr(const casadi::SXElem *a);

    // GenericType
    bool to_ptr(mxArray *p, casadi::GenericType** m);
    mxArray* from_ptr(const casadi::GenericType *a);

    // Same as to_ptr, but with pointer instead of pointer to pointer
    template<typename M> bool to_val(mxArray *p, M* m);

    // Check if conversion is possible
    template<typename M> bool can_convert(mxArray *p) { return to_ptr(p, static_cast<M**>(0));}

    // Same as the above, but with reference instead of pointer
    template<typename M> mxArray* from_ref(const M& m) { return from_ptr(&m);}

    // Specialization for std::vectors of booleans
    mxArray* from_ref(std::vector<bool>::const_reference m) {
      bool tmp = m;
      return from_ptr(&tmp);
    }

    // Same as the above, but with a temporary object
    template<typename M> mxArray* from_tmp(M m) { return from_ptr(&m);}

    // Get sparsity pattern
    Sparsity get_sparsity(const mxArray* p);

    // Number of nonzeros
    size_t getNNZ(const mxArray* p);


    mxArray* full(const DM& m, bool simplify=false) {









      mxArray *p  = mxCreateDoubleMatrix(m.size1(), m.size2(), mxREAL);
      double* d = static_cast<double*>(mxGetData(p));
      casadi_densify(m.ptr(), m.sparsity(), d, false); // Column-major
      return p;



    }


    // Convert to a sparse matrix
    mxArray* sparse(const DM& m) {







      mxArray *p  = mxCreateSparse(m.size1(), m.size2(), m.nnz(), mxREAL);
      casadi::casadi_copy(m.ptr(), m.nnz(), static_cast<double*>(mxGetData(p)));
      std::copy(m.colind(), m.colind()+m.size2()+1, mxGetJc(p));
      std::copy(m.row(), m.row()+m.nnz(), mxGetIr(p));
      return p;




    }

    mxArray* full_or_sparse(const DM& m, bool simplify=false) {
      if (m.is_dense()) {
        return full(m, simplify);
      } else {
        mxArray* p = sparse(m);
        if (is_null(p)) return from_ptr(&m);
        return p;
      }
    }























































































































  } // namespace CasADi
 

  namespace casadi {
    template<typename M> bool to_val(mxArray *p, M* m) {
      // Copy the pointer
      M *m2 = m;
      bool ret = to_ptr(p, m ? &m2 : 0);
      // If pointer changed, copy the object
      if (m!=m2) *m=*m2;
      return ret;
    }

    // Same as to_ptr, but with GenericType
    template<typename M> bool to_generic(mxArray *p, GenericType** m) {
      if (m) {
        // Temporary
        M tmp, *tmp_ptr=&tmp;
        bool ret = to_ptr(p, &tmp_ptr);
        if (!ret) return ret;
        **m = GenericType(*tmp_ptr);
        return ret;
      } else {
        return to_ptr(p, static_cast<M**>(0));
      }
    }

    // Check if casadi_int
    template<typename T> struct is_int {
      static inline bool check() {return false;}
    };

    template<> struct is_int<casadi_int> {
      static inline bool check() {return true;}
    };

    bool is_null(mxArray *p) {




      if (p == 0) return true;

      return false;
    }


    Sparsity get_sparsity(const mxArray* p) {
      // Get sparsity pattern
      size_t nrow = mxGetM(p);
      size_t ncol = mxGetN(p);

      if (mxIsSparse(p)) {
        // Sparse storage in MATLAB
        mwIndex *Jc = mxGetJc(p);
        mwIndex *Ir = mxGetIr(p);

        // Store in vectors
        std::vector<casadi_int> colind(ncol+1);
        std::copy(Jc, Jc+colind.size(), colind.begin());
        std::vector<casadi_int> row(colind.back());
        std::copy(Ir, Ir+row.size(), row.begin());

        // Create pattern and return
        return Sparsity(nrow, ncol, colind, row);
      } else {
        return Sparsity::dense(nrow, ncol);
      }
    }

    size_t getNNZ(const mxArray* p) {
      // Dimensions
      size_t nrow = mxGetM(p);
      size_t ncol = mxGetN(p);
      if (mxIsSparse(p)) {
        // Sparse storage in MATLAB
        mwIndex *Jc = mxGetJc(p);
        return Jc[ncol];
      } else {
        return nrow*ncol;
      }
    }

  } // namespace casadi
 


SWIGINTERN int
SWIG_AsVal_bool (mxArray* pm, bool *val)
{
   if(!mxIsLogicalScalar(pm)) return SWIG_TypeError;
   if (val) *val = mxIsLogicalScalarTrue(pm);
   return SWIG_OK;
}


  namespace casadi {
    bool to_ptr(mxArray *p, bool** m) {
      // Treat Null
      if (is_null(p)) return false;

      // Standard typemaps
      if (SWIG_IsOK(SWIG_AsVal_bool (p, m ? *m : 0))) return true;


      if (mxIsLogicalScalar(p)) {
        if (m) **m = mxIsLogicalScalarTrue(p);
        return true;
      }


      // No match
      return false;
    }

    mxArray * from_ptr(const bool *a) {



      return mxCreateLogicalScalar(*a);



    }
  } // namespace casadi
 

#include <limits.h>
#if !defined(SWIG_NO_LLONG_MAX)
# if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
#   define LLONG_MAX __LONG_LONG_MAX__
#   define LLONG_MIN (-LLONG_MAX - 1LL)
#   define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
# endif
#endif


SWIGINTERN int
SWIG_AsVal_int (mxArray* obj, int *val)
{
  long v;
  int res = SWIG_AsVal_long (obj, &v);
  if (SWIG_IsOK(res)) {
    if ((v < INT_MIN || v > INT_MAX)) {
      return SWIG_OverflowError;
    } else {
      if (val) *val = static_cast< int >(v);
    }
  }  
  return res;
}


  namespace casadi {
    bool to_ptr(mxArray *p, casadi_int** m) {
      // Treat Null
      if (is_null(p)) return false;

      // long long
      {
        long long tmp;
        if (SWIG_IsOK(SWIG_AsVal_long_SS_long (p, &tmp))) {
          if (m) **m = static_cast<casadi_int>(tmp);
          return true;
        }
      }
















      bool tmp;
      if (to_val(p, m? &tmp : 0)) {
        if (m) **m = tmp;
        return true;
      }

      // No match
      return false;
    }

    mxArray * from_ptr(const casadi_int *a) {










      return mxCreateDoubleScalar(static_cast<double>(*a));



    }
  } // namespace casadi
 

  SWIGINTERN int SWIG_AsVal_double (mxArray* pm, double* val)
    {
      if(!mxIsDouble(pm) || mxGetNumberOfElements(pm)!=1) return SWIG_TypeError;
      if (val) *val = mxGetScalar(pm);
      return SWIG_OK;
    }


  namespace casadi {
    bool to_ptr(mxArray *p, double** m) {
      // Treat Null
      if (is_null(p)) return false;

      // Standard typemaps
      if (SWIG_IsOK(SWIG_AsVal_double (p, m ? *m : 0))) return true;
















      casadi_int tmp;
      if (to_val(p, m? &tmp: 0)) {
        if (m) **m = tmp;
        return true;
      }

      // No match
      return false;
    }

    mxArray * from_ptr(const double *a) {



      return mxCreateDoubleScalar(*a);



    }
  } // namespace casadi
 

  namespace casadi {



    // Cell array
    template<typename M> bool to_ptr_cell(mxArray *p, std::vector<M>** m) {
      // Cell arrays (only row vectors)
      if (mxGetClassID(p)==mxCELL_CLASS) {
        casadi_int nrow = mxGetM(p), ncol = mxGetN(p);
        if (nrow==1 || (nrow==0 && ncol==0) || ncol==1) {
          casadi_int n = (nrow==0 || ncol==0) ? 0 : std::max(nrow, ncol);
          // Allocate elements
          if (m) {
            (**m).clear();
            (**m).reserve(n);
          }

          // Temporary
          M tmp;

          // Loop over elements
          for (casadi_int i=0; i<n; ++i) {
            // Get element
            mxArray* pe = mxGetCell(p, i);
            if (pe==0) return false;

            // Convert element
            M *m_i = m ? &tmp : 0;
            if (!to_ptr(pe, m_i ? &m_i : 0)) {
              return false;
            }
            if (m) (**m).push_back(*m_i);
          }
          return true;
        }
      }
      return false;
    }

    // MATLAB row/column vector maps to std::vector<double>
    bool to_ptr(mxArray *p, std::vector<double> **m) {
      // Treat Null
      if (is_null(p)) return false;

      if (mxIsDouble(p) && mxGetNumberOfDimensions(p)==2
          && (mxGetM(p)<=1 || mxGetN(p)<=1)) {
        if (m) {
          double* data = static_cast<double*>(mxGetData(p));
          casadi_int n = mxGetM(p)*mxGetN(p);
          (**m).resize(n);
          std::copy(data, data+n, (**m).begin());
        }
        return true;
      }

      // Cell array
      if (to_ptr_cell(p, m)) return true;

      // No match
      return false;
    }

    bool to_ptr(mxArray *p, std::vector<casadi_int>** m) {
      if (mxIsDouble(p) && mxGetNumberOfDimensions(p)==2
          && (mxGetM(p)<=1 || mxGetN(p)<=1)) {
        double* data = static_cast<double*>(mxGetData(p));
        casadi_int n = mxGetM(p)*mxGetN(p);

        // Check if all integers
        bool all_integers=true;
        for (casadi_int i=0; all_integers && i<n; ++i) {
          if (data[i]!=static_cast<casadi_int>(data[i])) {
            all_integers = false;
            break;
          }
        }

        // Successful conversion
        if (all_integers) {
          if (m) {
            (**m).resize(n);
            std::copy(data, data+n, (**m).begin());
          }
          return true;
        }
      }

      if (mxIsLogical(p) && !mxIsLogicalScalar(p) &&mxGetNumberOfDimensions(p)==2
          && (mxGetM(p)<=1 || mxGetN(p)<=1) ) {
        casadi_int n = mxGetM(p)*mxGetN(p);
        mxLogical* data = static_cast<mxLogical*>(mxGetData(p));
        if (m) {
          (**m).resize(n);
          std::copy(data, data+n, (**m).begin());
        }
        return true;
      }

      // Cell array
      if (to_ptr_cell(p, m)) return true;

      return false;
    }

    bool to_ptr(mxArray *p, std::vector<bool>** m) {
      if (mxIsDouble(p) && mxGetNumberOfDimensions(p)==2
          && (mxGetM(p)<=1 || mxGetN(p)<=1)) {
        double* data = static_cast<double*>(mxGetData(p));
        casadi_int n = mxGetM(p)*mxGetN(p);

        // Check if all integers
        bool all_0_or_1 = true;
        for (casadi_int i=0; all_0_or_1 && i<n; ++i) {
          double d = data[i];
          all_0_or_1 = all_0_or_1 && (d==1 || d==0);
        }

        // Successful conversion
        if (all_0_or_1) {
          if (m) {
            (**m).resize(n);
            std::copy(data, data+n, (**m).begin());
          }
          return true;
        }
      }

      if (mxIsLogical(p) && !mxIsLogicalScalar(p) &&mxGetNumberOfDimensions(p)==2
          && (mxGetM(p)<=1 || mxGetN(p)<=1) ) {
        casadi_int n = mxGetM(p)*mxGetN(p);
        mxLogical* data = static_cast<mxLogical*>(mxGetData(p));
        if (m) {
          (**m).resize(n);
          std::copy(data, data+n, (**m).begin());
        }
        return true;
      }

      // Cell array
      if (to_ptr_cell(p, m)) return true;

      return false;
    }

    // MATLAB n-by-m char array mapped to vector of length m
    bool to_ptr(mxArray *p, std::vector<std::string>** m) {
      if (mxIsChar(p)) {
	if (m) {
          // Get data
	  size_t nrow = mxGetM(p);
	  size_t ncol = mxGetN(p);
          mxChar *data = mxGetChars(p);

          // Allocate space for output
          (**m).resize(nrow);
          std::vector<std::string> &m_ref = **m;

          // For all strings
          for (size_t j=0; j!=nrow; ++j) {
            // Get length without trailing spaces
            size_t len = ncol;
            while (len!=0 && data[j + nrow*(len-1)]==' ') --len;

            // Check if null-terminated
            for (size_t i=0; i!=len; ++i) {
              if (data[j + nrow*i]=='\0') {
                len = i;
                break;
              }
            }

            // Create a string of the desired length
            m_ref[j] = std::string(len, ' ');

            // Get string content
            for (size_t i=0; i!=len; ++i) {
              m_ref[j][i] = data[j + nrow*i];
            }
          }
        }
	return true;
      }

      // Cell array
      if (to_ptr_cell(p, m)) return true;

      // No match
      return false;
    }


    template<typename M> bool to_ptr(mxArray *p, std::vector<M>** m) {
      // Treat Null
      if (is_null(p)) return false;













































      // Cell array
      if (to_ptr_cell(p, m)) return true;

      // No match
      return false;
    }


    mxArray* from_ptr(const std::vector<double> *a) {
      mxArray* ret = mxCreateDoubleMatrix(1, a->size(), mxREAL);
      std::copy(a->begin(), a->end(), static_cast<double*>(mxGetData(ret)));
      return ret;
    }
    mxArray* from_ptr(const std::vector<casadi_int> *a) {
      mxArray* ret = mxCreateDoubleMatrix(1, a->size(), mxREAL);
      std::copy(a->begin(), a->end(), static_cast<double*>(mxGetData(ret)));
      return ret;
    }
    mxArray* from_ptr(const std::vector<bool> *a) {
      mxArray* ret = mxCreateLogicalMatrix(1, a->size());
      std::copy(a->begin(), a->end(), static_cast<bool*>(mxGetData(ret)));
      return ret;
    }
    mxArray* from_ptr(const std::vector<std::string> *a) {
      // Collect arguments as char arrays
      std::vector<const char*> str(a->size());
      for (size_t i=0; i<str.size(); ++i) str[i] = (*a)[i].c_str();

      // std::vector<string> maps to MATLAB char array with multiple columns
      return mxCreateCharMatrixFromStrings(str.size(), str.empty() ? 0 : &str[0]);
    }


    template<typename M> mxArray* from_ptr(const std::vector<M> *a) {














      // std::vector maps to MATLAB cell array
      mxArray* ret = mxCreateCellMatrix(1, a->size());
      if (!ret) return 0;
      for (casadi_int k=0; k<a->size(); ++k) {
        mxArray* el = from_ref(a->at(k));
        if (!el) return 0;
        mxSetCell(ret, k, el);
      }
      return ret;



    }
  } // namespace casadi


  namespace casadi {



    // Cell array
    template<typename M> bool to_ptr_cell2(mxArray *p, std::vector< std::vector<M> >** m) {
      // Cell arrays (only row vectors)
      if (mxGetClassID(p)==mxCELL_CLASS) {
        casadi_int nrow = mxGetM(p), ncol = mxGetN(p);
        if (true) {
          // Allocate elements
          if (m) {
            (**m).clear();
            (**m).resize(nrow, std::vector<M>(ncol));
          }

          // Temporary
          M tmp;

          // Loop over elements
          for (casadi_int i=0; i<nrow*ncol; ++i) {
            // Get element
            mxArray* pe = mxGetCell(p, i);
            if (pe==0) return false;

            // Convert element
            M *m_i = m ? &tmp : 0;
            if (!to_ptr(pe, m_i ? &m_i : 0)) {
              return false;
            }

            if (m) (**m)[i % nrow][i / nrow] = tmp;
          }
          return true;
        }
      }
      return false;
    }



    template<typename M> bool to_ptr(mxArray *p, std::vector< std::vector<M> >** m) {
      // Treat Null
      if (is_null(p)) return false;

      // Pass on to to_ptr(GUESTOBJECT *p, std::vector<M>** m)
      if (to_ptr< std::vector<M> >(p, m)) return true;


      // Cell array
      if (to_ptr_cell2(p, m)) return true;

      return false;
    }

  } // namespace casadi


  namespace casadi {
    bool to_ptr(mxArray *p, Function** m) {
      // Treat Null
      if (is_null(p)) return false;

      // Function already?
      if (SWIG_IsOK(SWIG_ConvertPtr(p, reinterpret_cast<void**>(m),
                                    SWIGTYPE_p_casadi__Function, 0))) {
        return true;
      }

      // No match
      return false;
    }

    mxArray* from_ptr(const Function *a) {
      return SWIG_NewPointerObj(new Function(*a), SWIGTYPE_p_casadi__Function, SWIG_POINTER_OWN);
    }
  } // namespace casadi


  namespace casadi {
    bool to_ptr(mxArray *p, GenericType** m) {







      // Treat Null
      if (is_null(p)) return false;

      // GenericType already?
      if (SWIG_IsOK(SWIG_ConvertPtr(p, reinterpret_cast<void**>(m),
                                    SWIGTYPE_p_casadi__GenericType, 0))) {
        return true;
      }

      // Try to convert to different types
      if (to_generic<casadi_int>(p, m)
          || to_generic<double>(p, m)
          || to_generic<std::string>(p, m)
          || to_generic<std::vector<casadi_int> >(p, m)
          || to_generic<std::vector<double> >(p, m)
          || to_generic<std::vector<bool> >(p, m)
          || to_generic<std::vector<std::string> >(p, m)
          || to_generic<std::vector<std::vector<std::string> > >(p, m)
          || to_generic<std::vector<std::vector<casadi_int> > >(p, m)
          || to_generic<std::vector<std::vector<double> > >(p, m)
          || to_generic<casadi::Function>(p, m)
          || to_generic<std::vector<casadi::Function> >(p, m)
          || to_generic<casadi::GenericType::Dict>(p, m)
          || to_generic<std::vector<casadi::GenericType::Dict> >(p, m)
          || to_generic<std::vector<std::vector<casadi::GenericType> > >(p, m)
          || to_generic<std::vector<casadi::GenericType> >(p, m)) {
        return true;
      }

      // Check if it can be converted to boolean (last as e.g. can be converted to boolean)
      if (to_generic<bool>(p, m)) return true;

      // No match
      return false;
    }

    mxArray * from_ptr(const GenericType *a) {
      switch (a->getType()) {
      case OT_BOOL: return from_tmp(a->as_bool());
      case OT_INT: return from_tmp(a->as_int());
      case OT_DOUBLE: return from_tmp(a->as_double());
      case OT_STRING: return from_tmp(a->as_string());
      case OT_INTVECTOR: return from_tmp(a->as_int_vector());
      case OT_INTVECTORVECTOR: return from_tmp(a->as_int_vector_vector());
      case OT_BOOLVECTOR: return from_tmp(a->as_bool_vector());
      case OT_DOUBLEVECTOR: return from_tmp(a->as_double_vector());
      case OT_DOUBLEVECTORVECTOR: return from_tmp(a->as_double_vector_vector());
      case OT_STRINGVECTOR: return from_tmp(a->as_string_vector());
      case OT_STRINGVECTORVECTOR: return from_tmp(a->as_string_vector_vector());
      case OT_DICT: return from_tmp(a->as_dict());
      case OT_DICTVECTOR: return from_tmp(a->as_dict_vector());
      case OT_VECTORVECTOR: return from_tmp(a->as_vector_vector());
      case OT_VECTOR: return from_tmp(a->as_vector());
      case OT_FUNCTION: return from_tmp(a->as_function());
      case OT_FUNCTIONVECTOR: return from_tmp(a->as_function_vector());






      case OT_VOIDPTR:
        return mxCreateDoubleScalar(0);

      default: return 0;
      }
    }
  } // namespace casadi


  namespace casadi {
    bool to_ptr(mxArray *p, std::string** m) {
      // Treat Null
      if (is_null(p)) return false;

      // String already?
      if (SWIG_IsOK(SWIG_ConvertPtr(p, reinterpret_cast<void**>(m),
                                    SWIGTYPE_p_std__string, 0))) {
        return true;
      }











      if (mxIsChar(p) && mxGetM(p)<=1) {
        if (m) {
          if (mxGetM(p)==0) return true;
          size_t len=mxGetN(p);
          std::vector<char> s(len+1);
          if (mxGetString(p, &s[0], (len+1)*sizeof(char))) return false;
          **m = std::string(&s[0], len);
        }
        return true;
      }


      // No match
      return false;
    }

    mxArray* from_ptr(const std::string *a) {



      return mxCreateString(a->c_str());



    }
  } // namespace casadi


  namespace casadi {
    bool to_ptr(mxArray *p, Slice** m) {
      // Treat Null
      if (is_null(p)) return false;

      // Slice already?
      if (SWIG_IsOK(SWIG_ConvertPtr(p, reinterpret_cast<void**>(m),
                                    SWIGTYPE_p_casadi__Slice, 0))) {
        return true;
      }


























      // No match
      return false;
    }

    mxArray* from_ptr(const Slice *a) {
      return SWIG_NewPointerObj(new Slice(*a), SWIGTYPE_p_casadi__Slice, SWIG_POINTER_OWN);
    }

  } // namespace casadi


  namespace casadi {
    template<typename M> bool to_ptr(mxArray *p, std::map<std::string, M>** m) {

















      if (mxIsStruct(p) && mxGetM(p)==1 && mxGetN(p)==1) {
	casadi_int len = mxGetNumberOfFields(p);
	for (casadi_int k=0; k<len; ++k) {
	  mxArray *value = mxGetFieldByNumber(p, 0, k);
          if (m) {
	    M *v=&(**m)[std::string(mxGetFieldNameByNumber(p, k))], *v2=v;
            if (!casadi::to_ptr(value, &v)) return false;
            if (v!=v2) *v2=*v; // if only pointer changed
	  } else {
            if (!casadi::to_ptr(value, static_cast<M**>(0))) return false;
	  }
	}
        return true;
      }

      return false;
    }

    template<typename M> mxArray* from_ptr(const std::map<std::string, M> *a) {













      // Get vectors of the field names and mxArrays
      std::vector<const char*> fieldnames;
      std::vector<mxArray*> fields;
      for (typename std::map<std::string, M>::const_iterator it=a->begin(); it!=a->end(); ++it) {
	fieldnames.push_back(it->first.c_str());
	mxArray* f = from_ptr(&it->second);
	if (!f) {
	  // Deallocate elements created up to now
	  for (casadi_int k=0; k<fields.size(); ++k) mxDestroyArray(fields[k]);
	  return 0;
	}
	fields.push_back(f);
      }

      // Create return object
      mxArray *p = mxCreateStructMatrix(1, 1, fields.size(),
					fieldnames.empty() ? 0 : &fieldnames[0]);
      for (casadi_int k=0; k<fields.size(); ++k) mxSetFieldByNumber(p, 0, k, fields[k]);
      return p;



    }
  } // namespace casadi


  namespace casadi {

    bool to_ptr(mxArray *p, std::pair<casadi_int, casadi_int>** m) {
      // (casadi_int,casadi_int) mapped to 2-by-1 double matrix
      if (mxIsDouble(p) && mxGetNumberOfDimensions(p)==2 && !mxIsSparse(p)
          && mxGetM(p)==1 && mxGetN(p)==2) {
        double* data = static_cast<double*>(mxGetData(p));
        casadi_int first = static_cast<casadi_int>(data[0]);
        casadi_int second = static_cast<casadi_int>(data[1]);
        if (data[0]==first && data[1]==second) {
          if (m) **m = std::make_pair(first, second);
          return true;
        } else {
          return false;
        }
      }

      // No match
      return false;
    }


    template<typename M1, typename M2> bool to_ptr(mxArray *p, std::pair<M1, M2>** m) {








      // Other overloads mapped to 2-by-1 cell array
      if (mxGetClassID(p)==mxCELL_CLASS && mxGetM(p)==1 && mxGetN(p)==2) {
        mxArray *p_first = mxGetCell(p, 0);
        mxArray *p_second = mxGetCell(p, 1);
        return to_val(p_first, m ? &(**m).first : 0)
          && to_val(p_second, m ? &(**m).second : 0);
      }

      // No match
      return false;
    }


    mxArray* from_ptr(const std::pair<casadi_int, casadi_int>* a) {
      // (casadi_int,casadi_int) mapped to 2-by-1 double matrix
      mxArray* ret = mxCreateDoubleMatrix(1, 2, mxREAL);
      double* data = static_cast<double*>(mxGetData(ret));
      data[0] = a->first;
      data[1] = a->second;
      return ret;
    }


    template<typename M1, typename M2> mxArray* from_ptr(const std::pair<M1, M2>* a) {






      // Other overloads mapped to 2-by-1 cell array
      mxArray* ret = mxCreateCellMatrix(1, 2);
      mxSetCell(ret, 0, from_ref(a->first));
      mxSetCell(ret, 1, from_ref(a->second));
      return ret;



    }
  } // namespace casadi
 

  namespace casadi {
    bool to_ptr(mxArray *p, SX** m) {
      // Treat Null
      if (is_null(p)) return false;

      // SX already?
      if (SWIG_IsOK(SWIG_ConvertPtr(p, reinterpret_cast<void**>(m),
                                    SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0))) {
        return true;
      }

      // Try first converting to a temporary DM
      {
        DM tmp;
        if(to_val(p, m? &tmp: 0)) {
          if (m) **m = tmp;
          return true;
        }
      }














      // No match
      return false;
    }

    mxArray* from_ptr(const SX *a) {
      return SWIG_NewPointerObj(new SX(*a), SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, SWIG_POINTER_OWN);
    }
  } // namespace casadi
 

  namespace casadi {
    bool to_ptr(mxArray *p, SXElem** m) {
      // Treat Null
      if (is_null(p)) return false;

      // Try first converting to a temporary SX
      {
        SX tmp, *mt=&tmp;
        if(casadi::to_ptr(p, m ? &mt : 0)) {
          if (m && !mt->is_scalar()) return false;
          if (m) **m = mt->scalar();
          return true;
        }
      }

      // No match
      return false;
    }

    mxArray* from_ptr(const SXElem *a) {
      return from_ref(SX(*a));
    }
  } // namespace casadi
 

  namespace casadi {
    bool to_ptr(mxArray *p, MX** m) {
      // Treat Null
      if (is_null(p)) return false;

      // MX already?
      if (SWIG_IsOK(SWIG_ConvertPtr(p, reinterpret_cast<void**>(m),
                                    SWIGTYPE_p_casadi__MX, 0))) {
        return true;
      }

      // Try first converting to a temporary DM
      {
        DM tmp;
        if(to_val(p, m ? &tmp : 0)) {
          if (m) **m = tmp;
          return true;
        }
      }











      // No match
      return false;
    }

    mxArray* from_ptr(const MX *a) {
      return SWIG_NewPointerObj(new MX(*a), SWIGTYPE_p_casadi__MX, SWIG_POINTER_OWN);
    }
  } // namespace casadi
 

  namespace casadi {












    bool to_ptr(mxArray *p, DM** m) {
      // Treat Null
      if (is_null(p)) return false;

      // DM already?
      if (SWIG_IsOK(SWIG_ConvertPtr(p, reinterpret_cast<void**>(m),
                                    SWIGTYPE_p_casadi__MatrixT_double_t, 0))) {
        return true;
      }

      // Object is a sparsity pattern
      {
        Sparsity *m2;
        if (SWIG_IsOK(SWIG_ConvertPtr(p, reinterpret_cast<void**>(&m2),
                                      SWIGTYPE_p_casadi__Sparsity, 0))) {
          if (m) **m=DM::ones(*m2);
          return true;
        }
      }

      // Double scalar
      {
        double tmp;
        if (to_val(p, m? &tmp: 0)) {
          if (m) **m=tmp;
          return true;
        }
      }




























      // MATLAB double matrix (sparse or dense)
      if (mxIsDouble(p) && mxGetNumberOfDimensions(p)==2) {
        if (m) {
          **m = casadi::DM(get_sparsity(p));
          double* data = static_cast<double*>(mxGetData(p));
          casadi_copy(data, (*m)->nnz(), (*m)->ptr());
        }
        return true;
      }


      // No match
      return false;
    }

    mxArray* from_ptr(const DM *a) {
      return SWIG_NewPointerObj(new DM(*a), SWIGTYPE_p_casadi__MatrixT_double_t, SWIG_POINTER_OWN);
    }
  } // namespace casadi


  namespace casadi {
    bool to_ptr(mxArray *p, Sparsity** m) {
      // Treat Null
      if (is_null(p)) return false;

      // Sparsity already?
      if (SWIG_IsOK(SWIG_ConvertPtr(p, reinterpret_cast<void**>(m),
                                    SWIGTYPE_p_casadi__Sparsity, 0))) {
        return true;
      }

      // No match
      return false;
    }

    mxArray* from_ptr(const Sparsity *a) {
      return SWIG_NewPointerObj(new Sparsity(*a), SWIGTYPE_p_casadi__Sparsity, SWIG_POINTER_OWN);
    }
  } // namespace casadi


  namespace casadi {
    bool to_ptr(mxArray *p, IM** m) {
      // Treat Null
      if (is_null(p)) return false;

      // Object is a sparsity pattern
      {
        Sparsity *m2;
        if (SWIG_IsOK(SWIG_ConvertPtr(p, reinterpret_cast<void**>(&m2),
                                      SWIGTYPE_p_casadi__Sparsity, 0))) {
          if (m) **m=IM::ones(*m2);
          return true;
        }
      }

      // First convert to integer
      {
        casadi_int tmp;
        if (to_val(p, m? &tmp: 0)) {
          if (m) **m=tmp;
          return true;
        }
      }























      // In MATLAB, it is common to use floating point values to represent integers
      if (mxIsDouble(p) && mxGetNumberOfDimensions(p)==2) {
        double* data = static_cast<double*>(mxGetData(p));

        // Check if all integers
        bool all_integers=true;
        size_t sz = getNNZ(p);
        for (size_t i=0; i<sz; ++i) {
          if (data[i] != casadi_int(data[i])) {
            all_integers = false;
            break;
          }
        }

        // If successful
        if (all_integers) {
          if (m) {
            **m = casadi::IM(get_sparsity(p));
            for (size_t i=0; i<sz; ++i) {
              (**m)->at(i) = casadi_int(data[i]);
            }
          }
          return true;
        }
      }


      // Convert from DM
      {
        DM tmp;
        if (to_val(p, m? &tmp: 0)) {
          // Check integrality
          for (double d : tmp.nonzeros()) {
            if (d!=casadi_int(d)) return false;
          }
          // Convert
          if (m) {
            **m = casadi::Matrix<double>(tmp);
          }
          return true;
        }
      }

      // No match
      return false;
    }
    mxArray* from_ptr(const IM *a) {
      DM tmp(*a);
      return from_ref(tmp);
    }

  } // namespace casadi
 
 
SWIGINTERN casadi::Sparsity casadi_SparsityInterfaceCommon_casadi_horzcat__SWIG_0(std::vector< casadi::Sparsity,std::allocator< casadi::Sparsity > > const &v){
  return horzcat(v);
 }
SWIGINTERN casadi::Sparsity casadi_SparsityInterfaceCommon_casadi_vertcat__SWIG_0(std::vector< casadi::Sparsity,std::allocator< casadi::Sparsity > > const &v){
 return vertcat(v);
 }
SWIGINTERN std::vector< casadi::Sparsity,std::allocator< casadi::Sparsity > > casadi_SparsityInterfaceCommon_casadi_horzsplit__SWIG_0(casadi::Sparsity const &v,std::vector< casadi_int,std::allocator< casadi_int > > const &offset){
 return horzsplit(v, offset);
 }
SWIGINTERN std::vector< casadi::Sparsity,std::allocator< casadi::Sparsity > > casadi_SparsityInterfaceCommon_casadi_horzsplit__SWIG_1(casadi::Sparsity const &v,casadi_int incr=1){
 return horzsplit(v, incr);
 }
SWIGINTERN std::vector< casadi::Sparsity,std::allocator< casadi::Sparsity > > casadi_SparsityInterfaceCommon_casadi_horzsplit_n__SWIG_0(casadi::Sparsity const &v,casadi_int n){
 return horzsplit_n(v, n);
 }
SWIGINTERN std::vector< casadi::Sparsity,std::allocator< casadi::Sparsity > > casadi_SparsityInterfaceCommon_casadi_vertsplit__SWIG_0(casadi::Sparsity const &v,std::vector< casadi_int,std::allocator< casadi_int > > const &offset){
 return vertsplit(v, offset);
 }
SWIGINTERN std::vector< casadi_int,std::allocator< casadi_int > > casadi_SparsityInterfaceCommon_casadi_offset__SWIG_0(std::vector< casadi::Sparsity,std::allocator< casadi::Sparsity > > const &v,bool vert=true){
 return offset(v, vert);
 }
SWIGINTERN std::vector< casadi::Sparsity,std::allocator< casadi::Sparsity > > casadi_SparsityInterfaceCommon_casadi_vertsplit__SWIG_1(casadi::Sparsity const &v,casadi_int incr=1){
 return vertsplit(v, incr);
 }
SWIGINTERN std::vector< casadi::Sparsity,std::allocator< casadi::Sparsity > > casadi_SparsityInterfaceCommon_casadi_vertsplit_n__SWIG_0(casadi::Sparsity const &v,casadi_int n){
 return vertsplit_n(v, n);
 }
SWIGINTERN casadi::Sparsity casadi_SparsityInterfaceCommon_casadi_blockcat__SWIG_0(casadi::Sparsity const &A,casadi::Sparsity const &B,casadi::Sparsity const &C,casadi::Sparsity const &D){
 return vertcat(horzcat(A, B), horzcat(C, D));
 }
SWIGINTERN std::vector< std::vector< casadi::Sparsity,std::allocator< casadi::Sparsity > >,std::allocator< std::vector< casadi::Sparsity,std::allocator< casadi::Sparsity > > > > casadi_SparsityInterfaceCommon_casadi_blocksplit__SWIG_0(casadi::Sparsity const &x,std::vector< casadi_int,std::allocator< casadi_int > > const &vert_offset,std::vector< casadi_int,std::allocator< casadi_int > > const &horz_offset){
 return blocksplit(x, vert_offset, horz_offset);
 }
SWIGINTERN std::vector< std::vector< casadi::Sparsity,std::allocator< casadi::Sparsity > >,std::allocator< std::vector< casadi::Sparsity,std::allocator< casadi::Sparsity > > > > casadi_SparsityInterfaceCommon_casadi_blocksplit__SWIG_1(casadi::Sparsity const &x,casadi_int vert_incr=1,casadi_int horz_incr=1){
 return blocksplit(x, vert_incr, horz_incr);
 }
SWIGINTERN casadi::Sparsity casadi_SparsityInterfaceCommon_casadi_diagcat__SWIG_0(std::vector< casadi::Sparsity,std::allocator< casadi::Sparsity > > const &A){
 return diagcat(A);
 }
SWIGINTERN std::vector< casadi::Sparsity,std::allocator< casadi::Sparsity > > casadi_SparsityInterfaceCommon_casadi_diagsplit__SWIG_0(casadi::Sparsity const &x,std::vector< casadi_int,std::allocator< casadi_int > > const &output_offset1,std::vector< casadi_int,std::allocator< casadi_int > > const &output_offset2){
 return diagsplit(x, output_offset1, output_offset2);
 }
SWIGINTERN std::vector< casadi::Sparsity,std::allocator< casadi::Sparsity > > casadi_SparsityInterfaceCommon_casadi_diagsplit__SWIG_1(casadi::Sparsity const &x,std::vector< casadi_int,std::allocator< casadi_int > > const &output_offset){
 return diagsplit(x, output_offset);
 }
SWIGINTERN std::vector< casadi::Sparsity,std::allocator< casadi::Sparsity > > casadi_SparsityInterfaceCommon_casadi_diagsplit__SWIG_2(casadi::Sparsity const &x,casadi_int incr=1){
 return diagsplit(x, incr);
 }
SWIGINTERN std::vector< casadi::Sparsity,std::allocator< casadi::Sparsity > > casadi_SparsityInterfaceCommon_casadi_diagsplit__SWIG_3(casadi::Sparsity const &x,casadi_int incr1,casadi_int incr2){
 return diagsplit(x, incr1, incr2);
 }
SWIGINTERN casadi::Sparsity casadi_SparsityInterfaceCommon_casadi_veccat__SWIG_0(std::vector< casadi::Sparsity,std::allocator< casadi::Sparsity > > const &x){
 return veccat(x);
 }
SWIGINTERN casadi::Sparsity casadi_SparsityInterfaceCommon_casadi_mtimes__SWIG_0(casadi::Sparsity const &x,casadi::Sparsity const &y){
 return mtimes(x, y);
 }
SWIGINTERN casadi::Sparsity casadi_SparsityInterfaceCommon_casadi_mtimes__SWIG_1(std::vector< casadi::Sparsity,std::allocator< casadi::Sparsity > > const &args){
 return mtimes(args);
 }
SWIGINTERN casadi::Sparsity casadi_SparsityInterfaceCommon_casadi_mac__SWIG_0(casadi::Sparsity const &X,casadi::Sparsity const &Y,casadi::Sparsity const &Z){
 return mac(X, Y, Z);
 }
SWIGINTERN casadi::Sparsity casadi_SparsityInterfaceCommon_casadi_transpose__SWIG_0(casadi::Sparsity const &X){
 return X.T();
 }
SWIGINTERN casadi::Sparsity casadi_SparsityInterfaceCommon_casadi_vec__SWIG_0(casadi::Sparsity const &a){
 return vec(a);
 }
SWIGINTERN casadi::Sparsity casadi_SparsityInterfaceCommon_casadi_reshape__SWIG_0(casadi::Sparsity const &a,casadi_int nrow,casadi_int ncol){
 return reshape(a, nrow, ncol);
 }
SWIGINTERN casadi::Sparsity casadi_SparsityInterfaceCommon_casadi_reshape__SWIG_1(casadi::Sparsity const &a,std::pair< casadi_int,casadi_int > rc){
 return reshape(a, rc.first, rc.second);
 }
SWIGINTERN casadi::Sparsity casadi_SparsityInterfaceCommon_casadi_reshape__SWIG_2(casadi::Sparsity const &a,casadi::Sparsity const &sp){
 return reshape(a, sp);
 }
SWIGINTERN casadi::Sparsity casadi_SparsityInterfaceCommon_casadi_sparsity_cast__SWIG_0(casadi::Sparsity const &a,casadi::Sparsity const &sp){
 return sparsity_cast(a, sp);
 }
SWIGINTERN casadi_int casadi_SparsityInterfaceCommon_casadi_sprank__SWIG_0(casadi::Sparsity const &A){
 return sprank(A);
 }
SWIGINTERN casadi_int casadi_SparsityInterfaceCommon_casadi_norm_0_mul__SWIG_0(casadi::Sparsity const &x,casadi::Sparsity const &y){
 return norm_0_mul(x, y);
 }
SWIGINTERN casadi::Sparsity casadi_SparsityInterfaceCommon_casadi_triu__SWIG_0(casadi::Sparsity const &a,bool includeDiagonal=true){
 return triu(a, includeDiagonal);
 }
SWIGINTERN casadi::Sparsity casadi_SparsityInterfaceCommon_casadi_tril__SWIG_0(casadi::Sparsity const &a,bool includeDiagonal=true){
 return tril(a, includeDiagonal);
 }
SWIGINTERN casadi::Sparsity casadi_SparsityInterfaceCommon_casadi_kron__SWIG_0(casadi::Sparsity const &a,casadi::Sparsity const &b){
 return kron(a, b);
 }
SWIGINTERN casadi::Sparsity casadi_SparsityInterfaceCommon_casadi_repmat__SWIG_0(casadi::Sparsity const &A,casadi_int n,casadi_int m=1){
 return repmat(A, n, m);
 }
SWIGINTERN casadi::Sparsity casadi_SparsityInterfaceCommon_casadi_repmat__SWIG_1(casadi::Sparsity const &A,std::pair< casadi_int,casadi_int > const &rc){
 return repmat(A, rc.first, rc.second);
 }
SWIGINTERN casadi::Sparsity casadi_SparsityInterfaceCommon_casadi_sum2__SWIG_0(casadi::Sparsity const &x){
 return sum2(x);
 }
SWIGINTERN casadi::Sparsity casadi_SparsityInterfaceCommon_casadi_sum1__SWIG_0(casadi::Sparsity const &x){
 return sum1(x);
 }
SWIGINTERN casadi_int casadi_SparsityInterfaceCommon_casadi_length__SWIG_0(casadi::Sparsity const &v){
      return std::max(v.size1(), v.size2());
     }
SWIGINTERN casadi::MX casadi_SparsityInterfaceCommon_casadi_horzcat__SWIG_1(std::vector< casadi::MX,std::allocator< casadi::MX > > const &v){
  return horzcat(v);
 }
SWIGINTERN casadi::MX casadi_SparsityInterfaceCommon_casadi_vertcat__SWIG_1(std::vector< casadi::MX,std::allocator< casadi::MX > > const &v){
 return vertcat(v);
 }
SWIGINTERN std::vector< casadi::MX,std::allocator< casadi::MX > > casadi_SparsityInterfaceCommon_casadi_horzsplit__SWIG_2(casadi::MX const &v,std::vector< casadi_int,std::allocator< casadi_int > > const &offset){
 return horzsplit(v, offset);
 }
SWIGINTERN std::vector< casadi::MX,std::allocator< casadi::MX > > casadi_SparsityInterfaceCommon_casadi_horzsplit__SWIG_3(casadi::MX const &v,casadi_int incr=1){
 return horzsplit(v, incr);
 }
SWIGINTERN std::vector< casadi::MX,std::allocator< casadi::MX > > casadi_SparsityInterfaceCommon_casadi_horzsplit_n__SWIG_1(casadi::MX const &v,casadi_int n){
 return horzsplit_n(v, n);
 }
SWIGINTERN std::vector< casadi::MX,std::allocator< casadi::MX > > casadi_SparsityInterfaceCommon_casadi_vertsplit__SWIG_2(casadi::MX const &v,std::vector< casadi_int,std::allocator< casadi_int > > const &offset){
 return vertsplit(v, offset);
 }
SWIGINTERN std::vector< casadi_int,std::allocator< casadi_int > > casadi_SparsityInterfaceCommon_casadi_offset__SWIG_1(std::vector< casadi::MX,std::allocator< casadi::MX > > const &v,bool vert=true){
 return offset(v, vert);
 }
SWIGINTERN std::vector< casadi::MX,std::allocator< casadi::MX > > casadi_SparsityInterfaceCommon_casadi_vertsplit__SWIG_3(casadi::MX const &v,casadi_int incr=1){
 return vertsplit(v, incr);
 }
SWIGINTERN std::vector< casadi::MX,std::allocator< casadi::MX > > casadi_SparsityInterfaceCommon_casadi_vertsplit_n__SWIG_1(casadi::MX const &v,casadi_int n){
 return vertsplit_n(v, n);
 }
SWIGINTERN casadi::MX casadi_SparsityInterfaceCommon_casadi_blockcat__SWIG_1(casadi::MX const &A,casadi::MX const &B,casadi::MX const &C,casadi::MX const &D){
 return vertcat(horzcat(A, B), horzcat(C, D));
 }
SWIGINTERN std::vector< std::vector< casadi::MX,std::allocator< casadi::MX > >,std::allocator< std::vector< casadi::MX,std::allocator< casadi::MX > > > > casadi_SparsityInterfaceCommon_casadi_blocksplit__SWIG_2(casadi::MX const &x,std::vector< casadi_int,std::allocator< casadi_int > > const &vert_offset,std::vector< casadi_int,std::allocator< casadi_int > > const &horz_offset){
 return blocksplit(x, vert_offset, horz_offset);
 }
SWIGINTERN std::vector< std::vector< casadi::MX,std::allocator< casadi::MX > >,std::allocator< std::vector< casadi::MX,std::allocator< casadi::MX > > > > casadi_SparsityInterfaceCommon_casadi_blocksplit__SWIG_3(casadi::MX const &x,casadi_int vert_incr=1,casadi_int horz_incr=1){
 return blocksplit(x, vert_incr, horz_incr);
 }
SWIGINTERN casadi::MX casadi_SparsityInterfaceCommon_casadi_diagcat__SWIG_1(std::vector< casadi::MX,std::allocator< casadi::MX > > const &A){
 return diagcat(A);
 }
SWIGINTERN std::vector< casadi::MX,std::allocator< casadi::MX > > casadi_SparsityInterfaceCommon_casadi_diagsplit__SWIG_4(casadi::MX const &x,std::vector< casadi_int,std::allocator< casadi_int > > const &output_offset1,std::vector< casadi_int,std::allocator< casadi_int > > const &output_offset2){
 return diagsplit(x, output_offset1, output_offset2);
 }
SWIGINTERN std::vector< casadi::MX,std::allocator< casadi::MX > > casadi_SparsityInterfaceCommon_casadi_diagsplit__SWIG_5(casadi::MX const &x,std::vector< casadi_int,std::allocator< casadi_int > > const &output_offset){
 return diagsplit(x, output_offset);
 }
SWIGINTERN std::vector< casadi::MX,std::allocator< casadi::MX > > casadi_SparsityInterfaceCommon_casadi_diagsplit__SWIG_6(casadi::MX const &x,casadi_int incr=1){
 return diagsplit(x, incr);
 }
SWIGINTERN std::vector< casadi::MX,std::allocator< casadi::MX > > casadi_SparsityInterfaceCommon_casadi_diagsplit__SWIG_7(casadi::MX const &x,casadi_int incr1,casadi_int incr2){
 return diagsplit(x, incr1, incr2);
 }
SWIGINTERN casadi::MX casadi_SparsityInterfaceCommon_casadi_veccat__SWIG_1(std::vector< casadi::MX,std::allocator< casadi::MX > > const &x){
 return veccat(x);
 }
SWIGINTERN casadi::MX casadi_SparsityInterfaceCommon_casadi_mtimes__SWIG_2(casadi::MX const &x,casadi::MX const &y){
 return mtimes(x, y);
 }
SWIGINTERN casadi::MX casadi_SparsityInterfaceCommon_casadi_mtimes__SWIG_3(std::vector< casadi::MX,std::allocator< casadi::MX > > const &args){
 return mtimes(args);
 }
SWIGINTERN casadi::MX casadi_SparsityInterfaceCommon_casadi_mac__SWIG_1(casadi::MX const &X,casadi::MX const &Y,casadi::MX const &Z){
 return mac(X, Y, Z);
 }
SWIGINTERN casadi::MX casadi_SparsityInterfaceCommon_casadi_transpose__SWIG_1(casadi::MX const &X){
 return X.T();
 }
SWIGINTERN casadi::MX casadi_SparsityInterfaceCommon_casadi_vec__SWIG_1(casadi::MX const &a){
 return vec(a);
 }
SWIGINTERN casadi::MX casadi_SparsityInterfaceCommon_casadi_reshape__SWIG_3(casadi::MX const &a,casadi_int nrow,casadi_int ncol){
 return reshape(a, nrow, ncol);
 }
SWIGINTERN casadi::MX casadi_SparsityInterfaceCommon_casadi_reshape__SWIG_4(casadi::MX const &a,std::pair< casadi_int,casadi_int > rc){
 return reshape(a, rc.first, rc.second);
 }
SWIGINTERN casadi::MX casadi_SparsityInterfaceCommon_casadi_reshape__SWIG_5(casadi::MX const &a,casadi::Sparsity const &sp){
 return reshape(a, sp);
 }
SWIGINTERN casadi::MX casadi_SparsityInterfaceCommon_casadi_sparsity_cast__SWIG_1(casadi::MX const &a,casadi::Sparsity const &sp){
 return sparsity_cast(a, sp);
 }
SWIGINTERN casadi_int casadi_SparsityInterfaceCommon_casadi_sprank__SWIG_1(casadi::MX const &A){
 return sprank(A);
 }
SWIGINTERN casadi_int casadi_SparsityInterfaceCommon_casadi_norm_0_mul__SWIG_1(casadi::MX const &x,casadi::MX const &y){
 return norm_0_mul(x, y);
 }
SWIGINTERN casadi::MX casadi_SparsityInterfaceCommon_casadi_triu__SWIG_1(casadi::MX const &a,bool includeDiagonal=true){
 return triu(a, includeDiagonal);
 }
SWIGINTERN casadi::MX casadi_SparsityInterfaceCommon_casadi_tril__SWIG_1(casadi::MX const &a,bool includeDiagonal=true){
 return tril(a, includeDiagonal);
 }
SWIGINTERN casadi::MX casadi_SparsityInterfaceCommon_casadi_kron__SWIG_1(casadi::MX const &a,casadi::MX const &b){
 return kron(a, b);
 }
SWIGINTERN casadi::MX casadi_SparsityInterfaceCommon_casadi_repmat__SWIG_2(casadi::MX const &A,casadi_int n,casadi_int m=1){
 return repmat(A, n, m);
 }
SWIGINTERN casadi::MX casadi_SparsityInterfaceCommon_casadi_repmat__SWIG_3(casadi::MX const &A,std::pair< casadi_int,casadi_int > const &rc){
 return repmat(A, rc.first, rc.second);
 }
SWIGINTERN casadi::MX casadi_SparsityInterfaceCommon_casadi_sum2__SWIG_1(casadi::MX const &x){
 return sum2(x);
 }
SWIGINTERN casadi::MX casadi_SparsityInterfaceCommon_casadi_sum1__SWIG_1(casadi::MX const &x){
 return sum1(x);
 }
SWIGINTERN casadi_int casadi_SparsityInterfaceCommon_casadi_length__SWIG_1(casadi::MX const &v){
      return std::max(v.size1(), v.size2());
     }
SWIGINTERN casadi::Matrix< double > casadi_SparsityInterfaceCommon_casadi_horzcat__SWIG_2(std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > const &v){
  return horzcat(v);
 }
SWIGINTERN casadi::Matrix< double > casadi_SparsityInterfaceCommon_casadi_vertcat__SWIG_2(std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > const &v){
 return vertcat(v);
 }
SWIGINTERN std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > casadi_SparsityInterfaceCommon_casadi_horzsplit__SWIG_4(casadi::Matrix< double > const &v,std::vector< casadi_int,std::allocator< casadi_int > > const &offset){
 return horzsplit(v, offset);
 }
SWIGINTERN std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > casadi_SparsityInterfaceCommon_casadi_horzsplit__SWIG_5(casadi::Matrix< double > const &v,casadi_int incr=1){
 return horzsplit(v, incr);
 }
SWIGINTERN std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > casadi_SparsityInterfaceCommon_casadi_horzsplit_n__SWIG_2(casadi::Matrix< double > const &v,casadi_int n){
 return horzsplit_n(v, n);
 }
SWIGINTERN std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > casadi_SparsityInterfaceCommon_casadi_vertsplit__SWIG_4(casadi::Matrix< double > const &v,std::vector< casadi_int,std::allocator< casadi_int > > const &offset){
 return vertsplit(v, offset);
 }
SWIGINTERN std::vector< casadi_int,std::allocator< casadi_int > > casadi_SparsityInterfaceCommon_casadi_offset__SWIG_2(std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > const &v,bool vert=true){
 return offset(v, vert);
 }
SWIGINTERN std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > casadi_SparsityInterfaceCommon_casadi_vertsplit__SWIG_5(casadi::Matrix< double > const &v,casadi_int incr=1){
 return vertsplit(v, incr);
 }
SWIGINTERN std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > casadi_SparsityInterfaceCommon_casadi_vertsplit_n__SWIG_2(casadi::Matrix< double > const &v,casadi_int n){
 return vertsplit_n(v, n);
 }
SWIGINTERN casadi::Matrix< double > casadi_SparsityInterfaceCommon_casadi_blockcat__SWIG_2(casadi::Matrix< double > const &A,casadi::Matrix< double > const &B,casadi::Matrix< double > const &C,casadi::Matrix< double > const &D){
 return vertcat(horzcat(A, B), horzcat(C, D));
 }
SWIGINTERN std::vector< std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > >,std::allocator< std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > > > casadi_SparsityInterfaceCommon_casadi_blocksplit__SWIG_4(casadi::Matrix< double > const &x,std::vector< casadi_int,std::allocator< casadi_int > > const &vert_offset,std::vector< casadi_int,std::allocator< casadi_int > > const &horz_offset){
 return blocksplit(x, vert_offset, horz_offset);
 }
SWIGINTERN std::vector< std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > >,std::allocator< std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > > > casadi_SparsityInterfaceCommon_casadi_blocksplit__SWIG_5(casadi::Matrix< double > const &x,casadi_int vert_incr=1,casadi_int horz_incr=1){
 return blocksplit(x, vert_incr, horz_incr);
 }
SWIGINTERN casadi::Matrix< double > casadi_SparsityInterfaceCommon_casadi_diagcat__SWIG_2(std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > const &A){
 return diagcat(A);
 }
SWIGINTERN std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > casadi_SparsityInterfaceCommon_casadi_diagsplit__SWIG_8(casadi::Matrix< double > const &x,std::vector< casadi_int,std::allocator< casadi_int > > const &output_offset1,std::vector< casadi_int,std::allocator< casadi_int > > const &output_offset2){
 return diagsplit(x, output_offset1, output_offset2);
 }
SWIGINTERN std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > casadi_SparsityInterfaceCommon_casadi_diagsplit__SWIG_9(casadi::Matrix< double > const &x,std::vector< casadi_int,std::allocator< casadi_int > > const &output_offset){
 return diagsplit(x, output_offset);
 }
SWIGINTERN std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > casadi_SparsityInterfaceCommon_casadi_diagsplit__SWIG_10(casadi::Matrix< double > const &x,casadi_int incr=1){
 return diagsplit(x, incr);
 }
SWIGINTERN std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > casadi_SparsityInterfaceCommon_casadi_diagsplit__SWIG_11(casadi::Matrix< double > const &x,casadi_int incr1,casadi_int incr2){
 return diagsplit(x, incr1, incr2);
 }
SWIGINTERN casadi::Matrix< double > casadi_SparsityInterfaceCommon_casadi_veccat__SWIG_2(std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > const &x){
 return veccat(x);
 }
SWIGINTERN casadi::Matrix< double > casadi_SparsityInterfaceCommon_casadi_mtimes__SWIG_4(casadi::Matrix< double > const &x,casadi::Matrix< double > const &y){
 return mtimes(x, y);
 }
SWIGINTERN casadi::Matrix< double > casadi_SparsityInterfaceCommon_casadi_mtimes__SWIG_5(std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > const &args){
 return mtimes(args);
 }
SWIGINTERN casadi::Matrix< double > casadi_SparsityInterfaceCommon_casadi_mac__SWIG_2(casadi::Matrix< double > const &X,casadi::Matrix< double > const &Y,casadi::Matrix< double > const &Z){
 return mac(X, Y, Z);
 }
SWIGINTERN casadi::Matrix< double > casadi_SparsityInterfaceCommon_casadi_transpose__SWIG_2(casadi::Matrix< double > const &X){
 return X.T();
 }
SWIGINTERN casadi::Matrix< double > casadi_SparsityInterfaceCommon_casadi_vec__SWIG_2(casadi::Matrix< double > const &a){
 return vec(a);
 }
SWIGINTERN casadi::Matrix< double > casadi_SparsityInterfaceCommon_casadi_reshape__SWIG_6(casadi::Matrix< double > const &a,casadi_int nrow,casadi_int ncol){
 return reshape(a, nrow, ncol);
 }
SWIGINTERN casadi::Matrix< double > casadi_SparsityInterfaceCommon_casadi_reshape__SWIG_7(casadi::Matrix< double > const &a,std::pair< casadi_int,casadi_int > rc){
 return reshape(a, rc.first, rc.second);
 }
SWIGINTERN casadi::Matrix< double > casadi_SparsityInterfaceCommon_casadi_reshape__SWIG_8(casadi::Matrix< double > const &a,casadi::Sparsity const &sp){
 return reshape(a, sp);
 }
SWIGINTERN casadi::Matrix< double > casadi_SparsityInterfaceCommon_casadi_sparsity_cast__SWIG_2(casadi::Matrix< double > const &a,casadi::Sparsity const &sp){
 return sparsity_cast(a, sp);
 }
SWIGINTERN casadi_int casadi_SparsityInterfaceCommon_casadi_sprank__SWIG_2(casadi::Matrix< double > const &A){
 return sprank(A);
 }
SWIGINTERN casadi_int casadi_SparsityInterfaceCommon_casadi_norm_0_mul__SWIG_2(casadi::Matrix< double > const &x,casadi::Matrix< double > const &y){
 return norm_0_mul(x, y);
 }
SWIGINTERN casadi::Matrix< double > casadi_SparsityInterfaceCommon_casadi_triu__SWIG_2(casadi::Matrix< double > const &a,bool includeDiagonal=true){
 return triu(a, includeDiagonal);
 }
SWIGINTERN casadi::Matrix< double > casadi_SparsityInterfaceCommon_casadi_tril__SWIG_2(casadi::Matrix< double > const &a,bool includeDiagonal=true){
 return tril(a, includeDiagonal);
 }
SWIGINTERN casadi::Matrix< double > casadi_SparsityInterfaceCommon_casadi_kron__SWIG_2(casadi::Matrix< double > const &a,casadi::Matrix< double > const &b){
 return kron(a, b);
 }
SWIGINTERN casadi::Matrix< double > casadi_SparsityInterfaceCommon_casadi_repmat__SWIG_4(casadi::Matrix< double > const &A,casadi_int n,casadi_int m=1){
 return repmat(A, n, m);
 }
SWIGINTERN casadi::Matrix< double > casadi_SparsityInterfaceCommon_casadi_repmat__SWIG_5(casadi::Matrix< double > const &A,std::pair< casadi_int,casadi_int > const &rc){
 return repmat(A, rc.first, rc.second);
 }
SWIGINTERN casadi::Matrix< double > casadi_SparsityInterfaceCommon_casadi_sum2__SWIG_2(casadi::Matrix< double > const &x){
 return sum2(x);
 }
SWIGINTERN casadi::Matrix< double > casadi_SparsityInterfaceCommon_casadi_sum1__SWIG_2(casadi::Matrix< double > const &x){
 return sum1(x);
 }
SWIGINTERN casadi_int casadi_SparsityInterfaceCommon_casadi_length__SWIG_2(casadi::Matrix< double > const &v){
      return std::max(v.size1(), v.size2());
     }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_SparsityInterfaceCommon_casadi_horzcat__SWIG_3(std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > const &v){
  return horzcat(v);
 }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_SparsityInterfaceCommon_casadi_vertcat__SWIG_3(std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > const &v){
 return vertcat(v);
 }
SWIGINTERN std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > casadi_SparsityInterfaceCommon_casadi_horzsplit__SWIG_6(casadi::Matrix< casadi::SXElem > const &v,std::vector< casadi_int,std::allocator< casadi_int > > const &offset){
 return horzsplit(v, offset);
 }
SWIGINTERN std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > casadi_SparsityInterfaceCommon_casadi_horzsplit__SWIG_7(casadi::Matrix< casadi::SXElem > const &v,casadi_int incr=1){
 return horzsplit(v, incr);
 }
SWIGINTERN std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > casadi_SparsityInterfaceCommon_casadi_horzsplit_n__SWIG_3(casadi::Matrix< casadi::SXElem > const &v,casadi_int n){
 return horzsplit_n(v, n);
 }
SWIGINTERN std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > casadi_SparsityInterfaceCommon_casadi_vertsplit__SWIG_6(casadi::Matrix< casadi::SXElem > const &v,std::vector< casadi_int,std::allocator< casadi_int > > const &offset){
 return vertsplit(v, offset);
 }
SWIGINTERN std::vector< casadi_int,std::allocator< casadi_int > > casadi_SparsityInterfaceCommon_casadi_offset__SWIG_3(std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > const &v,bool vert=true){
 return offset(v, vert);
 }
SWIGINTERN std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > casadi_SparsityInterfaceCommon_casadi_vertsplit__SWIG_7(casadi::Matrix< casadi::SXElem > const &v,casadi_int incr=1){
 return vertsplit(v, incr);
 }
SWIGINTERN std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > casadi_SparsityInterfaceCommon_casadi_vertsplit_n__SWIG_3(casadi::Matrix< casadi::SXElem > const &v,casadi_int n){
 return vertsplit_n(v, n);
 }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_SparsityInterfaceCommon_casadi_blockcat__SWIG_3(casadi::Matrix< casadi::SXElem > const &A,casadi::Matrix< casadi::SXElem > const &B,casadi::Matrix< casadi::SXElem > const &C,casadi::Matrix< casadi::SXElem > const &D){
 return vertcat(horzcat(A, B), horzcat(C, D));
 }
SWIGINTERN std::vector< std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > >,std::allocator< std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > > > casadi_SparsityInterfaceCommon_casadi_blocksplit__SWIG_6(casadi::Matrix< casadi::SXElem > const &x,std::vector< casadi_int,std::allocator< casadi_int > > const &vert_offset,std::vector< casadi_int,std::allocator< casadi_int > > const &horz_offset){
 return blocksplit(x, vert_offset, horz_offset);
 }
SWIGINTERN std::vector< std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > >,std::allocator< std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > > > casadi_SparsityInterfaceCommon_casadi_blocksplit__SWIG_7(casadi::Matrix< casadi::SXElem > const &x,casadi_int vert_incr=1,casadi_int horz_incr=1){
 return blocksplit(x, vert_incr, horz_incr);
 }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_SparsityInterfaceCommon_casadi_diagcat__SWIG_3(std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > const &A){
 return diagcat(A);
 }
SWIGINTERN std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > casadi_SparsityInterfaceCommon_casadi_diagsplit__SWIG_12(casadi::Matrix< casadi::SXElem > const &x,std::vector< casadi_int,std::allocator< casadi_int > > const &output_offset1,std::vector< casadi_int,std::allocator< casadi_int > > const &output_offset2){
 return diagsplit(x, output_offset1, output_offset2);
 }
SWIGINTERN std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > casadi_SparsityInterfaceCommon_casadi_diagsplit__SWIG_13(casadi::Matrix< casadi::SXElem > const &x,std::vector< casadi_int,std::allocator< casadi_int > > const &output_offset){
 return diagsplit(x, output_offset);
 }
SWIGINTERN std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > casadi_SparsityInterfaceCommon_casadi_diagsplit__SWIG_14(casadi::Matrix< casadi::SXElem > const &x,casadi_int incr=1){
 return diagsplit(x, incr);
 }
SWIGINTERN std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > casadi_SparsityInterfaceCommon_casadi_diagsplit__SWIG_15(casadi::Matrix< casadi::SXElem > const &x,casadi_int incr1,casadi_int incr2){
 return diagsplit(x, incr1, incr2);
 }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_SparsityInterfaceCommon_casadi_veccat__SWIG_3(std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > const &x){
 return veccat(x);
 }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_SparsityInterfaceCommon_casadi_mtimes__SWIG_6(casadi::Matrix< casadi::SXElem > const &x,casadi::Matrix< casadi::SXElem > const &y){
 return mtimes(x, y);
 }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_SparsityInterfaceCommon_casadi_mtimes__SWIG_7(std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > const &args){
 return mtimes(args);
 }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_SparsityInterfaceCommon_casadi_mac__SWIG_3(casadi::Matrix< casadi::SXElem > const &X,casadi::Matrix< casadi::SXElem > const &Y,casadi::Matrix< casadi::SXElem > const &Z){
 return mac(X, Y, Z);
 }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_SparsityInterfaceCommon_casadi_transpose__SWIG_3(casadi::Matrix< casadi::SXElem > const &X){
 return X.T();
 }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_SparsityInterfaceCommon_casadi_vec__SWIG_3(casadi::Matrix< casadi::SXElem > const &a){
 return vec(a);
 }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_SparsityInterfaceCommon_casadi_reshape__SWIG_9(casadi::Matrix< casadi::SXElem > const &a,casadi_int nrow,casadi_int ncol){
 return reshape(a, nrow, ncol);
 }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_SparsityInterfaceCommon_casadi_reshape__SWIG_10(casadi::Matrix< casadi::SXElem > const &a,std::pair< casadi_int,casadi_int > rc){
 return reshape(a, rc.first, rc.second);
 }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_SparsityInterfaceCommon_casadi_reshape__SWIG_11(casadi::Matrix< casadi::SXElem > const &a,casadi::Sparsity const &sp){
 return reshape(a, sp);
 }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_SparsityInterfaceCommon_casadi_sparsity_cast__SWIG_3(casadi::Matrix< casadi::SXElem > const &a,casadi::Sparsity const &sp){
 return sparsity_cast(a, sp);
 }
SWIGINTERN casadi_int casadi_SparsityInterfaceCommon_casadi_sprank__SWIG_3(casadi::Matrix< casadi::SXElem > const &A){
 return sprank(A);
 }
SWIGINTERN casadi_int casadi_SparsityInterfaceCommon_casadi_norm_0_mul__SWIG_3(casadi::Matrix< casadi::SXElem > const &x,casadi::Matrix< casadi::SXElem > const &y){
 return norm_0_mul(x, y);
 }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_SparsityInterfaceCommon_casadi_triu__SWIG_3(casadi::Matrix< casadi::SXElem > const &a,bool includeDiagonal=true){
 return triu(a, includeDiagonal);
 }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_SparsityInterfaceCommon_casadi_tril__SWIG_3(casadi::Matrix< casadi::SXElem > const &a,bool includeDiagonal=true){
 return tril(a, includeDiagonal);
 }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_SparsityInterfaceCommon_casadi_kron__SWIG_3(casadi::Matrix< casadi::SXElem > const &a,casadi::Matrix< casadi::SXElem > const &b){
 return kron(a, b);
 }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_SparsityInterfaceCommon_casadi_repmat__SWIG_6(casadi::Matrix< casadi::SXElem > const &A,casadi_int n,casadi_int m=1){
 return repmat(A, n, m);
 }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_SparsityInterfaceCommon_casadi_repmat__SWIG_7(casadi::Matrix< casadi::SXElem > const &A,std::pair< casadi_int,casadi_int > const &rc){
 return repmat(A, rc.first, rc.second);
 }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_SparsityInterfaceCommon_casadi_sum2__SWIG_3(casadi::Matrix< casadi::SXElem > const &x){
 return sum2(x);
 }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_SparsityInterfaceCommon_casadi_sum1__SWIG_3(casadi::Matrix< casadi::SXElem > const &x){
 return sum1(x);
 }
SWIGINTERN casadi_int casadi_SparsityInterfaceCommon_casadi_length__SWIG_3(casadi::Matrix< casadi::SXElem > const &v){
      return std::max(v.size1(), v.size2());
     }

  SWIGINTERNINLINE mxArray* SWIG_From_unsigned_SS_long    (unsigned long value)
    {    
      mxArray* out = mxCreateNumericMatrix(1,1,mxUINT64_CLASS,mxREAL);
      *((uint64_T*)mxGetData(out)) = (uint64_T)value;
      return out;
    }


  SWIGINTERNINLINE mxArray* SWIG_From_unsigned_SS_long_SS_long    (unsigned long long value)
    {    
      mxArray* out = mxCreateNumericMatrix(1,1,mxUINT64_CLASS,mxREAL);
      *((uint64_T*)mxGetData(out)) = (uint64_T)value;
      return out;
    }


SWIGINTERNINLINE mxArray*
SWIG_From_size_t  (size_t value)
{    
#ifdef SWIG_LONG_LONG_AVAILABLE
  if (sizeof(size_t) <= sizeof(unsigned long)) {
#endif
    return SWIG_From_unsigned_SS_long  (static_cast< unsigned long >(value));
#ifdef SWIG_LONG_LONG_AVAILABLE
  } else {
    /* assume sizeof(size_t) <= sizeof(unsigned long long) */
    return SWIG_From_unsigned_SS_long_SS_long  (static_cast< unsigned long long >(value));
  }
#endif
}

SWIGINTERN casadi::MX casadi_GenericMatrixCommon_casadi_mpower__SWIG_0(casadi::MX const &x,casadi::MX const &n){
  return mpower(x, n);
}
SWIGINTERN casadi::MX casadi_GenericMatrixCommon_casadi_mrdivide__SWIG_0(casadi::MX const &x,casadi::MX const &y){
  return mrdivide(x, y);
}
SWIGINTERN casadi::MX casadi_GenericMatrixCommon_casadi_mldivide__SWIG_0(casadi::MX const &x,casadi::MX const &y){
  return mldivide(x, y);
}
SWIGINTERN std::vector< casadi::MX,std::allocator< casadi::MX > > casadi_GenericMatrixCommon_casadi_symvar__SWIG_0(casadi::MX const &x){
  return symvar(x);
}
SWIGINTERN casadi::MX casadi_GenericMatrixCommon_casadi_bilin__SWIG_0(casadi::MX const &A,casadi::MX const &x,casadi::MX const &y){
  return bilin(A, x, y);
}
SWIGINTERN casadi::MX casadi_GenericMatrixCommon_casadi_bilin__SWIG_1(casadi::MX const &A,casadi::MX const &x){
  return bilin(A, x);
}
SWIGINTERN casadi::MX casadi_GenericMatrixCommon_casadi_rank1__SWIG_0(casadi::MX const &A,casadi::MX const &alpha,casadi::MX const &x,casadi::MX const &y){
  return rank1(A, alpha, x, y);
}
SWIGINTERN casadi::MX casadi_GenericMatrixCommon_casadi_sumsqr__SWIG_0(casadi::MX const &X){
  return sumsqr(X);
}
SWIGINTERN casadi::MX casadi_GenericMatrixCommon_casadi_linspace__SWIG_0(casadi::MX const &a,casadi::MX const &b,casadi_int nsteps){
  return linspace(a, b, nsteps);
}
SWIGINTERN casadi::MX casadi_GenericMatrixCommon_casadi_logsumexp__SWIG_0(casadi::MX const &a){
  return logsumexp(a);
}
SWIGINTERN casadi::MX casadi_GenericMatrixCommon_casadi_logsumexp__SWIG_1(casadi::MX const &a,casadi::MX const &margin){
  return logsumexp(a, margin);
}
SWIGINTERN casadi::MX casadi_GenericMatrixCommon_casadi_interp1d__SWIG_0(std::vector< double,std::allocator< double > > const &x,casadi::MX const &v,std::vector< double,std::allocator< double > > const &xq,std::string const &mode="linear",bool equidistant=false){
  return interp1d(x, v, xq, mode, equidistant);
}
SWIGINTERN casadi::MX casadi_GenericMatrixCommon_casadi_soc__SWIG_0(casadi::MX const &x,casadi::MX const &y){
  return soc(x, y);
}
SWIGINTERN casadi::MX casadi_GenericMatrixCommon_casadi_cross__SWIG_0(casadi::MX const &a,casadi::MX const &b,casadi_int dim=-1){
  return cross(a, b, dim);
}
SWIGINTERN casadi::MX casadi_GenericMatrixCommon_casadi_skew__SWIG_0(casadi::MX const &a){
  return skew(a);
}
SWIGINTERN casadi::MX casadi_GenericMatrixCommon_casadi_inv_skew__SWIG_0(casadi::MX const &a){
  return inv_skew(a);
}
SWIGINTERN casadi::MX casadi_GenericMatrixCommon_casadi_det__SWIG_0(casadi::MX const &A){
  return det(A);
}
SWIGINTERN casadi::MX casadi_GenericMatrixCommon_casadi_inv_minor__SWIG_0(casadi::MX const &A){
  return inv_minor(A);
}
SWIGINTERN casadi::MX casadi_GenericMatrixCommon_casadi_inv__SWIG_0(casadi::MX const &A){
  return inv(A);
}
SWIGINTERN casadi::MX casadi_GenericMatrixCommon_casadi_inv__SWIG_1(casadi::MX const &A,std::string const &lsolver,casadi::Dict const &opts=casadi::Dict()){
  return inv(A, lsolver, opts);
}
SWIGINTERN casadi::MX casadi_GenericMatrixCommon_casadi_trace__SWIG_0(casadi::MX const &a){
  return trace(a);
}
SWIGINTERN casadi::MX casadi_GenericMatrixCommon_casadi_tril2symm__SWIG_0(casadi::MX const &a){
  return tril2symm(a);
}
SWIGINTERN casadi::MX casadi_GenericMatrixCommon_casadi_triu2symm__SWIG_0(casadi::MX const &a){
  return triu2symm(a);
}
SWIGINTERN casadi::MX casadi_GenericMatrixCommon_casadi_norm_fro__SWIG_0(casadi::MX const &x){
  return norm_fro(x);
}
SWIGINTERN casadi::MX casadi_GenericMatrixCommon_casadi_norm_2__SWIG_0(casadi::MX const &x){
  return norm_2(x);
}
SWIGINTERN casadi::MX casadi_GenericMatrixCommon_casadi_norm_1__SWIG_0(casadi::MX const &x){
  return norm_1(x);
}
SWIGINTERN casadi::MX casadi_GenericMatrixCommon_casadi_norm_inf__SWIG_0(casadi::MX const &x){
  return norm_inf(x);
}
SWIGINTERN casadi::MX casadi_GenericMatrixCommon_casadi_dot__SWIG_0(casadi::MX const &x,casadi::MX const &y){
  return dot(x, y);
}
SWIGINTERN casadi::MX casadi_GenericMatrixCommon_casadi_nullspace__SWIG_0(casadi::MX const &A){
  return nullspace(A);
}
SWIGINTERN casadi::MX casadi_GenericMatrixCommon_casadi_polyval__SWIG_0(casadi::MX const &p,casadi::MX const &x){
  return polyval(p, x);
}
SWIGINTERN casadi::MX casadi_GenericMatrixCommon_casadi_diag__SWIG_0(casadi::MX const &A){
  return diag(A);
}
SWIGINTERN casadi::MX casadi_GenericMatrixCommon_casadi_unite__SWIG_0(casadi::MX const &A,casadi::MX const &B){
  return unite(A, B);
}
SWIGINTERN casadi::MX casadi_GenericMatrixCommon_casadi_densify__SWIG_0(casadi::MX const &x){
  return densify(x);
}
SWIGINTERN casadi::MX casadi_GenericMatrixCommon_casadi_project__SWIG_0(casadi::MX const &A,casadi::Sparsity const &sp,bool intersect=false){
  return project(A, sp, intersect);
}
SWIGINTERN casadi::MX casadi_GenericMatrixCommon_casadi_if_else__SWIG_0(casadi::MX const &cond,casadi::MX const &if_true,casadi::MX const &if_false,bool short_circuit=false){
  return if_else(cond, if_true, if_false, short_circuit);
}
SWIGINTERN casadi::MX casadi_GenericMatrixCommon_casadi_conditional__SWIG_0(casadi::MX const &ind,std::vector< casadi::MX,std::allocator< casadi::MX > > const &x,casadi::MX const &x_default,bool short_circuit=false){
  return conditional(ind, x, x_default, short_circuit);
}
SWIGINTERN bool casadi_GenericMatrixCommon_casadi_depends_on__SWIG_0(casadi::MX const &f,casadi::MX const &arg){
  return depends_on(f, arg);
}
SWIGINTERN casadi::MX casadi_GenericMatrixCommon_casadi_solve__SWIG_0(casadi::MX const &A,casadi::MX const &b){
  return solve(A, b);
}
SWIGINTERN casadi::MX casadi_GenericMatrixCommon_casadi_solve__SWIG_1(casadi::MX const &A,casadi::MX const &b,std::string const &lsolver,casadi::Dict const &opts=casadi::Dict()){
  return solve(A, b, lsolver, opts);
}
SWIGINTERN casadi::MX casadi_GenericMatrixCommon_casadi_pinv__SWIG_0(casadi::MX const &A){
  return pinv(A);
}
SWIGINTERN casadi::MX casadi_GenericMatrixCommon_casadi_pinv__SWIG_1(casadi::MX const &A,std::string const &lsolver,casadi::Dict const &opts=casadi::Dict()){
  return pinv(A, lsolver, opts);
}
SWIGINTERN casadi::MX casadi_GenericMatrixCommon_casadi_expm_const__SWIG_0(casadi::MX const &A,casadi::MX const &t){
  return expm_const(A, t);
}
SWIGINTERN casadi::MX casadi_GenericMatrixCommon_casadi_expm__SWIG_0(casadi::MX const &A){
  return expm(A);
}
SWIGINTERN casadi::MX casadi_GenericMatrixCommon_casadi_jacobian__SWIG_0(casadi::MX const &ex,casadi::MX const &arg,casadi::Dict const &opts=casadi::Dict()){
  return jacobian(ex, arg, opts);
}
SWIGINTERN casadi::MX casadi_GenericMatrixCommon_casadi_jtimes__SWIG_0(casadi::MX const &ex,casadi::MX const &arg,casadi::MX const &v,bool tr=false){
  return jtimes(ex, arg, v, tr);
}
SWIGINTERN casadi::MX casadi_GenericMatrixCommon_casadi_linearize__SWIG_0(casadi::MX const &f,casadi::MX const &x,casadi::MX const &x0){
  return linearize(f, x, x0);
}
SWIGINTERN std::vector< bool,std::allocator< bool > > casadi_GenericMatrixCommon_casadi_which_depends__SWIG_0(casadi::MX const &expr,casadi::MX const &var,casadi_int order=1,bool tr=false){
  return which_depends(expr, var, order, tr);
}
SWIGINTERN casadi::Sparsity casadi_GenericMatrixCommon_casadi_jacobian_sparsity__SWIG_0(casadi::MX const &f,casadi::MX const &x){
  return jacobian_sparsity(f, x);
}
SWIGINTERN bool casadi_GenericMatrixCommon_casadi_is_linear__SWIG_0(casadi::MX const &expr,casadi::MX const &var){
  return is_linear(expr, var);
}
SWIGINTERN bool casadi_GenericMatrixCommon_casadi_is_quadratic__SWIG_0(casadi::MX const &expr,casadi::MX const &var){
  return is_quadratic(expr, var);
}
SWIGINTERN casadi::MX casadi_GenericMatrixCommon_casadi_gradient__SWIG_0(casadi::MX const &ex,casadi::MX const &arg){
  return gradient(ex, arg);
}
SWIGINTERN casadi::MX casadi_GenericMatrixCommon_casadi_tangent__SWIG_0(casadi::MX const &ex,casadi::MX const &arg){
  return tangent(ex, arg);
}
SWIGINTERN casadi::MX casadi_GenericMatrixCommon_casadi_hessian__SWIG_0(casadi::MX const &ex,casadi::MX const &arg,casadi::MX &OUTPUT1,casadi::Dict const &opts=casadi::Dict()){
  return hessian(ex, arg, OUTPUT1, opts);
}
SWIGINTERN void casadi_GenericMatrixCommon_casadi_quadratic_coeff__SWIG_0(casadi::MX const &ex,casadi::MX const &arg,casadi::MX &OUTPUT1,casadi::MX &OUTPUT2,casadi::MX &OUTPUT3,bool check=true){
  quadratic_coeff(ex, arg, OUTPUT1, OUTPUT2, OUTPUT3, check);
}
SWIGINTERN void casadi_GenericMatrixCommon_casadi_linear_coeff__SWIG_0(casadi::MX const &ex,casadi::MX const &arg,casadi::MX &OUTPUT1,casadi::MX &OUTPUT2,bool check=true){
  linear_coeff(ex, arg, OUTPUT1, OUTPUT2, check);
}
SWIGINTERN casadi_int casadi_GenericMatrixCommon_casadi_n_nodes__SWIG_0(casadi::MX const &A){
  return n_nodes(A);
}
SWIGINTERN std::string casadi_GenericMatrixCommon_casadi_print_operator__SWIG_0(casadi::MX const &xb,std::vector< std::string,std::allocator< std::string > > const &args){
  return print_operator(xb, args);
}
SWIGINTERN casadi::MX casadi_GenericMatrixCommon_casadi_repsum__SWIG_0(casadi::MX const &A,casadi_int n,casadi_int m=1){
  return repsum(A, n, m);
}
SWIGINTERN casadi::MX casadi_GenericMatrixCommon_casadi_diff__SWIG_0(casadi::MX const &A,casadi_int n=1,casadi_index axis=-1){
  return diff(A, n, axis);
}
SWIGINTERN casadi::MX casadi_GenericMatrixCommon_casadi_cumsum__SWIG_0(casadi::MX const &A,casadi_index axis=-1){
  return cumsum(A, axis);
}
SWIGINTERN casadi::MX casadi_GenericMatrixCommon_casadi_einstein__SWIG_0(casadi::MX const &A,casadi::MX const &B,casadi::MX const &C,std::vector< casadi_int,std::allocator< casadi_int > > const &dim_a,std::vector< casadi_int,std::allocator< casadi_int > > const &dim_b,std::vector< casadi_int,std::allocator< casadi_int > > const &dim_c,std::vector< casadi_int,std::allocator< casadi_int > > const &a,std::vector< casadi_int,std::allocator< casadi_int > > const &b,std::vector< casadi_int,std::allocator< casadi_int > > const &c){
  return einstein(A, B, C, dim_a, dim_b, dim_c, a, b, c);
}
SWIGINTERN casadi::MX casadi_GenericMatrixCommon_casadi_einstein__SWIG_1(casadi::MX const &A,casadi::MX const &B,std::vector< casadi_int,std::allocator< casadi_int > > const &dim_a,std::vector< casadi_int,std::allocator< casadi_int > > const &dim_b,std::vector< casadi_int,std::allocator< casadi_int > > const &dim_c,std::vector< casadi_int,std::allocator< casadi_int > > const &a,std::vector< casadi_int,std::allocator< casadi_int > > const &b,std::vector< casadi_int,std::allocator< casadi_int > > const &c){
  return einstein(A, B, dim_a, dim_b, dim_c, a, b, c);
}
SWIGINTERN casadi::MX casadi_GenericMatrixCommon_casadi_mmin__SWIG_0(casadi::MX const &x){ return mmin(x); }
SWIGINTERN casadi::MX casadi_GenericMatrixCommon_casadi_mmax__SWIG_0(casadi::MX const &x){ return mmax(x); }
SWIGINTERN casadi::DM casadi_GenericMatrixCommon_casadi_evalf__SWIG_0(casadi::MX const &x){
  return evalf(x);
}
SWIGINTERN std::vector< casadi::MX,std::allocator< casadi::MX > > casadi_GenericMatrixCommon_casadi_cse__SWIG_0(std::vector< casadi::MX,std::allocator< casadi::MX > > const &e){
  return cse(e);
}
SWIGINTERN casadi::MX casadi_GenericMatrixCommon_casadi_cse__SWIG_1(casadi::MX const &e){
  return cse(e);
}
SWIGINTERN casadi::Matrix< double > casadi_GenericMatrixCommon_casadi_mpower__SWIG_1(casadi::Matrix< double > const &x,casadi::Matrix< double > const &n){
  return mpower(x, n);
}
SWIGINTERN casadi::Matrix< double > casadi_GenericMatrixCommon_casadi_mrdivide__SWIG_1(casadi::Matrix< double > const &x,casadi::Matrix< double > const &y){
  return mrdivide(x, y);
}
SWIGINTERN casadi::Matrix< double > casadi_GenericMatrixCommon_casadi_mldivide__SWIG_1(casadi::Matrix< double > const &x,casadi::Matrix< double > const &y){
  return mldivide(x, y);
}
SWIGINTERN std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > casadi_GenericMatrixCommon_casadi_symvar__SWIG_1(casadi::Matrix< double > const &x){
  return symvar(x);
}
SWIGINTERN casadi::Matrix< double > casadi_GenericMatrixCommon_casadi_bilin__SWIG_2(casadi::Matrix< double > const &A,casadi::Matrix< double > const &x,casadi::Matrix< double > const &y){
  return bilin(A, x, y);
}
SWIGINTERN casadi::Matrix< double > casadi_GenericMatrixCommon_casadi_bilin__SWIG_3(casadi::Matrix< double > const &A,casadi::Matrix< double > const &x){
  return bilin(A, x);
}
SWIGINTERN casadi::Matrix< double > casadi_GenericMatrixCommon_casadi_rank1__SWIG_1(casadi::Matrix< double > const &A,casadi::Matrix< double > const &alpha,casadi::Matrix< double > const &x,casadi::Matrix< double > const &y){
  return rank1(A, alpha, x, y);
}
SWIGINTERN casadi::Matrix< double > casadi_GenericMatrixCommon_casadi_sumsqr__SWIG_1(casadi::Matrix< double > const &X){
  return sumsqr(X);
}
SWIGINTERN casadi::Matrix< double > casadi_GenericMatrixCommon_casadi_linspace__SWIG_1(casadi::Matrix< double > const &a,casadi::Matrix< double > const &b,casadi_int nsteps){
  return linspace(a, b, nsteps);
}
SWIGINTERN casadi::Matrix< double > casadi_GenericMatrixCommon_casadi_logsumexp__SWIG_2(casadi::Matrix< double > const &a){
  return logsumexp(a);
}
SWIGINTERN casadi::Matrix< double > casadi_GenericMatrixCommon_casadi_logsumexp__SWIG_3(casadi::Matrix< double > const &a,casadi::Matrix< double > const &margin){
  return logsumexp(a, margin);
}
SWIGINTERN casadi::Matrix< double > casadi_GenericMatrixCommon_casadi_interp1d__SWIG_1(std::vector< double,std::allocator< double > > const &x,casadi::Matrix< double > const &v,std::vector< double,std::allocator< double > > const &xq,std::string const &mode="linear",bool equidistant=false){
  return interp1d(x, v, xq, mode, equidistant);
}
SWIGINTERN casadi::Matrix< double > casadi_GenericMatrixCommon_casadi_soc__SWIG_1(casadi::Matrix< double > const &x,casadi::Matrix< double > const &y){
  return soc(x, y);
}
SWIGINTERN casadi::Matrix< double > casadi_GenericMatrixCommon_casadi_cross__SWIG_1(casadi::Matrix< double > const &a,casadi::Matrix< double > const &b,casadi_int dim=-1){
  return cross(a, b, dim);
}
SWIGINTERN casadi::Matrix< double > casadi_GenericMatrixCommon_casadi_skew__SWIG_1(casadi::Matrix< double > const &a){
  return skew(a);
}
SWIGINTERN casadi::Matrix< double > casadi_GenericMatrixCommon_casadi_inv_skew__SWIG_1(casadi::Matrix< double > const &a){
  return inv_skew(a);
}
SWIGINTERN casadi::Matrix< double > casadi_GenericMatrixCommon_casadi_det__SWIG_1(casadi::Matrix< double > const &A){
  return det(A);
}
SWIGINTERN casadi::Matrix< double > casadi_GenericMatrixCommon_casadi_inv_minor__SWIG_1(casadi::Matrix< double > const &A){
  return inv_minor(A);
}
SWIGINTERN casadi::Matrix< double > casadi_GenericMatrixCommon_casadi_inv__SWIG_2(casadi::Matrix< double > const &A){
  return inv(A);
}
SWIGINTERN casadi::Matrix< double > casadi_GenericMatrixCommon_casadi_inv__SWIG_3(casadi::Matrix< double > const &A,std::string const &lsolver,casadi::Dict const &opts=casadi::Dict()){
  return inv(A, lsolver, opts);
}
SWIGINTERN casadi::Matrix< double > casadi_GenericMatrixCommon_casadi_trace__SWIG_1(casadi::Matrix< double > const &a){
  return trace(a);
}
SWIGINTERN casadi::Matrix< double > casadi_GenericMatrixCommon_casadi_tril2symm__SWIG_1(casadi::Matrix< double > const &a){
  return tril2symm(a);
}
SWIGINTERN casadi::Matrix< double > casadi_GenericMatrixCommon_casadi_triu2symm__SWIG_1(casadi::Matrix< double > const &a){
  return triu2symm(a);
}
SWIGINTERN casadi::Matrix< double > casadi_GenericMatrixCommon_casadi_norm_fro__SWIG_1(casadi::Matrix< double > const &x){
  return norm_fro(x);
}
SWIGINTERN casadi::Matrix< double > casadi_GenericMatrixCommon_casadi_norm_2__SWIG_1(casadi::Matrix< double > const &x){
  return norm_2(x);
}
SWIGINTERN casadi::Matrix< double > casadi_GenericMatrixCommon_casadi_norm_1__SWIG_1(casadi::Matrix< double > const &x){
  return norm_1(x);
}
SWIGINTERN casadi::Matrix< double > casadi_GenericMatrixCommon_casadi_norm_inf__SWIG_1(casadi::Matrix< double > const &x){
  return norm_inf(x);
}
SWIGINTERN casadi::Matrix< double > casadi_GenericMatrixCommon_casadi_dot__SWIG_1(casadi::Matrix< double > const &x,casadi::Matrix< double > const &y){
  return dot(x, y);
}
SWIGINTERN casadi::Matrix< double > casadi_GenericMatrixCommon_casadi_nullspace__SWIG_1(casadi::Matrix< double > const &A){
  return nullspace(A);
}
SWIGINTERN casadi::Matrix< double > casadi_GenericMatrixCommon_casadi_polyval__SWIG_1(casadi::Matrix< double > const &p,casadi::Matrix< double > const &x){
  return polyval(p, x);
}
SWIGINTERN casadi::Matrix< double > casadi_GenericMatrixCommon_casadi_diag__SWIG_1(casadi::Matrix< double > const &A){
  return diag(A);
}
SWIGINTERN casadi::Matrix< double > casadi_GenericMatrixCommon_casadi_unite__SWIG_1(casadi::Matrix< double > const &A,casadi::Matrix< double > const &B){
  return unite(A, B);
}
SWIGINTERN casadi::Matrix< double > casadi_GenericMatrixCommon_casadi_densify__SWIG_1(casadi::Matrix< double > const &x){
  return densify(x);
}
SWIGINTERN casadi::Matrix< double > casadi_GenericMatrixCommon_casadi_project__SWIG_1(casadi::Matrix< double > const &A,casadi::Sparsity const &sp,bool intersect=false){
  return project(A, sp, intersect);
}
SWIGINTERN casadi::Matrix< double > casadi_GenericMatrixCommon_casadi_if_else__SWIG_1(casadi::Matrix< double > const &cond,casadi::Matrix< double > const &if_true,casadi::Matrix< double > const &if_false,bool short_circuit=false){
  return if_else(cond, if_true, if_false, short_circuit);
}
SWIGINTERN casadi::Matrix< double > casadi_GenericMatrixCommon_casadi_conditional__SWIG_1(casadi::Matrix< double > const &ind,std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > const &x,casadi::Matrix< double > const &x_default,bool short_circuit=false){
  return conditional(ind, x, x_default, short_circuit);
}
SWIGINTERN bool casadi_GenericMatrixCommon_casadi_depends_on__SWIG_1(casadi::Matrix< double > const &f,casadi::Matrix< double > const &arg){
  return depends_on(f, arg);
}
SWIGINTERN casadi::Matrix< double > casadi_GenericMatrixCommon_casadi_solve__SWIG_2(casadi::Matrix< double > const &A,casadi::Matrix< double > const &b){
  return solve(A, b);
}
SWIGINTERN casadi::Matrix< double > casadi_GenericMatrixCommon_casadi_solve__SWIG_3(casadi::Matrix< double > const &A,casadi::Matrix< double > const &b,std::string const &lsolver,casadi::Dict const &opts=casadi::Dict()){
  return solve(A, b, lsolver, opts);
}
SWIGINTERN casadi::Matrix< double > casadi_GenericMatrixCommon_casadi_pinv__SWIG_2(casadi::Matrix< double > const &A){
  return pinv(A);
}
SWIGINTERN casadi::Matrix< double > casadi_GenericMatrixCommon_casadi_pinv__SWIG_3(casadi::Matrix< double > const &A,std::string const &lsolver,casadi::Dict const &opts=casadi::Dict()){
  return pinv(A, lsolver, opts);
}
SWIGINTERN casadi::Matrix< double > casadi_GenericMatrixCommon_casadi_expm_const__SWIG_1(casadi::Matrix< double > const &A,casadi::Matrix< double > const &t){
  return expm_const(A, t);
}
SWIGINTERN casadi::Matrix< double > casadi_GenericMatrixCommon_casadi_expm__SWIG_1(casadi::Matrix< double > const &A){
  return expm(A);
}
SWIGINTERN casadi::Matrix< double > casadi_GenericMatrixCommon_casadi_jacobian__SWIG_1(casadi::Matrix< double > const &ex,casadi::Matrix< double > const &arg,casadi::Dict const &opts=casadi::Dict()){
  return jacobian(ex, arg, opts);
}
SWIGINTERN casadi::Matrix< double > casadi_GenericMatrixCommon_casadi_jtimes__SWIG_1(casadi::Matrix< double > const &ex,casadi::Matrix< double > const &arg,casadi::Matrix< double > const &v,bool tr=false){
  return jtimes(ex, arg, v, tr);
}
SWIGINTERN casadi::Matrix< double > casadi_GenericMatrixCommon_casadi_linearize__SWIG_1(casadi::Matrix< double > const &f,casadi::Matrix< double > const &x,casadi::Matrix< double > const &x0){
  return linearize(f, x, x0);
}
SWIGINTERN std::vector< bool,std::allocator< bool > > casadi_GenericMatrixCommon_casadi_which_depends__SWIG_1(casadi::Matrix< double > const &expr,casadi::Matrix< double > const &var,casadi_int order=1,bool tr=false){
  return which_depends(expr, var, order, tr);
}
SWIGINTERN casadi::Sparsity casadi_GenericMatrixCommon_casadi_jacobian_sparsity__SWIG_1(casadi::Matrix< double > const &f,casadi::Matrix< double > const &x){
  return jacobian_sparsity(f, x);
}
SWIGINTERN bool casadi_GenericMatrixCommon_casadi_is_linear__SWIG_1(casadi::Matrix< double > const &expr,casadi::Matrix< double > const &var){
  return is_linear(expr, var);
}
SWIGINTERN bool casadi_GenericMatrixCommon_casadi_is_quadratic__SWIG_1(casadi::Matrix< double > const &expr,casadi::Matrix< double > const &var){
  return is_quadratic(expr, var);
}
SWIGINTERN casadi::Matrix< double > casadi_GenericMatrixCommon_casadi_gradient__SWIG_1(casadi::Matrix< double > const &ex,casadi::Matrix< double > const &arg){
  return gradient(ex, arg);
}
SWIGINTERN casadi::Matrix< double > casadi_GenericMatrixCommon_casadi_tangent__SWIG_1(casadi::Matrix< double > const &ex,casadi::Matrix< double > const &arg){
  return tangent(ex, arg);
}
SWIGINTERN casadi::Matrix< double > casadi_GenericMatrixCommon_casadi_hessian__SWIG_1(casadi::Matrix< double > const &ex,casadi::Matrix< double > const &arg,casadi::Matrix< double > &OUTPUT1,casadi::Dict const &opts=casadi::Dict()){
  return hessian(ex, arg, OUTPUT1, opts);
}
SWIGINTERN void casadi_GenericMatrixCommon_casadi_quadratic_coeff__SWIG_1(casadi::Matrix< double > const &ex,casadi::Matrix< double > const &arg,casadi::Matrix< double > &OUTPUT1,casadi::Matrix< double > &OUTPUT2,casadi::Matrix< double > &OUTPUT3,bool check=true){
  quadratic_coeff(ex, arg, OUTPUT1, OUTPUT2, OUTPUT3, check);
}
SWIGINTERN void casadi_GenericMatrixCommon_casadi_linear_coeff__SWIG_1(casadi::Matrix< double > const &ex,casadi::Matrix< double > const &arg,casadi::Matrix< double > &OUTPUT1,casadi::Matrix< double > &OUTPUT2,bool check=true){
  linear_coeff(ex, arg, OUTPUT1, OUTPUT2, check);
}
SWIGINTERN casadi_int casadi_GenericMatrixCommon_casadi_n_nodes__SWIG_1(casadi::Matrix< double > const &A){
  return n_nodes(A);
}
SWIGINTERN std::string casadi_GenericMatrixCommon_casadi_print_operator__SWIG_1(casadi::Matrix< double > const &xb,std::vector< std::string,std::allocator< std::string > > const &args){
  return print_operator(xb, args);
}
SWIGINTERN casadi::Matrix< double > casadi_GenericMatrixCommon_casadi_repsum__SWIG_1(casadi::Matrix< double > const &A,casadi_int n,casadi_int m=1){
  return repsum(A, n, m);
}
SWIGINTERN casadi::Matrix< double > casadi_GenericMatrixCommon_casadi_diff__SWIG_1(casadi::Matrix< double > const &A,casadi_int n=1,casadi_index axis=-1){
  return diff(A, n, axis);
}
SWIGINTERN casadi::Matrix< double > casadi_GenericMatrixCommon_casadi_cumsum__SWIG_1(casadi::Matrix< double > const &A,casadi_index axis=-1){
  return cumsum(A, axis);
}
SWIGINTERN casadi::Matrix< double > casadi_GenericMatrixCommon_casadi_einstein__SWIG_2(casadi::Matrix< double > const &A,casadi::Matrix< double > const &B,casadi::Matrix< double > const &C,std::vector< casadi_int,std::allocator< casadi_int > > const &dim_a,std::vector< casadi_int,std::allocator< casadi_int > > const &dim_b,std::vector< casadi_int,std::allocator< casadi_int > > const &dim_c,std::vector< casadi_int,std::allocator< casadi_int > > const &a,std::vector< casadi_int,std::allocator< casadi_int > > const &b,std::vector< casadi_int,std::allocator< casadi_int > > const &c){
  return einstein(A, B, C, dim_a, dim_b, dim_c, a, b, c);
}
SWIGINTERN casadi::Matrix< double > casadi_GenericMatrixCommon_casadi_einstein__SWIG_3(casadi::Matrix< double > const &A,casadi::Matrix< double > const &B,std::vector< casadi_int,std::allocator< casadi_int > > const &dim_a,std::vector< casadi_int,std::allocator< casadi_int > > const &dim_b,std::vector< casadi_int,std::allocator< casadi_int > > const &dim_c,std::vector< casadi_int,std::allocator< casadi_int > > const &a,std::vector< casadi_int,std::allocator< casadi_int > > const &b,std::vector< casadi_int,std::allocator< casadi_int > > const &c){
  return einstein(A, B, dim_a, dim_b, dim_c, a, b, c);
}
SWIGINTERN casadi::Matrix< double > casadi_GenericMatrixCommon_casadi_mmin__SWIG_1(casadi::Matrix< double > const &x){ return mmin(x); }
SWIGINTERN casadi::Matrix< double > casadi_GenericMatrixCommon_casadi_mmax__SWIG_1(casadi::Matrix< double > const &x){ return mmax(x); }
SWIGINTERN casadi::DM casadi_GenericMatrixCommon_casadi_evalf__SWIG_1(casadi::Matrix< double > const &x){
  return evalf(x);
}
SWIGINTERN std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > casadi_GenericMatrixCommon_casadi_cse__SWIG_2(std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > const &e){
  return cse(e);
}
SWIGINTERN casadi::Matrix< double > casadi_GenericMatrixCommon_casadi_cse__SWIG_3(casadi::Matrix< double > const &e){
  return cse(e);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericMatrixCommon_casadi_mpower__SWIG_2(casadi::Matrix< casadi::SXElem > const &x,casadi::Matrix< casadi::SXElem > const &n){
  return mpower(x, n);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericMatrixCommon_casadi_mrdivide__SWIG_2(casadi::Matrix< casadi::SXElem > const &x,casadi::Matrix< casadi::SXElem > const &y){
  return mrdivide(x, y);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericMatrixCommon_casadi_mldivide__SWIG_2(casadi::Matrix< casadi::SXElem > const &x,casadi::Matrix< casadi::SXElem > const &y){
  return mldivide(x, y);
}
SWIGINTERN std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > casadi_GenericMatrixCommon_casadi_symvar__SWIG_2(casadi::Matrix< casadi::SXElem > const &x){
  return symvar(x);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericMatrixCommon_casadi_bilin__SWIG_4(casadi::Matrix< casadi::SXElem > const &A,casadi::Matrix< casadi::SXElem > const &x,casadi::Matrix< casadi::SXElem > const &y){
  return bilin(A, x, y);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericMatrixCommon_casadi_bilin__SWIG_5(casadi::Matrix< casadi::SXElem > const &A,casadi::Matrix< casadi::SXElem > const &x){
  return bilin(A, x);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericMatrixCommon_casadi_rank1__SWIG_2(casadi::Matrix< casadi::SXElem > const &A,casadi::Matrix< casadi::SXElem > const &alpha,casadi::Matrix< casadi::SXElem > const &x,casadi::Matrix< casadi::SXElem > const &y){
  return rank1(A, alpha, x, y);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericMatrixCommon_casadi_sumsqr__SWIG_2(casadi::Matrix< casadi::SXElem > const &X){
  return sumsqr(X);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericMatrixCommon_casadi_linspace__SWIG_2(casadi::Matrix< casadi::SXElem > const &a,casadi::Matrix< casadi::SXElem > const &b,casadi_int nsteps){
  return linspace(a, b, nsteps);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericMatrixCommon_casadi_logsumexp__SWIG_4(casadi::Matrix< casadi::SXElem > const &a){
  return logsumexp(a);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericMatrixCommon_casadi_logsumexp__SWIG_5(casadi::Matrix< casadi::SXElem > const &a,casadi::Matrix< casadi::SXElem > const &margin){
  return logsumexp(a, margin);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericMatrixCommon_casadi_interp1d__SWIG_2(std::vector< double,std::allocator< double > > const &x,casadi::Matrix< casadi::SXElem > const &v,std::vector< double,std::allocator< double > > const &xq,std::string const &mode="linear",bool equidistant=false){
  return interp1d(x, v, xq, mode, equidistant);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericMatrixCommon_casadi_soc__SWIG_2(casadi::Matrix< casadi::SXElem > const &x,casadi::Matrix< casadi::SXElem > const &y){
  return soc(x, y);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericMatrixCommon_casadi_cross__SWIG_2(casadi::Matrix< casadi::SXElem > const &a,casadi::Matrix< casadi::SXElem > const &b,casadi_int dim=-1){
  return cross(a, b, dim);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericMatrixCommon_casadi_skew__SWIG_2(casadi::Matrix< casadi::SXElem > const &a){
  return skew(a);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericMatrixCommon_casadi_inv_skew__SWIG_2(casadi::Matrix< casadi::SXElem > const &a){
  return inv_skew(a);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericMatrixCommon_casadi_det__SWIG_2(casadi::Matrix< casadi::SXElem > const &A){
  return det(A);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericMatrixCommon_casadi_inv_minor__SWIG_2(casadi::Matrix< casadi::SXElem > const &A){
  return inv_minor(A);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericMatrixCommon_casadi_inv__SWIG_4(casadi::Matrix< casadi::SXElem > const &A){
  return inv(A);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericMatrixCommon_casadi_inv__SWIG_5(casadi::Matrix< casadi::SXElem > const &A,std::string const &lsolver,casadi::Dict const &opts=casadi::Dict()){
  return inv(A, lsolver, opts);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericMatrixCommon_casadi_trace__SWIG_2(casadi::Matrix< casadi::SXElem > const &a){
  return trace(a);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericMatrixCommon_casadi_tril2symm__SWIG_2(casadi::Matrix< casadi::SXElem > const &a){
  return tril2symm(a);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericMatrixCommon_casadi_triu2symm__SWIG_2(casadi::Matrix< casadi::SXElem > const &a){
  return triu2symm(a);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericMatrixCommon_casadi_norm_fro__SWIG_2(casadi::Matrix< casadi::SXElem > const &x){
  return norm_fro(x);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericMatrixCommon_casadi_norm_2__SWIG_2(casadi::Matrix< casadi::SXElem > const &x){
  return norm_2(x);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericMatrixCommon_casadi_norm_1__SWIG_2(casadi::Matrix< casadi::SXElem > const &x){
  return norm_1(x);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericMatrixCommon_casadi_norm_inf__SWIG_2(casadi::Matrix< casadi::SXElem > const &x){
  return norm_inf(x);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericMatrixCommon_casadi_dot__SWIG_2(casadi::Matrix< casadi::SXElem > const &x,casadi::Matrix< casadi::SXElem > const &y){
  return dot(x, y);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericMatrixCommon_casadi_nullspace__SWIG_2(casadi::Matrix< casadi::SXElem > const &A){
  return nullspace(A);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericMatrixCommon_casadi_polyval__SWIG_2(casadi::Matrix< casadi::SXElem > const &p,casadi::Matrix< casadi::SXElem > const &x){
  return polyval(p, x);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericMatrixCommon_casadi_diag__SWIG_2(casadi::Matrix< casadi::SXElem > const &A){
  return diag(A);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericMatrixCommon_casadi_unite__SWIG_2(casadi::Matrix< casadi::SXElem > const &A,casadi::Matrix< casadi::SXElem > const &B){
  return unite(A, B);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericMatrixCommon_casadi_densify__SWIG_2(casadi::Matrix< casadi::SXElem > const &x){
  return densify(x);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericMatrixCommon_casadi_project__SWIG_2(casadi::Matrix< casadi::SXElem > const &A,casadi::Sparsity const &sp,bool intersect=false){
  return project(A, sp, intersect);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericMatrixCommon_casadi_if_else__SWIG_2(casadi::Matrix< casadi::SXElem > const &cond,casadi::Matrix< casadi::SXElem > const &if_true,casadi::Matrix< casadi::SXElem > const &if_false,bool short_circuit=false){
  return if_else(cond, if_true, if_false, short_circuit);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericMatrixCommon_casadi_conditional__SWIG_2(casadi::Matrix< casadi::SXElem > const &ind,std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > const &x,casadi::Matrix< casadi::SXElem > const &x_default,bool short_circuit=false){
  return conditional(ind, x, x_default, short_circuit);
}
SWIGINTERN bool casadi_GenericMatrixCommon_casadi_depends_on__SWIG_2(casadi::Matrix< casadi::SXElem > const &f,casadi::Matrix< casadi::SXElem > const &arg){
  return depends_on(f, arg);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericMatrixCommon_casadi_solve__SWIG_4(casadi::Matrix< casadi::SXElem > const &A,casadi::Matrix< casadi::SXElem > const &b){
  return solve(A, b);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericMatrixCommon_casadi_solve__SWIG_5(casadi::Matrix< casadi::SXElem > const &A,casadi::Matrix< casadi::SXElem > const &b,std::string const &lsolver,casadi::Dict const &opts=casadi::Dict()){
  return solve(A, b, lsolver, opts);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericMatrixCommon_casadi_pinv__SWIG_4(casadi::Matrix< casadi::SXElem > const &A){
  return pinv(A);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericMatrixCommon_casadi_pinv__SWIG_5(casadi::Matrix< casadi::SXElem > const &A,std::string const &lsolver,casadi::Dict const &opts=casadi::Dict()){
  return pinv(A, lsolver, opts);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericMatrixCommon_casadi_expm_const__SWIG_2(casadi::Matrix< casadi::SXElem > const &A,casadi::Matrix< casadi::SXElem > const &t){
  return expm_const(A, t);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericMatrixCommon_casadi_expm__SWIG_2(casadi::Matrix< casadi::SXElem > const &A){
  return expm(A);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericMatrixCommon_casadi_jacobian__SWIG_2(casadi::Matrix< casadi::SXElem > const &ex,casadi::Matrix< casadi::SXElem > const &arg,casadi::Dict const &opts=casadi::Dict()){
  return jacobian(ex, arg, opts);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericMatrixCommon_casadi_jtimes__SWIG_2(casadi::Matrix< casadi::SXElem > const &ex,casadi::Matrix< casadi::SXElem > const &arg,casadi::Matrix< casadi::SXElem > const &v,bool tr=false){
  return jtimes(ex, arg, v, tr);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericMatrixCommon_casadi_linearize__SWIG_2(casadi::Matrix< casadi::SXElem > const &f,casadi::Matrix< casadi::SXElem > const &x,casadi::Matrix< casadi::SXElem > const &x0){
  return linearize(f, x, x0);
}
SWIGINTERN std::vector< bool,std::allocator< bool > > casadi_GenericMatrixCommon_casadi_which_depends__SWIG_2(casadi::Matrix< casadi::SXElem > const &expr,casadi::Matrix< casadi::SXElem > const &var,casadi_int order=1,bool tr=false){
  return which_depends(expr, var, order, tr);
}
SWIGINTERN casadi::Sparsity casadi_GenericMatrixCommon_casadi_jacobian_sparsity__SWIG_2(casadi::Matrix< casadi::SXElem > const &f,casadi::Matrix< casadi::SXElem > const &x){
  return jacobian_sparsity(f, x);
}
SWIGINTERN bool casadi_GenericMatrixCommon_casadi_is_linear__SWIG_2(casadi::Matrix< casadi::SXElem > const &expr,casadi::Matrix< casadi::SXElem > const &var){
  return is_linear(expr, var);
}
SWIGINTERN bool casadi_GenericMatrixCommon_casadi_is_quadratic__SWIG_2(casadi::Matrix< casadi::SXElem > const &expr,casadi::Matrix< casadi::SXElem > const &var){
  return is_quadratic(expr, var);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericMatrixCommon_casadi_gradient__SWIG_2(casadi::Matrix< casadi::SXElem > const &ex,casadi::Matrix< casadi::SXElem > const &arg){
  return gradient(ex, arg);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericMatrixCommon_casadi_tangent__SWIG_2(casadi::Matrix< casadi::SXElem > const &ex,casadi::Matrix< casadi::SXElem > const &arg){
  return tangent(ex, arg);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericMatrixCommon_casadi_hessian__SWIG_2(casadi::Matrix< casadi::SXElem > const &ex,casadi::Matrix< casadi::SXElem > const &arg,casadi::Matrix< casadi::SXElem > &OUTPUT1,casadi::Dict const &opts=casadi::Dict()){
  return hessian(ex, arg, OUTPUT1, opts);
}
SWIGINTERN void casadi_GenericMatrixCommon_casadi_quadratic_coeff__SWIG_2(casadi::Matrix< casadi::SXElem > const &ex,casadi::Matrix< casadi::SXElem > const &arg,casadi::Matrix< casadi::SXElem > &OUTPUT1,casadi::Matrix< casadi::SXElem > &OUTPUT2,casadi::Matrix< casadi::SXElem > &OUTPUT3,bool check=true){
  quadratic_coeff(ex, arg, OUTPUT1, OUTPUT2, OUTPUT3, check);
}
SWIGINTERN void casadi_GenericMatrixCommon_casadi_linear_coeff__SWIG_2(casadi::Matrix< casadi::SXElem > const &ex,casadi::Matrix< casadi::SXElem > const &arg,casadi::Matrix< casadi::SXElem > &OUTPUT1,casadi::Matrix< casadi::SXElem > &OUTPUT2,bool check=true){
  linear_coeff(ex, arg, OUTPUT1, OUTPUT2, check);
}
SWIGINTERN casadi_int casadi_GenericMatrixCommon_casadi_n_nodes__SWIG_2(casadi::Matrix< casadi::SXElem > const &A){
  return n_nodes(A);
}
SWIGINTERN std::string casadi_GenericMatrixCommon_casadi_print_operator__SWIG_2(casadi::Matrix< casadi::SXElem > const &xb,std::vector< std::string,std::allocator< std::string > > const &args){
  return print_operator(xb, args);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericMatrixCommon_casadi_repsum__SWIG_2(casadi::Matrix< casadi::SXElem > const &A,casadi_int n,casadi_int m=1){
  return repsum(A, n, m);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericMatrixCommon_casadi_diff__SWIG_2(casadi::Matrix< casadi::SXElem > const &A,casadi_int n=1,casadi_index axis=-1){
  return diff(A, n, axis);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericMatrixCommon_casadi_cumsum__SWIG_2(casadi::Matrix< casadi::SXElem > const &A,casadi_index axis=-1){
  return cumsum(A, axis);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericMatrixCommon_casadi_einstein__SWIG_4(casadi::Matrix< casadi::SXElem > const &A,casadi::Matrix< casadi::SXElem > const &B,casadi::Matrix< casadi::SXElem > const &C,std::vector< casadi_int,std::allocator< casadi_int > > const &dim_a,std::vector< casadi_int,std::allocator< casadi_int > > const &dim_b,std::vector< casadi_int,std::allocator< casadi_int > > const &dim_c,std::vector< casadi_int,std::allocator< casadi_int > > const &a,std::vector< casadi_int,std::allocator< casadi_int > > const &b,std::vector< casadi_int,std::allocator< casadi_int > > const &c){
  return einstein(A, B, C, dim_a, dim_b, dim_c, a, b, c);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericMatrixCommon_casadi_einstein__SWIG_5(casadi::Matrix< casadi::SXElem > const &A,casadi::Matrix< casadi::SXElem > const &B,std::vector< casadi_int,std::allocator< casadi_int > > const &dim_a,std::vector< casadi_int,std::allocator< casadi_int > > const &dim_b,std::vector< casadi_int,std::allocator< casadi_int > > const &dim_c,std::vector< casadi_int,std::allocator< casadi_int > > const &a,std::vector< casadi_int,std::allocator< casadi_int > > const &b,std::vector< casadi_int,std::allocator< casadi_int > > const &c){
  return einstein(A, B, dim_a, dim_b, dim_c, a, b, c);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericMatrixCommon_casadi_mmin__SWIG_2(casadi::Matrix< casadi::SXElem > const &x){ return mmin(x); }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericMatrixCommon_casadi_mmax__SWIG_2(casadi::Matrix< casadi::SXElem > const &x){ return mmax(x); }
SWIGINTERN casadi::DM casadi_GenericMatrixCommon_casadi_evalf__SWIG_2(casadi::Matrix< casadi::SXElem > const &x){
  return evalf(x);
}
SWIGINTERN std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > casadi_GenericMatrixCommon_casadi_cse__SWIG_4(std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > const &e){
  return cse(e);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericMatrixCommon_casadi_cse__SWIG_5(casadi::Matrix< casadi::SXElem > const &e){
  return cse(e);
}
SWIGINTERN casadi::MX casadi_GenericExpressionCommon_casadi_plus__SWIG_0(casadi::MX const &x,casadi::MX const &y){ return x+y; }
SWIGINTERN casadi::MX casadi_GenericExpressionCommon_casadi_minus__SWIG_0(casadi::MX const &x,casadi::MX const &y){ return x-y; }
SWIGINTERN casadi::MX casadi_GenericExpressionCommon_casadi_times__SWIG_0(casadi::MX const &x,casadi::MX const &y){ return x*y; }
SWIGINTERN casadi::MX casadi_GenericExpressionCommon_casadi_rdivide__SWIG_0(casadi::MX const &x,casadi::MX const &y){ return x/y; }
SWIGINTERN casadi::MX casadi_GenericExpressionCommon_casadi_ldivide__SWIG_0(casadi::MX const &x,casadi::MX const &y){ return y/x; }
SWIGINTERN casadi::MX casadi_GenericExpressionCommon_casadi_lt__SWIG_0(casadi::MX const &x,casadi::MX const &y){ return x<y; }
SWIGINTERN casadi::MX casadi_GenericExpressionCommon_casadi_le__SWIG_0(casadi::MX const &x,casadi::MX const &y){ return x<=y; }
SWIGINTERN casadi::MX casadi_GenericExpressionCommon_casadi_gt__SWIG_0(casadi::MX const &x,casadi::MX const &y){ return x>y; }
SWIGINTERN casadi::MX casadi_GenericExpressionCommon_casadi_ge__SWIG_0(casadi::MX const &x,casadi::MX const &y){ return x>=y; }
SWIGINTERN casadi::MX casadi_GenericExpressionCommon_casadi_eq__SWIG_0(casadi::MX const &x,casadi::MX const &y){ return x==y; }
SWIGINTERN casadi::MX casadi_GenericExpressionCommon_casadi_ne__SWIG_0(casadi::MX const &x,casadi::MX const &y){ return x!=y; }
SWIGINTERN casadi::MX casadi_GenericExpressionCommon_casadi_and__SWIG_0(casadi::MX const &x,casadi::MX const &y){ return x&&y; }
SWIGINTERN casadi::MX casadi_GenericExpressionCommon_casadi_or__SWIG_0(casadi::MX const &x,casadi::MX const &y){ return x||y; }
SWIGINTERN casadi::MX casadi_GenericExpressionCommon_casadi_not__SWIG_0(casadi::MX const &x){ return !x; }
SWIGINTERN casadi::MX casadi_GenericExpressionCommon_casadi_abs__SWIG_0(casadi::MX const &x){ return fabs(x); }
SWIGINTERN casadi::MX casadi_GenericExpressionCommon_casadi_sqrt__SWIG_0(casadi::MX const &x){ return sqrt(x); }
SWIGINTERN casadi::MX casadi_GenericExpressionCommon_casadi_sin__SWIG_0(casadi::MX const &x){ return sin(x); }
SWIGINTERN casadi::MX casadi_GenericExpressionCommon_casadi_cos__SWIG_0(casadi::MX const &x){ return cos(x); }
SWIGINTERN casadi::MX casadi_GenericExpressionCommon_casadi_tan__SWIG_0(casadi::MX const &x){ return tan(x); }
SWIGINTERN casadi::MX casadi_GenericExpressionCommon_casadi_atan__SWIG_0(casadi::MX const &x){ return atan(x); }
SWIGINTERN casadi::MX casadi_GenericExpressionCommon_casadi_asin__SWIG_0(casadi::MX const &x){ return asin(x); }
SWIGINTERN casadi::MX casadi_GenericExpressionCommon_casadi_acos__SWIG_0(casadi::MX const &x){ return acos(x); }
SWIGINTERN casadi::MX casadi_GenericExpressionCommon_casadi_tanh__SWIG_0(casadi::MX const &x){ return tanh(x); }
SWIGINTERN casadi::MX casadi_GenericExpressionCommon_casadi_sinh__SWIG_0(casadi::MX const &x){ return sinh(x); }
SWIGINTERN casadi::MX casadi_GenericExpressionCommon_casadi_cosh__SWIG_0(casadi::MX const &x){ return cosh(x); }
SWIGINTERN casadi::MX casadi_GenericExpressionCommon_casadi_atanh__SWIG_0(casadi::MX const &x){ return atanh(x); }
SWIGINTERN casadi::MX casadi_GenericExpressionCommon_casadi_asinh__SWIG_0(casadi::MX const &x){ return asinh(x); }
SWIGINTERN casadi::MX casadi_GenericExpressionCommon_casadi_acosh__SWIG_0(casadi::MX const &x){ return acosh(x); }
SWIGINTERN casadi::MX casadi_GenericExpressionCommon_casadi_exp__SWIG_0(casadi::MX const &x){ return exp(x); }
SWIGINTERN casadi::MX casadi_GenericExpressionCommon_casadi_log__SWIG_0(casadi::MX const &x){ return log(x); }
SWIGINTERN casadi::MX casadi_GenericExpressionCommon_casadi_log10__SWIG_0(casadi::MX const &x){ return log10(x); }
SWIGINTERN casadi::MX casadi_GenericExpressionCommon_casadi_log1p__SWIG_0(casadi::MX const &x){ return log1p(x); }
SWIGINTERN casadi::MX casadi_GenericExpressionCommon_casadi_expm1__SWIG_0(casadi::MX const &x){ return expm1(x); }
SWIGINTERN casadi::MX casadi_GenericExpressionCommon_casadi_floor__SWIG_0(casadi::MX const &x){ return floor(x); }
SWIGINTERN casadi::MX casadi_GenericExpressionCommon_casadi_ceil__SWIG_0(casadi::MX const &x){ return ceil(x); }
SWIGINTERN casadi::MX casadi_GenericExpressionCommon_casadi_erf__SWIG_0(casadi::MX const &x){ return erf(x); }
SWIGINTERN casadi::MX casadi_GenericExpressionCommon_casadi_erfinv__SWIG_0(casadi::MX const &x){ using casadi::erfinv; return erfinv(x); }
SWIGINTERN casadi::MX casadi_GenericExpressionCommon_casadi_sign__SWIG_0(casadi::MX const &x){ using casadi::sign; return sign(x); }
SWIGINTERN casadi::MX casadi_GenericExpressionCommon_casadi_power__SWIG_0(casadi::MX const &x,casadi::MX const &n){ return pow(x, n); }
SWIGINTERN casadi::MX casadi_GenericExpressionCommon_casadi_mod__SWIG_0(casadi::MX const &x,casadi::MX const &y){ return fmod(x, y); }
SWIGINTERN casadi::MX casadi_GenericExpressionCommon_casadi_fmod__SWIG_0(casadi::MX const &x,casadi::MX const &y){ return fmod(x, y); }
SWIGINTERN casadi::MX casadi_GenericExpressionCommon_casadi_remainder__SWIG_0(casadi::MX const &x,casadi::MX const &y){ return remainder(x, y); }
SWIGINTERN casadi::MX casadi_GenericExpressionCommon_casadi_atan2__SWIG_0(casadi::MX const &x,casadi::MX const &y){ return atan2(x, y); }
SWIGINTERN casadi::MX casadi_GenericExpressionCommon_casadi_fmin__SWIG_0(casadi::MX const &x,casadi::MX const &y){ return fmin(x, y); }
SWIGINTERN casadi::MX casadi_GenericExpressionCommon_casadi_fmax__SWIG_0(casadi::MX const &x,casadi::MX const &y){ return fmax(x, y); }
SWIGINTERN casadi::MX casadi_GenericExpressionCommon_casadi_hypot__SWIG_0(casadi::MX const &x,casadi::MX const &y){ return hypot(x, y); }
SWIGINTERN casadi::MX casadi_GenericExpressionCommon_casadi_simplify__SWIG_0(casadi::MX const &x){ using casadi::simplify; return simplify(x); }
SWIGINTERN bool casadi_GenericExpressionCommon_casadi_is_equal__SWIG_0(casadi::MX const &x,casadi::MX const &y,casadi_int depth=0){ using casadi::is_equal; return is_equal(x, y, depth); }
SWIGINTERN casadi::MX casadi_GenericExpressionCommon_casadi_copysign__SWIG_0(casadi::MX const &x,casadi::MX const &y){ return copysign(x, y); }
SWIGINTERN casadi::MX casadi_GenericExpressionCommon_casadi_constpow__SWIG_0(casadi::MX const &x,casadi::MX const &y){ using casadi::constpow; return constpow(x, y); }
SWIGINTERN casadi::Matrix< double > casadi_GenericExpressionCommon_casadi_plus__SWIG_1(casadi::Matrix< double > const &x,casadi::Matrix< double > const &y){ return x+y; }
SWIGINTERN casadi::Matrix< double > casadi_GenericExpressionCommon_casadi_minus__SWIG_1(casadi::Matrix< double > const &x,casadi::Matrix< double > const &y){ return x-y; }
SWIGINTERN casadi::Matrix< double > casadi_GenericExpressionCommon_casadi_times__SWIG_1(casadi::Matrix< double > const &x,casadi::Matrix< double > const &y){ return x*y; }
SWIGINTERN casadi::Matrix< double > casadi_GenericExpressionCommon_casadi_rdivide__SWIG_1(casadi::Matrix< double > const &x,casadi::Matrix< double > const &y){ return x/y; }
SWIGINTERN casadi::Matrix< double > casadi_GenericExpressionCommon_casadi_ldivide__SWIG_1(casadi::Matrix< double > const &x,casadi::Matrix< double > const &y){ return y/x; }
SWIGINTERN casadi::Matrix< double > casadi_GenericExpressionCommon_casadi_lt__SWIG_1(casadi::Matrix< double > const &x,casadi::Matrix< double > const &y){ return x<y; }
SWIGINTERN casadi::Matrix< double > casadi_GenericExpressionCommon_casadi_le__SWIG_1(casadi::Matrix< double > const &x,casadi::Matrix< double > const &y){ return x<=y; }
SWIGINTERN casadi::Matrix< double > casadi_GenericExpressionCommon_casadi_gt__SWIG_1(casadi::Matrix< double > const &x,casadi::Matrix< double > const &y){ return x>y; }
SWIGINTERN casadi::Matrix< double > casadi_GenericExpressionCommon_casadi_ge__SWIG_1(casadi::Matrix< double > const &x,casadi::Matrix< double > const &y){ return x>=y; }
SWIGINTERN casadi::Matrix< double > casadi_GenericExpressionCommon_casadi_eq__SWIG_1(casadi::Matrix< double > const &x,casadi::Matrix< double > const &y){ return x==y; }
SWIGINTERN casadi::Matrix< double > casadi_GenericExpressionCommon_casadi_ne__SWIG_1(casadi::Matrix< double > const &x,casadi::Matrix< double > const &y){ return x!=y; }
SWIGINTERN casadi::Matrix< double > casadi_GenericExpressionCommon_casadi_and__SWIG_1(casadi::Matrix< double > const &x,casadi::Matrix< double > const &y){ return x&&y; }
SWIGINTERN casadi::Matrix< double > casadi_GenericExpressionCommon_casadi_or__SWIG_1(casadi::Matrix< double > const &x,casadi::Matrix< double > const &y){ return x||y; }
SWIGINTERN casadi::Matrix< double > casadi_GenericExpressionCommon_casadi_not__SWIG_1(casadi::Matrix< double > const &x){ return !x; }
SWIGINTERN casadi::Matrix< double > casadi_GenericExpressionCommon_casadi_abs__SWIG_1(casadi::Matrix< double > const &x){ return fabs(x); }
SWIGINTERN casadi::Matrix< double > casadi_GenericExpressionCommon_casadi_sqrt__SWIG_1(casadi::Matrix< double > const &x){ return sqrt(x); }
SWIGINTERN casadi::Matrix< double > casadi_GenericExpressionCommon_casadi_sin__SWIG_1(casadi::Matrix< double > const &x){ return sin(x); }
SWIGINTERN casadi::Matrix< double > casadi_GenericExpressionCommon_casadi_cos__SWIG_1(casadi::Matrix< double > const &x){ return cos(x); }
SWIGINTERN casadi::Matrix< double > casadi_GenericExpressionCommon_casadi_tan__SWIG_1(casadi::Matrix< double > const &x){ return tan(x); }
SWIGINTERN casadi::Matrix< double > casadi_GenericExpressionCommon_casadi_atan__SWIG_1(casadi::Matrix< double > const &x){ return atan(x); }
SWIGINTERN casadi::Matrix< double > casadi_GenericExpressionCommon_casadi_asin__SWIG_1(casadi::Matrix< double > const &x){ return asin(x); }
SWIGINTERN casadi::Matrix< double > casadi_GenericExpressionCommon_casadi_acos__SWIG_1(casadi::Matrix< double > const &x){ return acos(x); }
SWIGINTERN casadi::Matrix< double > casadi_GenericExpressionCommon_casadi_tanh__SWIG_1(casadi::Matrix< double > const &x){ return tanh(x); }
SWIGINTERN casadi::Matrix< double > casadi_GenericExpressionCommon_casadi_sinh__SWIG_1(casadi::Matrix< double > const &x){ return sinh(x); }
SWIGINTERN casadi::Matrix< double > casadi_GenericExpressionCommon_casadi_cosh__SWIG_1(casadi::Matrix< double > const &x){ return cosh(x); }
SWIGINTERN casadi::Matrix< double > casadi_GenericExpressionCommon_casadi_atanh__SWIG_1(casadi::Matrix< double > const &x){ return atanh(x); }
SWIGINTERN casadi::Matrix< double > casadi_GenericExpressionCommon_casadi_asinh__SWIG_1(casadi::Matrix< double > const &x){ return asinh(x); }
SWIGINTERN casadi::Matrix< double > casadi_GenericExpressionCommon_casadi_acosh__SWIG_1(casadi::Matrix< double > const &x){ return acosh(x); }
SWIGINTERN casadi::Matrix< double > casadi_GenericExpressionCommon_casadi_exp__SWIG_1(casadi::Matrix< double > const &x){ return exp(x); }
SWIGINTERN casadi::Matrix< double > casadi_GenericExpressionCommon_casadi_log__SWIG_1(casadi::Matrix< double > const &x){ return log(x); }
SWIGINTERN casadi::Matrix< double > casadi_GenericExpressionCommon_casadi_log10__SWIG_1(casadi::Matrix< double > const &x){ return log10(x); }
SWIGINTERN casadi::Matrix< double > casadi_GenericExpressionCommon_casadi_log1p__SWIG_1(casadi::Matrix< double > const &x){ return log1p(x); }
SWIGINTERN casadi::Matrix< double > casadi_GenericExpressionCommon_casadi_expm1__SWIG_1(casadi::Matrix< double > const &x){ return expm1(x); }
SWIGINTERN casadi::Matrix< double > casadi_GenericExpressionCommon_casadi_floor__SWIG_1(casadi::Matrix< double > const &x){ return floor(x); }
SWIGINTERN casadi::Matrix< double > casadi_GenericExpressionCommon_casadi_ceil__SWIG_1(casadi::Matrix< double > const &x){ return ceil(x); }
SWIGINTERN casadi::Matrix< double > casadi_GenericExpressionCommon_casadi_erf__SWIG_1(casadi::Matrix< double > const &x){ return erf(x); }
SWIGINTERN casadi::Matrix< double > casadi_GenericExpressionCommon_casadi_erfinv__SWIG_1(casadi::Matrix< double > const &x){ using casadi::erfinv; return erfinv(x); }
SWIGINTERN casadi::Matrix< double > casadi_GenericExpressionCommon_casadi_sign__SWIG_1(casadi::Matrix< double > const &x){ using casadi::sign; return sign(x); }
SWIGINTERN casadi::Matrix< double > casadi_GenericExpressionCommon_casadi_power__SWIG_1(casadi::Matrix< double > const &x,casadi::Matrix< double > const &n){ return pow(x, n); }
SWIGINTERN casadi::Matrix< double > casadi_GenericExpressionCommon_casadi_mod__SWIG_1(casadi::Matrix< double > const &x,casadi::Matrix< double > const &y){ return fmod(x, y); }
SWIGINTERN casadi::Matrix< double > casadi_GenericExpressionCommon_casadi_fmod__SWIG_1(casadi::Matrix< double > const &x,casadi::Matrix< double > const &y){ return fmod(x, y); }
SWIGINTERN casadi::Matrix< double > casadi_GenericExpressionCommon_casadi_remainder__SWIG_1(casadi::Matrix< double > const &x,casadi::Matrix< double > const &y){ return remainder(x, y); }
SWIGINTERN casadi::Matrix< double > casadi_GenericExpressionCommon_casadi_atan2__SWIG_1(casadi::Matrix< double > const &x,casadi::Matrix< double > const &y){ return atan2(x, y); }
SWIGINTERN casadi::Matrix< double > casadi_GenericExpressionCommon_casadi_fmin__SWIG_1(casadi::Matrix< double > const &x,casadi::Matrix< double > const &y){ return fmin(x, y); }
SWIGINTERN casadi::Matrix< double > casadi_GenericExpressionCommon_casadi_fmax__SWIG_1(casadi::Matrix< double > const &x,casadi::Matrix< double > const &y){ return fmax(x, y); }
SWIGINTERN casadi::Matrix< double > casadi_GenericExpressionCommon_casadi_hypot__SWIG_1(casadi::Matrix< double > const &x,casadi::Matrix< double > const &y){ return hypot(x, y); }
SWIGINTERN casadi::Matrix< double > casadi_GenericExpressionCommon_casadi_simplify__SWIG_1(casadi::Matrix< double > const &x){ using casadi::simplify; return simplify(x); }
SWIGINTERN bool casadi_GenericExpressionCommon_casadi_is_equal__SWIG_1(casadi::Matrix< double > const &x,casadi::Matrix< double > const &y,casadi_int depth=0){ using casadi::is_equal; return is_equal(x, y, depth); }
SWIGINTERN casadi::Matrix< double > casadi_GenericExpressionCommon_casadi_copysign__SWIG_1(casadi::Matrix< double > const &x,casadi::Matrix< double > const &y){ return copysign(x, y); }
SWIGINTERN casadi::Matrix< double > casadi_GenericExpressionCommon_casadi_constpow__SWIG_1(casadi::Matrix< double > const &x,casadi::Matrix< double > const &y){ using casadi::constpow; return constpow(x, y); }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericExpressionCommon_casadi_plus__SWIG_2(casadi::Matrix< casadi::SXElem > const &x,casadi::Matrix< casadi::SXElem > const &y){ return x+y; }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericExpressionCommon_casadi_minus__SWIG_2(casadi::Matrix< casadi::SXElem > const &x,casadi::Matrix< casadi::SXElem > const &y){ return x-y; }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericExpressionCommon_casadi_times__SWIG_2(casadi::Matrix< casadi::SXElem > const &x,casadi::Matrix< casadi::SXElem > const &y){ return x*y; }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericExpressionCommon_casadi_rdivide__SWIG_2(casadi::Matrix< casadi::SXElem > const &x,casadi::Matrix< casadi::SXElem > const &y){ return x/y; }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericExpressionCommon_casadi_ldivide__SWIG_2(casadi::Matrix< casadi::SXElem > const &x,casadi::Matrix< casadi::SXElem > const &y){ return y/x; }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericExpressionCommon_casadi_lt__SWIG_2(casadi::Matrix< casadi::SXElem > const &x,casadi::Matrix< casadi::SXElem > const &y){ return x<y; }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericExpressionCommon_casadi_le__SWIG_2(casadi::Matrix< casadi::SXElem > const &x,casadi::Matrix< casadi::SXElem > const &y){ return x<=y; }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericExpressionCommon_casadi_gt__SWIG_2(casadi::Matrix< casadi::SXElem > const &x,casadi::Matrix< casadi::SXElem > const &y){ return x>y; }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericExpressionCommon_casadi_ge__SWIG_2(casadi::Matrix< casadi::SXElem > const &x,casadi::Matrix< casadi::SXElem > const &y){ return x>=y; }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericExpressionCommon_casadi_eq__SWIG_2(casadi::Matrix< casadi::SXElem > const &x,casadi::Matrix< casadi::SXElem > const &y){ return x==y; }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericExpressionCommon_casadi_ne__SWIG_2(casadi::Matrix< casadi::SXElem > const &x,casadi::Matrix< casadi::SXElem > const &y){ return x!=y; }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericExpressionCommon_casadi_and__SWIG_2(casadi::Matrix< casadi::SXElem > const &x,casadi::Matrix< casadi::SXElem > const &y){ return x&&y; }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericExpressionCommon_casadi_or__SWIG_2(casadi::Matrix< casadi::SXElem > const &x,casadi::Matrix< casadi::SXElem > const &y){ return x||y; }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericExpressionCommon_casadi_not__SWIG_2(casadi::Matrix< casadi::SXElem > const &x){ return !x; }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericExpressionCommon_casadi_abs__SWIG_2(casadi::Matrix< casadi::SXElem > const &x){ return fabs(x); }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericExpressionCommon_casadi_sqrt__SWIG_2(casadi::Matrix< casadi::SXElem > const &x){ return sqrt(x); }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericExpressionCommon_casadi_sin__SWIG_2(casadi::Matrix< casadi::SXElem > const &x){ return sin(x); }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericExpressionCommon_casadi_cos__SWIG_2(casadi::Matrix< casadi::SXElem > const &x){ return cos(x); }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericExpressionCommon_casadi_tan__SWIG_2(casadi::Matrix< casadi::SXElem > const &x){ return tan(x); }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericExpressionCommon_casadi_atan__SWIG_2(casadi::Matrix< casadi::SXElem > const &x){ return atan(x); }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericExpressionCommon_casadi_asin__SWIG_2(casadi::Matrix< casadi::SXElem > const &x){ return asin(x); }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericExpressionCommon_casadi_acos__SWIG_2(casadi::Matrix< casadi::SXElem > const &x){ return acos(x); }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericExpressionCommon_casadi_tanh__SWIG_2(casadi::Matrix< casadi::SXElem > const &x){ return tanh(x); }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericExpressionCommon_casadi_sinh__SWIG_2(casadi::Matrix< casadi::SXElem > const &x){ return sinh(x); }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericExpressionCommon_casadi_cosh__SWIG_2(casadi::Matrix< casadi::SXElem > const &x){ return cosh(x); }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericExpressionCommon_casadi_atanh__SWIG_2(casadi::Matrix< casadi::SXElem > const &x){ return atanh(x); }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericExpressionCommon_casadi_asinh__SWIG_2(casadi::Matrix< casadi::SXElem > const &x){ return asinh(x); }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericExpressionCommon_casadi_acosh__SWIG_2(casadi::Matrix< casadi::SXElem > const &x){ return acosh(x); }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericExpressionCommon_casadi_exp__SWIG_2(casadi::Matrix< casadi::SXElem > const &x){ return exp(x); }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericExpressionCommon_casadi_log__SWIG_2(casadi::Matrix< casadi::SXElem > const &x){ return log(x); }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericExpressionCommon_casadi_log10__SWIG_2(casadi::Matrix< casadi::SXElem > const &x){ return log10(x); }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericExpressionCommon_casadi_log1p__SWIG_2(casadi::Matrix< casadi::SXElem > const &x){ return log1p(x); }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericExpressionCommon_casadi_expm1__SWIG_2(casadi::Matrix< casadi::SXElem > const &x){ return expm1(x); }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericExpressionCommon_casadi_floor__SWIG_2(casadi::Matrix< casadi::SXElem > const &x){ return floor(x); }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericExpressionCommon_casadi_ceil__SWIG_2(casadi::Matrix< casadi::SXElem > const &x){ return ceil(x); }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericExpressionCommon_casadi_erf__SWIG_2(casadi::Matrix< casadi::SXElem > const &x){ return erf(x); }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericExpressionCommon_casadi_erfinv__SWIG_2(casadi::Matrix< casadi::SXElem > const &x){ using casadi::erfinv; return erfinv(x); }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericExpressionCommon_casadi_sign__SWIG_2(casadi::Matrix< casadi::SXElem > const &x){ using casadi::sign; return sign(x); }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericExpressionCommon_casadi_power__SWIG_2(casadi::Matrix< casadi::SXElem > const &x,casadi::Matrix< casadi::SXElem > const &n){ return pow(x, n); }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericExpressionCommon_casadi_mod__SWIG_2(casadi::Matrix< casadi::SXElem > const &x,casadi::Matrix< casadi::SXElem > const &y){ return fmod(x, y); }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericExpressionCommon_casadi_fmod__SWIG_2(casadi::Matrix< casadi::SXElem > const &x,casadi::Matrix< casadi::SXElem > const &y){ return fmod(x, y); }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericExpressionCommon_casadi_remainder__SWIG_2(casadi::Matrix< casadi::SXElem > const &x,casadi::Matrix< casadi::SXElem > const &y){ return remainder(x, y); }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericExpressionCommon_casadi_atan2__SWIG_2(casadi::Matrix< casadi::SXElem > const &x,casadi::Matrix< casadi::SXElem > const &y){ return atan2(x, y); }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericExpressionCommon_casadi_fmin__SWIG_2(casadi::Matrix< casadi::SXElem > const &x,casadi::Matrix< casadi::SXElem > const &y){ return fmin(x, y); }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericExpressionCommon_casadi_fmax__SWIG_2(casadi::Matrix< casadi::SXElem > const &x,casadi::Matrix< casadi::SXElem > const &y){ return fmax(x, y); }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericExpressionCommon_casadi_hypot__SWIG_2(casadi::Matrix< casadi::SXElem > const &x,casadi::Matrix< casadi::SXElem > const &y){ return hypot(x, y); }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericExpressionCommon_casadi_simplify__SWIG_2(casadi::Matrix< casadi::SXElem > const &x){ using casadi::simplify; return simplify(x); }
SWIGINTERN bool casadi_GenericExpressionCommon_casadi_is_equal__SWIG_2(casadi::Matrix< casadi::SXElem > const &x,casadi::Matrix< casadi::SXElem > const &y,casadi_int depth=0){ using casadi::is_equal; return is_equal(x, y, depth); }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericExpressionCommon_casadi_copysign__SWIG_2(casadi::Matrix< casadi::SXElem > const &x,casadi::Matrix< casadi::SXElem > const &y){ return copysign(x, y); }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_GenericExpressionCommon_casadi_constpow__SWIG_2(casadi::Matrix< casadi::SXElem > const &x,casadi::Matrix< casadi::SXElem > const &y){ using casadi::constpow; return constpow(x, y); }
SWIGINTERN double casadi_GenericExpressionCommon_casadi_plus__SWIG_3(double const &x,double const &y){ return x+y; }
SWIGINTERN double casadi_GenericExpressionCommon_casadi_minus__SWIG_3(double const &x,double const &y){ return x-y; }
SWIGINTERN double casadi_GenericExpressionCommon_casadi_times__SWIG_3(double const &x,double const &y){ return x*y; }
SWIGINTERN double casadi_GenericExpressionCommon_casadi_rdivide__SWIG_3(double const &x,double const &y){ return x/y; }
SWIGINTERN double casadi_GenericExpressionCommon_casadi_ldivide__SWIG_3(double const &x,double const &y){ return y/x; }
SWIGINTERN double casadi_GenericExpressionCommon_casadi_lt__SWIG_3(double const &x,double const &y){ return x<y; }
SWIGINTERN double casadi_GenericExpressionCommon_casadi_le__SWIG_3(double const &x,double const &y){ return x<=y; }
SWIGINTERN double casadi_GenericExpressionCommon_casadi_gt__SWIG_3(double const &x,double const &y){ return x>y; }
SWIGINTERN double casadi_GenericExpressionCommon_casadi_ge__SWIG_3(double const &x,double const &y){ return x>=y; }
SWIGINTERN double casadi_GenericExpressionCommon_casadi_eq__SWIG_3(double const &x,double const &y){ return x==y; }
SWIGINTERN double casadi_GenericExpressionCommon_casadi_ne__SWIG_3(double const &x,double const &y){ return x!=y; }
SWIGINTERN double casadi_GenericExpressionCommon_casadi_and__SWIG_3(double const &x,double const &y){ return x&&y; }
SWIGINTERN double casadi_GenericExpressionCommon_casadi_or__SWIG_3(double const &x,double const &y){ return x||y; }
SWIGINTERN double casadi_GenericExpressionCommon_casadi_not__SWIG_3(double const &x){ return !x; }
SWIGINTERN double casadi_GenericExpressionCommon_casadi_abs__SWIG_3(double const &x){ return fabs(x); }
SWIGINTERN double casadi_GenericExpressionCommon_casadi_sqrt__SWIG_3(double const &x){ return sqrt(x); }
SWIGINTERN double casadi_GenericExpressionCommon_casadi_sin__SWIG_3(double const &x){ return sin(x); }
SWIGINTERN double casadi_GenericExpressionCommon_casadi_cos__SWIG_3(double const &x){ return cos(x); }
SWIGINTERN double casadi_GenericExpressionCommon_casadi_tan__SWIG_3(double const &x){ return tan(x); }
SWIGINTERN double casadi_GenericExpressionCommon_casadi_atan__SWIG_3(double const &x){ return atan(x); }
SWIGINTERN double casadi_GenericExpressionCommon_casadi_asin__SWIG_3(double const &x){ return asin(x); }
SWIGINTERN double casadi_GenericExpressionCommon_casadi_acos__SWIG_3(double const &x){ return acos(x); }
SWIGINTERN double casadi_GenericExpressionCommon_casadi_tanh__SWIG_3(double const &x){ return tanh(x); }
SWIGINTERN double casadi_GenericExpressionCommon_casadi_sinh__SWIG_3(double const &x){ return sinh(x); }
SWIGINTERN double casadi_GenericExpressionCommon_casadi_cosh__SWIG_3(double const &x){ return cosh(x); }
SWIGINTERN double casadi_GenericExpressionCommon_casadi_atanh__SWIG_3(double const &x){ return atanh(x); }
SWIGINTERN double casadi_GenericExpressionCommon_casadi_asinh__SWIG_3(double const &x){ return asinh(x); }
SWIGINTERN double casadi_GenericExpressionCommon_casadi_acosh__SWIG_3(double const &x){ return acosh(x); }
SWIGINTERN double casadi_GenericExpressionCommon_casadi_exp__SWIG_3(double const &x){ return exp(x); }
SWIGINTERN double casadi_GenericExpressionCommon_casadi_log__SWIG_3(double const &x){ return log(x); }
SWIGINTERN double casadi_GenericExpressionCommon_casadi_log10__SWIG_3(double const &x){ return log10(x); }
SWIGINTERN double casadi_GenericExpressionCommon_casadi_log1p__SWIG_3(double const &x){ return log1p(x); }
SWIGINTERN double casadi_GenericExpressionCommon_casadi_expm1__SWIG_3(double const &x){ return expm1(x); }
SWIGINTERN double casadi_GenericExpressionCommon_casadi_floor__SWIG_3(double const &x){ return floor(x); }
SWIGINTERN double casadi_GenericExpressionCommon_casadi_ceil__SWIG_3(double const &x){ return ceil(x); }
SWIGINTERN double casadi_GenericExpressionCommon_casadi_erf__SWIG_3(double const &x){ return erf(x); }
SWIGINTERN double casadi_GenericExpressionCommon_casadi_erfinv__SWIG_3(double const &x){ using casadi::erfinv; return erfinv(x); }
SWIGINTERN double casadi_GenericExpressionCommon_casadi_sign__SWIG_3(double const &x){ using casadi::sign; return sign(x); }
SWIGINTERN double casadi_GenericExpressionCommon_casadi_power__SWIG_3(double const &x,double const &n){ return pow(x, n); }
SWIGINTERN double casadi_GenericExpressionCommon_casadi_mod__SWIG_3(double const &x,double const &y){ return fmod(x, y); }
SWIGINTERN double casadi_GenericExpressionCommon_casadi_fmod__SWIG_3(double const &x,double const &y){ return fmod(x, y); }
SWIGINTERN double casadi_GenericExpressionCommon_casadi_remainder__SWIG_3(double const &x,double const &y){ return remainder(x, y); }
SWIGINTERN double casadi_GenericExpressionCommon_casadi_atan2__SWIG_3(double const &x,double const &y){ return atan2(x, y); }
SWIGINTERN double casadi_GenericExpressionCommon_casadi_fmin__SWIG_3(double const &x,double const &y){ return fmin(x, y); }
SWIGINTERN double casadi_GenericExpressionCommon_casadi_fmax__SWIG_3(double const &x,double const &y){ return fmax(x, y); }
SWIGINTERN double casadi_GenericExpressionCommon_casadi_hypot__SWIG_3(double const &x,double const &y){ return hypot(x, y); }
SWIGINTERN double casadi_GenericExpressionCommon_casadi_simplify__SWIG_3(double const &x){ using casadi::simplify; return simplify(x); }
SWIGINTERN bool casadi_GenericExpressionCommon_casadi_is_equal__SWIG_3(double const &x,double const &y,casadi_int depth=0){ using casadi::is_equal; return is_equal(x, y, depth); }
SWIGINTERN double casadi_GenericExpressionCommon_casadi_copysign__SWIG_3(double const &x,double const &y){ return copysign(x, y); }
SWIGINTERN double casadi_GenericExpressionCommon_casadi_constpow__SWIG_3(double const &x,double const &y){ using casadi::constpow; return constpow(x, y); }
SWIGINTERN casadi::Matrix< double > casadi_MatrixCommon_casadi_all__SWIG_0(casadi::Matrix< double > const &x){
  return all(x);
}
SWIGINTERN casadi::Matrix< double > casadi_MatrixCommon_casadi_any__SWIG_0(casadi::Matrix< double > const &x){
  return any(x);
}
SWIGINTERN casadi::Matrix< double > casadi_MatrixCommon_casadi_adj__SWIG_0(casadi::Matrix< double > const &A){
  return adj(A);
}
SWIGINTERN casadi::Matrix< double > casadi_MatrixCommon_casadi_minor__SWIG_0(casadi::Matrix< double > const &x,casadi_int i,casadi_int j){
  return minor(x, i, j);
}
SWIGINTERN casadi::Matrix< double > casadi_MatrixCommon_casadi_cofactor__SWIG_0(casadi::Matrix< double > const &x,casadi_int i,casadi_int j){
  return cofactor(x, i, j);
}
SWIGINTERN void casadi_MatrixCommon_casadi_qr__SWIG_0(casadi::Matrix< double > const &A,casadi::Matrix< double > &OUTPUT1,casadi::Matrix< double > &OUTPUT2){
  return qr(A, OUTPUT1, OUTPUT2);
}
SWIGINTERN void casadi_MatrixCommon_casadi_qr_sparse__SWIG_0(casadi::Matrix< double > const &A,casadi::Matrix< double > &OUTPUT1,casadi::Matrix< double > &OUTPUT2,casadi::Matrix< double > &OUTPUT3,std::vector< casadi_int,std::allocator< casadi_int > > &OUTPUT4,std::vector< casadi_int,std::allocator< casadi_int > > &OUTPUT5,bool amd=true){
  return qr_sparse(A, OUTPUT1, OUTPUT2, OUTPUT3, OUTPUT4, OUTPUT5, amd);
}
SWIGINTERN casadi::Matrix< double > casadi_MatrixCommon_casadi_qr_solve__SWIG_0(casadi::Matrix< double > const &b,casadi::Matrix< double > const &v,casadi::Matrix< double > const &r,casadi::Matrix< double > const &beta,std::vector< casadi_int,std::allocator< casadi_int > > const &prinv,std::vector< casadi_int,std::allocator< casadi_int > > const &pc,bool tr=false){
  return qr_solve(b, v, r, beta, prinv, pc, tr);
}
SWIGINTERN void casadi_MatrixCommon_casadi_ldl__SWIG_0(casadi::Matrix< double > const &A,casadi::Matrix< double > &OUTPUT1,casadi::Matrix< double > &OUTPUT2,std::vector< casadi_int,std::allocator< casadi_int > > &OUTPUT3,bool amd=true){
  return ldl(A, OUTPUT1, OUTPUT2, OUTPUT3, amd);
}
SWIGINTERN casadi::Matrix< double > casadi_MatrixCommon_casadi_ldl_solve__SWIG_0(casadi::Matrix< double > const &b,casadi::Matrix< double > const &D,casadi::Matrix< double > const &LT,std::vector< casadi_int,std::allocator< casadi_int > > const &p){
  return ldl_solve(b, D, LT, p);
}
SWIGINTERN casadi::Matrix< double > casadi_MatrixCommon_casadi_chol__SWIG_0(casadi::Matrix< double > const &A){
  return chol(A);
}
SWIGINTERN casadi::Matrix< double > casadi_MatrixCommon_casadi_norm_inf_mul__SWIG_0(casadi::Matrix< double > const &x,casadi::Matrix< double > const &y){
  return norm_inf_mul(x, y);
}
SWIGINTERN casadi::Matrix< double > casadi_MatrixCommon_casadi_sparsify__SWIG_0(casadi::Matrix< double > const &A,double tol=0){
  return sparsify(A, tol);
}
SWIGINTERN void casadi_MatrixCommon_casadi_expand__SWIG_0(casadi::Matrix< double > const &ex,casadi::Matrix< double > &OUTPUT1,casadi::Matrix< double > &OUTPUT2){
  expand(ex, OUTPUT1, OUTPUT2);
}
SWIGINTERN casadi::Matrix< double > casadi_MatrixCommon_casadi_pw_const__SWIG_0(casadi::Matrix< double > const &t,casadi::Matrix< double > const &tval,casadi::Matrix< double > const &val){
  return pw_const(t, tval, val);
}
SWIGINTERN casadi::Matrix< double > casadi_MatrixCommon_casadi_pw_lin__SWIG_0(casadi::Matrix< double > const &t,casadi::Matrix< double > const &tval,casadi::Matrix< double > const &val){
  return pw_lin(t, tval, val);
}
SWIGINTERN casadi::Matrix< double > casadi_MatrixCommon_casadi_heaviside__SWIG_0(casadi::Matrix< double > const &x){
  return heaviside(x);
}
SWIGINTERN casadi::Matrix< double > casadi_MatrixCommon_casadi_rectangle__SWIG_0(casadi::Matrix< double > const &x){
  return rectangle(x);
}
SWIGINTERN casadi::Matrix< double > casadi_MatrixCommon_casadi_triangle__SWIG_0(casadi::Matrix< double > const &x){
  return triangle(x);
}
SWIGINTERN casadi::Matrix< double > casadi_MatrixCommon_casadi_ramp__SWIG_0(casadi::Matrix< double > const &x){
  return ramp(x);
}
SWIGINTERN casadi::Matrix< double > casadi_MatrixCommon_casadi_gauss_quadrature__SWIG_0(casadi::Matrix< double > const &f,casadi::Matrix< double > const &x,casadi::Matrix< double > const &a,casadi::Matrix< double > const &b,casadi_int order=5){
  return gauss_quadrature(f, x, a, b, order);
}
SWIGINTERN casadi::Matrix< double > casadi_MatrixCommon_casadi_gauss_quadrature__SWIG_1(casadi::Matrix< double > const &f,casadi::Matrix< double > const &x,casadi::Matrix< double > const &a,casadi::Matrix< double > const &b,casadi_int order,casadi::Matrix< double > const &w){
  return gauss_quadrature(f, x, a, b, order, w);
}
SWIGINTERN casadi::Matrix< double > casadi_MatrixCommon_casadi_taylor__SWIG_0(casadi::Matrix< double > const &ex,casadi::Matrix< double > const &x,casadi::Matrix< double > const &a=0,casadi_int order=1){
  return taylor(ex, x, a, order);
}
SWIGINTERN casadi::Matrix< double > casadi_MatrixCommon_casadi_mtaylor__SWIG_0(casadi::Matrix< double > const &ex,casadi::Matrix< double > const &x,casadi::Matrix< double > const &a,casadi_int order=1){
  return mtaylor(ex, x, a, order);
}
SWIGINTERN casadi::Matrix< double > casadi_MatrixCommon_casadi_mtaylor__SWIG_1(casadi::Matrix< double > const &ex,casadi::Matrix< double > const &x,casadi::Matrix< double > const &a,casadi_int order,std::vector< casadi_int,std::allocator< casadi_int > > const &order_contributions){
  return mtaylor(ex, x, a, order, order_contributions);
}
SWIGINTERN casadi::Matrix< double > casadi_MatrixCommon_casadi_poly_coeff__SWIG_0(casadi::Matrix< double > const &ex,casadi::Matrix< double > const &x){
  return poly_coeff(ex, x);
}
SWIGINTERN casadi::Matrix< double > casadi_MatrixCommon_casadi_poly_roots__SWIG_0(casadi::Matrix< double > const &p){
  return poly_roots(p);
}
SWIGINTERN casadi::Matrix< double > casadi_MatrixCommon_casadi_eig_symbolic__SWIG_0(casadi::Matrix< double > const &m){
  return eig_symbolic(m);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_MatrixCommon_casadi_all__SWIG_1(casadi::Matrix< casadi::SXElem > const &x){
  return all(x);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_MatrixCommon_casadi_any__SWIG_1(casadi::Matrix< casadi::SXElem > const &x){
  return any(x);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_MatrixCommon_casadi_adj__SWIG_1(casadi::Matrix< casadi::SXElem > const &A){
  return adj(A);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_MatrixCommon_casadi_minor__SWIG_1(casadi::Matrix< casadi::SXElem > const &x,casadi_int i,casadi_int j){
  return minor(x, i, j);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_MatrixCommon_casadi_cofactor__SWIG_1(casadi::Matrix< casadi::SXElem > const &x,casadi_int i,casadi_int j){
  return cofactor(x, i, j);
}
SWIGINTERN void casadi_MatrixCommon_casadi_qr__SWIG_1(casadi::Matrix< casadi::SXElem > const &A,casadi::Matrix< casadi::SXElem > &OUTPUT1,casadi::Matrix< casadi::SXElem > &OUTPUT2){
  return qr(A, OUTPUT1, OUTPUT2);
}
SWIGINTERN void casadi_MatrixCommon_casadi_qr_sparse__SWIG_1(casadi::Matrix< casadi::SXElem > const &A,casadi::Matrix< casadi::SXElem > &OUTPUT1,casadi::Matrix< casadi::SXElem > &OUTPUT2,casadi::Matrix< casadi::SXElem > &OUTPUT3,std::vector< casadi_int,std::allocator< casadi_int > > &OUTPUT4,std::vector< casadi_int,std::allocator< casadi_int > > &OUTPUT5,bool amd=true){
  return qr_sparse(A, OUTPUT1, OUTPUT2, OUTPUT3, OUTPUT4, OUTPUT5, amd);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_MatrixCommon_casadi_qr_solve__SWIG_1(casadi::Matrix< casadi::SXElem > const &b,casadi::Matrix< casadi::SXElem > const &v,casadi::Matrix< casadi::SXElem > const &r,casadi::Matrix< casadi::SXElem > const &beta,std::vector< casadi_int,std::allocator< casadi_int > > const &prinv,std::vector< casadi_int,std::allocator< casadi_int > > const &pc,bool tr=false){
  return qr_solve(b, v, r, beta, prinv, pc, tr);
}
SWIGINTERN void casadi_MatrixCommon_casadi_ldl__SWIG_1(casadi::Matrix< casadi::SXElem > const &A,casadi::Matrix< casadi::SXElem > &OUTPUT1,casadi::Matrix< casadi::SXElem > &OUTPUT2,std::vector< casadi_int,std::allocator< casadi_int > > &OUTPUT3,bool amd=true){
  return ldl(A, OUTPUT1, OUTPUT2, OUTPUT3, amd);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_MatrixCommon_casadi_ldl_solve__SWIG_1(casadi::Matrix< casadi::SXElem > const &b,casadi::Matrix< casadi::SXElem > const &D,casadi::Matrix< casadi::SXElem > const &LT,std::vector< casadi_int,std::allocator< casadi_int > > const &p){
  return ldl_solve(b, D, LT, p);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_MatrixCommon_casadi_chol__SWIG_1(casadi::Matrix< casadi::SXElem > const &A){
  return chol(A);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_MatrixCommon_casadi_norm_inf_mul__SWIG_1(casadi::Matrix< casadi::SXElem > const &x,casadi::Matrix< casadi::SXElem > const &y){
  return norm_inf_mul(x, y);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_MatrixCommon_casadi_sparsify__SWIG_1(casadi::Matrix< casadi::SXElem > const &A,double tol=0){
  return sparsify(A, tol);
}
SWIGINTERN void casadi_MatrixCommon_casadi_expand__SWIG_1(casadi::Matrix< casadi::SXElem > const &ex,casadi::Matrix< casadi::SXElem > &OUTPUT1,casadi::Matrix< casadi::SXElem > &OUTPUT2){
  expand(ex, OUTPUT1, OUTPUT2);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_MatrixCommon_casadi_pw_const__SWIG_1(casadi::Matrix< casadi::SXElem > const &t,casadi::Matrix< casadi::SXElem > const &tval,casadi::Matrix< casadi::SXElem > const &val){
  return pw_const(t, tval, val);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_MatrixCommon_casadi_pw_lin__SWIG_1(casadi::Matrix< casadi::SXElem > const &t,casadi::Matrix< casadi::SXElem > const &tval,casadi::Matrix< casadi::SXElem > const &val){
  return pw_lin(t, tval, val);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_MatrixCommon_casadi_heaviside__SWIG_1(casadi::Matrix< casadi::SXElem > const &x){
  return heaviside(x);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_MatrixCommon_casadi_rectangle__SWIG_1(casadi::Matrix< casadi::SXElem > const &x){
  return rectangle(x);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_MatrixCommon_casadi_triangle__SWIG_1(casadi::Matrix< casadi::SXElem > const &x){
  return triangle(x);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_MatrixCommon_casadi_ramp__SWIG_1(casadi::Matrix< casadi::SXElem > const &x){
  return ramp(x);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_MatrixCommon_casadi_gauss_quadrature__SWIG_2(casadi::Matrix< casadi::SXElem > const &f,casadi::Matrix< casadi::SXElem > const &x,casadi::Matrix< casadi::SXElem > const &a,casadi::Matrix< casadi::SXElem > const &b,casadi_int order=5){
  return gauss_quadrature(f, x, a, b, order);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_MatrixCommon_casadi_gauss_quadrature__SWIG_3(casadi::Matrix< casadi::SXElem > const &f,casadi::Matrix< casadi::SXElem > const &x,casadi::Matrix< casadi::SXElem > const &a,casadi::Matrix< casadi::SXElem > const &b,casadi_int order,casadi::Matrix< casadi::SXElem > const &w){
  return gauss_quadrature(f, x, a, b, order, w);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_MatrixCommon_casadi_taylor__SWIG_1(casadi::Matrix< casadi::SXElem > const &ex,casadi::Matrix< casadi::SXElem > const &x,casadi::Matrix< casadi::SXElem > const &a=0,casadi_int order=1){
  return taylor(ex, x, a, order);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_MatrixCommon_casadi_mtaylor__SWIG_2(casadi::Matrix< casadi::SXElem > const &ex,casadi::Matrix< casadi::SXElem > const &x,casadi::Matrix< casadi::SXElem > const &a,casadi_int order=1){
  return mtaylor(ex, x, a, order);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_MatrixCommon_casadi_mtaylor__SWIG_3(casadi::Matrix< casadi::SXElem > const &ex,casadi::Matrix< casadi::SXElem > const &x,casadi::Matrix< casadi::SXElem > const &a,casadi_int order,std::vector< casadi_int,std::allocator< casadi_int > > const &order_contributions){
  return mtaylor(ex, x, a, order, order_contributions);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_MatrixCommon_casadi_poly_coeff__SWIG_1(casadi::Matrix< casadi::SXElem > const &ex,casadi::Matrix< casadi::SXElem > const &x){
  return poly_coeff(ex, x);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_MatrixCommon_casadi_poly_roots__SWIG_1(casadi::Matrix< casadi::SXElem > const &p){
  return poly_roots(p);
}
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_MatrixCommon_casadi_eig_symbolic__SWIG_1(casadi::Matrix< casadi::SXElem > const &m){
  return eig_symbolic(m);
}
SWIGINTERN void casadi_Matrix_Sl_double_Sg__assign(casadi::Matrix< double > *self,casadi::Matrix< double > const &rhs){ (*self)=rhs; }

SWIGINTERN int
SWIG_AsCharPtrAndSize(mxArray* pm, char** cptr, size_t* psize, int *alloc)
{
  if(!mxIsChar(pm) || (mxGetNumberOfElements(pm) != 0 && mxGetM(pm)!=1)) return SWIG_TypeError;
  size_t len=mxGetN(pm);
  static char buf[256];
  int flag = mxGetString(pm,buf,(mwSize)sizeof(buf));
  if(flag) return SWIG_TypeError;

  if (alloc) {
    *cptr = reinterpret_cast< char* >(memcpy((new char[len + 1]), buf, sizeof(char)*(len + 1)));
    *alloc = SWIG_NEWOBJ;
  } else if (cptr)
    *cptr = buf;
  if (psize)
    *psize = len + 1;
  return SWIG_OK;
}


SWIGINTERN int
SWIG_AsCharArray(mxArray* obj, char *val, size_t size)
{ 
  char* cptr = 0; size_t csize = 0; int alloc = SWIG_OLDOBJ;
  int res = SWIG_AsCharPtrAndSize(obj, &cptr, &csize, &alloc);
  if (SWIG_IsOK(res)) {
    /* special case of single char conversion when we don't need space for NUL */
    if (size == 1 && csize == 2 && cptr && !cptr[1]) --csize;
    if (csize <= size) {
      if (val) {
	if (csize) memcpy(val, cptr, csize*sizeof(char));
	if (csize < size) memset(val + csize, 0, (size - csize)*sizeof(char));
      }
      if (alloc == SWIG_NEWOBJ) {
	delete[] cptr;
	res = SWIG_DelNewMask(res);
      }      
      return res;
    }
    if (alloc == SWIG_NEWOBJ) delete[] cptr;
  }
  return SWIG_TypeError;
}


SWIGINTERN int
SWIG_AsVal_char (mxArray* obj, char *val)
{    
  int res = SWIG_AsCharArray(obj, val, 1);
  if (!SWIG_IsOK(res)) {
    long v;
    res = SWIG_AddCast(SWIG_AsVal_long (obj, &v));
    if (SWIG_IsOK(res)) {
      if ((CHAR_MIN <= v) && (v <= CHAR_MAX)) {
	if (val) *val = static_cast< char >(v);
      } else {
	res = SWIG_OverflowError;
      }
    }
  }
  return res;
}

SWIGINTERN casadi::Matrix< double > const casadi_Matrix_Sl_double_Sg__paren__SWIG_0(casadi::Matrix< double > const *self,char rr){
      casadi_assert_dev(rr==':');
      return vec(*self);
    }
SWIGINTERN casadi::Matrix< double > const casadi_Matrix_Sl_double_Sg__paren__SWIG_1(casadi::Matrix< double > const *self,casadi::Matrix< casadi_int > const &rr){
      casadi::Matrix<double> m;
      self->get(m, true, rr);
      return m;
    }
SWIGINTERN casadi::Matrix< double > const casadi_Matrix_Sl_double_Sg__paren__SWIG_2(casadi::Matrix< double > const *self,casadi::Sparsity const &sp){
      casadi::Matrix<double> m;
      self->get(m, true, sp);
      return m;
    }
SWIGINTERN casadi::Matrix< double > const casadi_Matrix_Sl_double_Sg__paren__SWIG_3(casadi::Matrix< double > const *self,char rr,char cc){
      casadi::Matrix<double> m;
      self->get(m, true, casadi::char2Slice(rr), casadi::char2Slice(cc));
      return m;
    }
SWIGINTERN casadi::Matrix< double > const casadi_Matrix_Sl_double_Sg__paren__SWIG_4(casadi::Matrix< double > const *self,char rr,casadi::Matrix< casadi_int > const &cc){
      casadi::Matrix<double> m;
      self->get(m, true, casadi::char2Slice(rr), cc);
      return m;
    }
SWIGINTERN casadi::Matrix< double > const casadi_Matrix_Sl_double_Sg__paren__SWIG_5(casadi::Matrix< double > const *self,casadi::Matrix< casadi_int > const &rr,char cc){
      casadi::Matrix<double> m;
      self->get(m, true, rr, casadi::char2Slice(cc));
      return m;
    }
SWIGINTERN casadi::Matrix< double > const casadi_Matrix_Sl_double_Sg__paren__SWIG_6(casadi::Matrix< double > const *self,casadi::Matrix< casadi_int > const &rr,casadi::Matrix< casadi_int > const &cc){
      casadi::Matrix<double> m;
      self->get(m, true, rr, cc);
      return m;
    }
SWIGINTERN void casadi_Matrix_Sl_double_Sg__paren_asgn__SWIG_0(casadi::Matrix< double > *self,casadi::Matrix< double > const &m,char rr){
      casadi_assert_dev(rr==':');
      self->set(m, false, casadi::IM(casadi::range(self->numel())));
    }
SWIGINTERN void casadi_Matrix_Sl_double_Sg__paren_asgn__SWIG_1(casadi::Matrix< double > *self,casadi::Matrix< double > const &m,casadi::Matrix< casadi_int > const &rr){ self->set(m, true, rr);}
SWIGINTERN void casadi_Matrix_Sl_double_Sg__paren_asgn__SWIG_2(casadi::Matrix< double > *self,casadi::Matrix< double > const &m,casadi::Sparsity const &sp){ self->set(m, true, sp);}
SWIGINTERN void casadi_Matrix_Sl_double_Sg__paren_asgn__SWIG_3(casadi::Matrix< double > *self,casadi::Matrix< double > const &m,char rr,char cc){ self->set(m, true, casadi::char2Slice(rr), casadi::char2Slice(cc));}
SWIGINTERN void casadi_Matrix_Sl_double_Sg__paren_asgn__SWIG_4(casadi::Matrix< double > *self,casadi::Matrix< double > const &m,char rr,casadi::Matrix< casadi_int > const &cc){ self->set(m, true, casadi::char2Slice(rr), cc);}
SWIGINTERN void casadi_Matrix_Sl_double_Sg__paren_asgn__SWIG_5(casadi::Matrix< double > *self,casadi::Matrix< double > const &m,casadi::Matrix< casadi_int > const &rr,char cc){ self->set(m, true, rr, casadi::char2Slice(cc));}
SWIGINTERN void casadi_Matrix_Sl_double_Sg__paren_asgn__SWIG_6(casadi::Matrix< double > *self,casadi::Matrix< double > const &m,casadi::Matrix< casadi_int > const &rr,casadi::Matrix< casadi_int > const &cc){ self->set(m, true, rr, cc);}
SWIGINTERN casadi::Matrix< double > const casadi_Matrix_Sl_double_Sg__brace__SWIG_0(casadi::Matrix< double > const *self,char rr){ casadi::Matrix<double> m; self->get_nz(m, true, casadi::char2Slice(rr)); return m;}
SWIGINTERN casadi::Matrix< double > const casadi_Matrix_Sl_double_Sg__brace__SWIG_1(casadi::Matrix< double > const *self,casadi::Matrix< casadi_int > const &rr){ casadi::Matrix<double> m; self->get_nz(m, true, rr); return m;}
SWIGINTERN void casadi_Matrix_Sl_double_Sg__setbrace__SWIG_0(casadi::Matrix< double > *self,casadi::Matrix< double > const &m,char rr){ self->set_nz(m, true, casadi::char2Slice(rr));}
SWIGINTERN void casadi_Matrix_Sl_double_Sg__setbrace__SWIG_1(casadi::Matrix< double > *self,casadi::Matrix< double > const &m,casadi::Matrix< casadi_int > const &rr){ self->set_nz(m, true, rr);}
SWIGINTERN casadi_int casadi_Matrix_Sl_double_Sg__end(casadi::Matrix< double > const *self,casadi_int i,casadi_int n){
      return n==1 ? self->numel() : i==1 ? self->size1() : self->size2();
    }
SWIGINTERN casadi_int casadi_Matrix_Sl_double_Sg__numel__SWIG_0(casadi::Matrix< double > const *self,casadi_int k){
      return 1;
    }
SWIGINTERN casadi_int casadi_Matrix_Sl_double_Sg__numel__SWIG_1(casadi::Matrix< double > const *self,char rr){
      casadi_assert_dev(rr==':');
      return 1;
    }
SWIGINTERN casadi_int casadi_Matrix_Sl_double_Sg__numel__SWIG_2(casadi::Matrix< double > const *self,std::vector< casadi_int,std::allocator< casadi_int > > const &k){
      return 1;
    }
SWIGINTERN casadi_int casadi_Matrix_Sl_double_Sg__numel__SWIG_3(casadi::Matrix< double > const *self){
      return self->numel();
    }
SWIGINTERN casadi::Matrix< double > casadi_Matrix_Sl_double_Sg__ctranspose(casadi::Matrix< double > const *self){ return self->T();}
SWIGINTERN mxArray *casadi_Matrix_Sl_double_Sg__full(casadi::Matrix< double > const *self){
      return full(*self);
    }
SWIGINTERN mxArray *casadi_Matrix_Sl_double_Sg__sparse(casadi::Matrix< double > const *self){
      return sparse(*self);
    }
SWIGINTERN casadi::Matrix< casadi::SXElem > const casadi_Matrix_Sl_casadi_SXElem_Sg__paren__SWIG_0(casadi::Matrix< casadi::SXElem > const *self,char rr){
      casadi_assert_dev(rr==':');
      return vec(*self);
    }
SWIGINTERN casadi::Matrix< casadi::SXElem > const casadi_Matrix_Sl_casadi_SXElem_Sg__paren__SWIG_1(casadi::Matrix< casadi::SXElem > const *self,casadi::Matrix< casadi_int > const &rr){
      casadi::Matrix<casadi::SXElem> m;
      self->get(m, true, rr);
      return m;
    }
SWIGINTERN casadi::Matrix< casadi::SXElem > const casadi_Matrix_Sl_casadi_SXElem_Sg__paren__SWIG_2(casadi::Matrix< casadi::SXElem > const *self,casadi::Sparsity const &sp){
      casadi::Matrix<casadi::SXElem> m;
      self->get(m, true, sp);
      return m;
    }
SWIGINTERN casadi::Matrix< casadi::SXElem > const casadi_Matrix_Sl_casadi_SXElem_Sg__paren__SWIG_3(casadi::Matrix< casadi::SXElem > const *self,char rr,char cc){
      casadi::Matrix<casadi::SXElem> m;
      self->get(m, true, casadi::char2Slice(rr), casadi::char2Slice(cc));
      return m;
    }
SWIGINTERN casadi::Matrix< casadi::SXElem > const casadi_Matrix_Sl_casadi_SXElem_Sg__paren__SWIG_4(casadi::Matrix< casadi::SXElem > const *self,char rr,casadi::Matrix< casadi_int > const &cc){
      casadi::Matrix<casadi::SXElem> m;
      self->get(m, true, casadi::char2Slice(rr), cc);
      return m;
    }
SWIGINTERN casadi::Matrix< casadi::SXElem > const casadi_Matrix_Sl_casadi_SXElem_Sg__paren__SWIG_5(casadi::Matrix< casadi::SXElem > const *self,casadi::Matrix< casadi_int > const &rr,char cc){
      casadi::Matrix<casadi::SXElem> m;
      self->get(m, true, rr, casadi::char2Slice(cc));
      return m;
    }
SWIGINTERN casadi::Matrix< casadi::SXElem > const casadi_Matrix_Sl_casadi_SXElem_Sg__paren__SWIG_6(casadi::Matrix< casadi::SXElem > const *self,casadi::Matrix< casadi_int > const &rr,casadi::Matrix< casadi_int > const &cc){
      casadi::Matrix<casadi::SXElem> m;
      self->get(m, true, rr, cc);
      return m;
    }
SWIGINTERN void casadi_Matrix_Sl_casadi_SXElem_Sg__paren_asgn__SWIG_0(casadi::Matrix< casadi::SXElem > *self,casadi::Matrix< casadi::SXElem > const &m,char rr){
      casadi_assert_dev(rr==':');
      self->set(m, false, casadi::IM(casadi::range(self->numel())));
    }
SWIGINTERN void casadi_Matrix_Sl_casadi_SXElem_Sg__paren_asgn__SWIG_1(casadi::Matrix< casadi::SXElem > *self,casadi::Matrix< casadi::SXElem > const &m,casadi::Matrix< casadi_int > const &rr){ self->set(m, true, rr);}
SWIGINTERN void casadi_Matrix_Sl_casadi_SXElem_Sg__paren_asgn__SWIG_2(casadi::Matrix< casadi::SXElem > *self,casadi::Matrix< casadi::SXElem > const &m,casadi::Sparsity const &sp){ self->set(m, true, sp);}
SWIGINTERN void casadi_Matrix_Sl_casadi_SXElem_Sg__paren_asgn__SWIG_3(casadi::Matrix< casadi::SXElem > *self,casadi::Matrix< casadi::SXElem > const &m,char rr,char cc){ self->set(m, true, casadi::char2Slice(rr), casadi::char2Slice(cc));}
SWIGINTERN void casadi_Matrix_Sl_casadi_SXElem_Sg__paren_asgn__SWIG_4(casadi::Matrix< casadi::SXElem > *self,casadi::Matrix< casadi::SXElem > const &m,char rr,casadi::Matrix< casadi_int > const &cc){ self->set(m, true, casadi::char2Slice(rr), cc);}
SWIGINTERN void casadi_Matrix_Sl_casadi_SXElem_Sg__paren_asgn__SWIG_5(casadi::Matrix< casadi::SXElem > *self,casadi::Matrix< casadi::SXElem > const &m,casadi::Matrix< casadi_int > const &rr,char cc){ self->set(m, true, rr, casadi::char2Slice(cc));}
SWIGINTERN void casadi_Matrix_Sl_casadi_SXElem_Sg__paren_asgn__SWIG_6(casadi::Matrix< casadi::SXElem > *self,casadi::Matrix< casadi::SXElem > const &m,casadi::Matrix< casadi_int > const &rr,casadi::Matrix< casadi_int > const &cc){ self->set(m, true, rr, cc);}
SWIGINTERN casadi::Matrix< casadi::SXElem > const casadi_Matrix_Sl_casadi_SXElem_Sg__brace__SWIG_0(casadi::Matrix< casadi::SXElem > const *self,char rr){ casadi::Matrix<casadi::SXElem> m; self->get_nz(m, true, casadi::char2Slice(rr)); return m;}
SWIGINTERN casadi::Matrix< casadi::SXElem > const casadi_Matrix_Sl_casadi_SXElem_Sg__brace__SWIG_1(casadi::Matrix< casadi::SXElem > const *self,casadi::Matrix< casadi_int > const &rr){ casadi::Matrix<casadi::SXElem> m; self->get_nz(m, true, rr); return m;}
SWIGINTERN void casadi_Matrix_Sl_casadi_SXElem_Sg__setbrace__SWIG_0(casadi::Matrix< casadi::SXElem > *self,casadi::Matrix< casadi::SXElem > const &m,char rr){ self->set_nz(m, true, casadi::char2Slice(rr));}
SWIGINTERN void casadi_Matrix_Sl_casadi_SXElem_Sg__setbrace__SWIG_1(casadi::Matrix< casadi::SXElem > *self,casadi::Matrix< casadi::SXElem > const &m,casadi::Matrix< casadi_int > const &rr){ self->set_nz(m, true, rr);}
SWIGINTERN casadi_int casadi_Matrix_Sl_casadi_SXElem_Sg__end(casadi::Matrix< casadi::SXElem > const *self,casadi_int i,casadi_int n){
      return n==1 ? self->numel() : i==1 ? self->size1() : self->size2();
    }
SWIGINTERN casadi_int casadi_Matrix_Sl_casadi_SXElem_Sg__numel__SWIG_0(casadi::Matrix< casadi::SXElem > const *self,casadi_int k){
      return 1;
    }
SWIGINTERN casadi_int casadi_Matrix_Sl_casadi_SXElem_Sg__numel__SWIG_1(casadi::Matrix< casadi::SXElem > const *self,char rr){
      casadi_assert_dev(rr==':');
      return 1;
    }
SWIGINTERN casadi_int casadi_Matrix_Sl_casadi_SXElem_Sg__numel__SWIG_2(casadi::Matrix< casadi::SXElem > const *self,std::vector< casadi_int,std::allocator< casadi_int > > const &k){
      return 1;
    }
SWIGINTERN casadi_int casadi_Matrix_Sl_casadi_SXElem_Sg__numel__SWIG_3(casadi::Matrix< casadi::SXElem > const *self){
      return self->numel();
    }
SWIGINTERN casadi::Matrix< casadi::SXElem > casadi_Matrix_Sl_casadi_SXElem_Sg__ctranspose(casadi::Matrix< casadi::SXElem > const *self){ return self->T();}
SWIGINTERN casadi::MX const casadi_MX_paren__SWIG_0(casadi::MX const *self,char rr){
      casadi_assert_dev(rr==':');
      return vec(*self);
    }
SWIGINTERN casadi::MX const casadi_MX_paren__SWIG_1(casadi::MX const *self,casadi::Matrix< casadi_int > const &rr){
      casadi::MX m;
      self->get(m, true, rr);
      return m;
    }
SWIGINTERN casadi::MX const casadi_MX_paren__SWIG_2(casadi::MX const *self,casadi::Sparsity const &sp){
      casadi::MX m;
      self->get(m, true, sp);
      return m;
    }
SWIGINTERN casadi::MX const casadi_MX_paren__SWIG_3(casadi::MX const *self,char rr,char cc){
      casadi::MX m;
      self->get(m, true, casadi::char2Slice(rr), casadi::char2Slice(cc));
      return m;
    }
SWIGINTERN casadi::MX const casadi_MX_paren__SWIG_4(casadi::MX const *self,char rr,casadi::Matrix< casadi_int > const &cc){
      casadi::MX m;
      self->get(m, true, casadi::char2Slice(rr), cc);
      return m;
    }
SWIGINTERN casadi::MX const casadi_MX_paren__SWIG_5(casadi::MX const *self,casadi::Matrix< casadi_int > const &rr,char cc){
      casadi::MX m;
      self->get(m, true, rr, casadi::char2Slice(cc));
      return m;
    }
SWIGINTERN casadi::MX const casadi_MX_paren__SWIG_6(casadi::MX const *self,casadi::Matrix< casadi_int > const &rr,casadi::Matrix< casadi_int > const &cc){
      casadi::MX m;
      self->get(m, true, rr, cc);
      return m;
    }
SWIGINTERN void casadi_MX_paren_asgn__SWIG_0(casadi::MX *self,casadi::MX const &m,char rr){
      casadi_assert_dev(rr==':');
      self->set(m, false, casadi::IM(casadi::range(self->numel())));
    }
SWIGINTERN void casadi_MX_paren_asgn__SWIG_1(casadi::MX *self,casadi::MX const &m,casadi::Matrix< casadi_int > const &rr){ self->set(m, true, rr);}
SWIGINTERN void casadi_MX_paren_asgn__SWIG_2(casadi::MX *self,casadi::MX const &m,casadi::Sparsity const &sp){ self->set(m, true, sp);}
SWIGINTERN void casadi_MX_paren_asgn__SWIG_3(casadi::MX *self,casadi::MX const &m,char rr,char cc){ self->set(m, true, casadi::char2Slice(rr), casadi::char2Slice(cc));}
SWIGINTERN void casadi_MX_paren_asgn__SWIG_4(casadi::MX *self,casadi::MX const &m,char rr,casadi::Matrix< casadi_int > const &cc){ self->set(m, true, casadi::char2Slice(rr), cc);}
SWIGINTERN void casadi_MX_paren_asgn__SWIG_5(casadi::MX *self,casadi::MX const &m,casadi::Matrix< casadi_int > const &rr,char cc){ self->set(m, true, rr, casadi::char2Slice(cc));}
SWIGINTERN void casadi_MX_paren_asgn__SWIG_6(casadi::MX *self,casadi::MX const &m,casadi::Matrix< casadi_int > const &rr,casadi::Matrix< casadi_int > const &cc){ self->set(m, true, rr, cc);}
SWIGINTERN casadi::MX const casadi_MX_brace__SWIG_0(casadi::MX const *self,char rr){ casadi::MX m; self->get_nz(m, true, casadi::char2Slice(rr)); return m;}
SWIGINTERN casadi::MX const casadi_MX_brace__SWIG_1(casadi::MX const *self,casadi::Matrix< casadi_int > const &rr){ casadi::MX m; self->get_nz(m, true, rr); return m;}
SWIGINTERN void casadi_MX_setbrace__SWIG_0(casadi::MX *self,casadi::MX const &m,char rr){ self->set_nz(m, true, casadi::char2Slice(rr));}
SWIGINTERN void casadi_MX_setbrace__SWIG_1(casadi::MX *self,casadi::MX const &m,casadi::Matrix< casadi_int > const &rr){ self->set_nz(m, true, rr);}
SWIGINTERN casadi_int casadi_MX_end(casadi::MX const *self,casadi_int i,casadi_int n){
      return n==1 ? self->numel() : i==1 ? self->size1() : self->size2();
    }
SWIGINTERN casadi_int casadi_MX_numel__SWIG_0(casadi::MX const *self,casadi_int k){
      return 1;
    }
SWIGINTERN casadi_int casadi_MX_numel__SWIG_1(casadi::MX const *self,char rr){
      casadi_assert_dev(rr==':');
      return 1;
    }
SWIGINTERN casadi_int casadi_MX_numel__SWIG_2(casadi::MX const *self,std::vector< casadi_int,std::allocator< casadi_int > > const &k){
      return 1;
    }
SWIGINTERN casadi_int casadi_MX_numel__SWIG_3(casadi::MX const *self){
      return self->numel();
    }
SWIGINTERN casadi::MX casadi_MX_ctranspose(casadi::MX const *self){ return self->T();}
SWIGINTERN casadi::MX casadi_MX_casadi_find(casadi::MX const &x){
  return find(x);
}
SWIGINTERN casadi::MX casadi_MX_casadi_low(casadi::MX const &v,casadi::MX const &p,casadi::Dict const &options=casadi::Dict()){
  return low(v, p, options);
}
SWIGINTERN casadi::MX casadi_MX_casadi_inv_node(casadi::MX const &x){
  return inv_node(x);
}
SWIGINTERN casadi::MX const casadi_MX_brace__SWIG_2(casadi::MX const *self,casadi::MX const &rr){ casadi::MX m; self->get_nz(m, true, rr); return m;}
SWIGINTERN casadi::MX const casadi_MX_paren__SWIG_7(casadi::MX const *self,casadi::MX const &rr){
      casadi::MX m;
      self->get(m, true, rr);
      return m;
    }
SWIGINTERN casadi::MX const casadi_MX_paren__SWIG_8(casadi::MX const *self,char rr,casadi::MX const &cc){
      casadi::MX m;
      self->get(m, true, casadi::char2Slice(rr), cc);
      return m;
    }
SWIGINTERN casadi::MX const casadi_MX_paren__SWIG_9(casadi::MX const *self,casadi::MX const &rr,char cc){
      casadi::MX m;
      self->get(m, true, rr, casadi::char2Slice(cc));
      return m;
    }
SWIGINTERN casadi::MX const casadi_MX_paren__SWIG_10(casadi::MX const *self,casadi::MX const &rr,casadi::MX const &cc){
      casadi::MX m;
      self->get(m, true, rr, cc);
      return m;
    }

  namespace casadi {
    /*@SWIG:/local/swig/matlab/../casadi.i,3084,SPARSITY_INTERFACE_ALL@*/
/*@SWIG:/local/swig/matlab/../casadi.i,3092,SPARSITY_INTERFACE_FUN@*/
    /*@SWIG:/local/swig/matlab/../casadi.i,2958,SPARSITY_INTERFACE_FUN_BASE@*/



























































































































/*@SWIG@*/





  /*@SWIG@*/
/*@SWIG:/local/swig/matlab/../casadi.i,3092,SPARSITY_INTERFACE_FUN@*/
    /*@SWIG:/local/swig/matlab/../casadi.i,2958,SPARSITY_INTERFACE_FUN_BASE@*/



























































































































/*@SWIG@*/





  /*@SWIG@*/
/*@SWIG:/local/swig/matlab/../casadi.i,3092,SPARSITY_INTERFACE_FUN@*/
    /*@SWIG:/local/swig/matlab/../casadi.i,2958,SPARSITY_INTERFACE_FUN_BASE@*/



























































































































/*@SWIG@*/





  /*@SWIG@*/
/*@SWIG:/local/swig/matlab/../casadi.i,3092,SPARSITY_INTERFACE_FUN@*/
    /*@SWIG:/local/swig/matlab/../casadi.i,2958,SPARSITY_INTERFACE_FUN_BASE@*/



























































































































/*@SWIG@*/





  /*@SWIG@*/
/*@SWIG@*/
    /*@SWIG:/local/swig/matlab/../casadi.i,3495,GENERIC_EXPRESSION_ALL@*/
/*@SWIG:/local/swig/matlab/../casadi.i,3440,GENERIC_EXPRESSION_FUN@*/




















































/*@SWIG@*/
/*@SWIG:/local/swig/matlab/../casadi.i,3440,GENERIC_EXPRESSION_FUN@*/




















































/*@SWIG@*/
/*@SWIG:/local/swig/matlab/../casadi.i,3440,GENERIC_EXPRESSION_FUN@*/




















































/*@SWIG@*/
/*@SWIG:/local/swig/matlab/../casadi.i,3440,GENERIC_EXPRESSION_FUN@*/




















































/*@SWIG@*/
/*@SWIG@*/
    /*@SWIG:/local/swig/matlab/../casadi.i,3434,GENERIC_MATRIX_ALL@*/
/*@SWIG:/local/swig/matlab/../casadi.i,3106,GENERIC_MATRIX_FUN@*/















































































































































































































































































inline std::vector<std::vector< MX > >
casadi_forward(const std::vector< MX > &ex, const std::vector< MX > &arg,
               const std::vector<std::vector< MX > > &v,
               const Dict& opts = Dict()) {
  return forward(ex, arg, v, opts);
}

inline std::vector<std::vector< MX > >
casadi_reverse(const std::vector< MX > &ex, const std::vector< MX > &arg,
               const std::vector<std::vector< MX > > &v,
               const Dict& opts = Dict()) {
  return reverse(ex, arg, v, opts);
}

inline MX casadi_substitute(const MX& ex, const MX& v, const MX& vdef) {
  return substitute(ex, v, vdef);
}

inline std::vector< MX > casadi_substitute(const std::vector< MX >& ex,
                                         const std::vector< MX >& v,
                                         const std::vector< MX >& vdef) {
  return substitute(ex, v, vdef);
}

inline void casadi_substitute_inplace(const std::vector< MX >& v,
                                      std::vector< MX >& INOUT1,
                                      std::vector< MX >& INOUT2,
                                      bool reverse=false) {
  return substitute_inplace(v, INOUT1, INOUT2, reverse);
}

inline void casadi_extract(const std::vector< MX >& ex,
    std::vector< MX >& OUTPUT1,
    std::vector< MX >& OUTPUT2,
    std::vector< MX >& OUTPUT3,
    const Dict& opts = Dict()) {
  OUTPUT1 = ex;
  extract(OUTPUT1, OUTPUT2, OUTPUT3, opts);
}

inline void casadi_shared(const std::vector< MX >& ex,
                               std::vector< MX >& OUTPUT1,
                               std::vector< MX >& OUTPUT2,
                               std::vector< MX >& OUTPUT3,
                               const std::string& v_prefix="v_",
                               const std::string& v_suffix="") {
  OUTPUT1 = ex;
  shared(OUTPUT1, OUTPUT2, OUTPUT3, v_prefix, v_suffix);
}

inline MX casadi_blockcat(const std::vector< std::vector< MX > > &v) {
 return blockcat(v);
}

/*@SWIG@*/
/*@SWIG:/local/swig/matlab/../casadi.i,3106,GENERIC_MATRIX_FUN@*/















































































































































































































































































inline std::vector<std::vector< Matrix<double> > >
casadi_forward(const std::vector< Matrix<double> > &ex, const std::vector< Matrix<double> > &arg,
               const std::vector<std::vector< Matrix<double> > > &v,
               const Dict& opts = Dict()) {
  return forward(ex, arg, v, opts);
}

inline std::vector<std::vector< Matrix<double> > >
casadi_reverse(const std::vector< Matrix<double> > &ex, const std::vector< Matrix<double> > &arg,
               const std::vector<std::vector< Matrix<double> > > &v,
               const Dict& opts = Dict()) {
  return reverse(ex, arg, v, opts);
}

inline Matrix<double> casadi_substitute(const Matrix<double>& ex, const Matrix<double>& v, const Matrix<double>& vdef) {
  return substitute(ex, v, vdef);
}

inline std::vector< Matrix<double> > casadi_substitute(const std::vector< Matrix<double> >& ex,
                                         const std::vector< Matrix<double> >& v,
                                         const std::vector< Matrix<double> >& vdef) {
  return substitute(ex, v, vdef);
}

inline void casadi_substitute_inplace(const std::vector< Matrix<double> >& v,
                                      std::vector< Matrix<double> >& INOUT1,
                                      std::vector< Matrix<double> >& INOUT2,
                                      bool reverse=false) {
  return substitute_inplace(v, INOUT1, INOUT2, reverse);
}

inline void casadi_extract(const std::vector< Matrix<double> >& ex,
    std::vector< Matrix<double> >& OUTPUT1,
    std::vector< Matrix<double> >& OUTPUT2,
    std::vector< Matrix<double> >& OUTPUT3,
    const Dict& opts = Dict()) {
  OUTPUT1 = ex;
  extract(OUTPUT1, OUTPUT2, OUTPUT3, opts);
}

inline void casadi_shared(const std::vector< Matrix<double> >& ex,
                               std::vector< Matrix<double> >& OUTPUT1,
                               std::vector< Matrix<double> >& OUTPUT2,
                               std::vector< Matrix<double> >& OUTPUT3,
                               const std::string& v_prefix="v_",
                               const std::string& v_suffix="") {
  OUTPUT1 = ex;
  shared(OUTPUT1, OUTPUT2, OUTPUT3, v_prefix, v_suffix);
}

inline Matrix<double> casadi_blockcat(const std::vector< std::vector< Matrix<double> > > &v) {
 return blockcat(v);
}

/*@SWIG@*/
/*@SWIG:/local/swig/matlab/../casadi.i,3106,GENERIC_MATRIX_FUN@*/















































































































































































































































































inline std::vector<std::vector< Matrix<SXElem> > >
casadi_forward(const std::vector< Matrix<SXElem> > &ex, const std::vector< Matrix<SXElem> > &arg,
               const std::vector<std::vector< Matrix<SXElem> > > &v,
               const Dict& opts = Dict()) {
  return forward(ex, arg, v, opts);
}

inline std::vector<std::vector< Matrix<SXElem> > >
casadi_reverse(const std::vector< Matrix<SXElem> > &ex, const std::vector< Matrix<SXElem> > &arg,
               const std::vector<std::vector< Matrix<SXElem> > > &v,
               const Dict& opts = Dict()) {
  return reverse(ex, arg, v, opts);
}

inline Matrix<SXElem> casadi_substitute(const Matrix<SXElem>& ex, const Matrix<SXElem>& v, const Matrix<SXElem>& vdef) {
  return substitute(ex, v, vdef);
}

inline std::vector< Matrix<SXElem> > casadi_substitute(const std::vector< Matrix<SXElem> >& ex,
                                         const std::vector< Matrix<SXElem> >& v,
                                         const std::vector< Matrix<SXElem> >& vdef) {
  return substitute(ex, v, vdef);
}

inline void casadi_substitute_inplace(const std::vector< Matrix<SXElem> >& v,
                                      std::vector< Matrix<SXElem> >& INOUT1,
                                      std::vector< Matrix<SXElem> >& INOUT2,
                                      bool reverse=false) {
  return substitute_inplace(v, INOUT1, INOUT2, reverse);
}

inline void casadi_extract(const std::vector< Matrix<SXElem> >& ex,
    std::vector< Matrix<SXElem> >& OUTPUT1,
    std::vector< Matrix<SXElem> >& OUTPUT2,
    std::vector< Matrix<SXElem> >& OUTPUT3,
    const Dict& opts = Dict()) {
  OUTPUT1 = ex;
  extract(OUTPUT1, OUTPUT2, OUTPUT3, opts);
}

inline void casadi_shared(const std::vector< Matrix<SXElem> >& ex,
                               std::vector< Matrix<SXElem> >& OUTPUT1,
                               std::vector< Matrix<SXElem> >& OUTPUT2,
                               std::vector< Matrix<SXElem> >& OUTPUT3,
                               const std::string& v_prefix="v_",
                               const std::string& v_suffix="") {
  OUTPUT1 = ex;
  shared(OUTPUT1, OUTPUT2, OUTPUT3, v_prefix, v_suffix);
}

inline Matrix<SXElem> casadi_blockcat(const std::vector< std::vector< Matrix<SXElem> > > &v) {
 return blockcat(v);
}

/*@SWIG@*/
/*@SWIG@*/
    /*@SWIG:/local/swig/matlab/../casadi.i,3628,MATRIX_ALL@*/
/*@SWIG:/local/swig/matlab/../casadi.i,3502,MATRIX_FUN@*/



























































































































/*@SWIG@*/
/*@SWIG:/local/swig/matlab/../casadi.i,3502,MATRIX_FUN@*/



























































































































/*@SWIG@*/
/*@SWIG@*/
    /*@SWIG:/local/swig/matlab/../casadi.i,3707,MX_ALL@*/
/*@SWIG:/local/swig/matlab/../casadi.i,3633,MX_FUN@*/













inline std::vector< MX >
casadi_matrix_expand(const std::vector< MX >& e,
                     const std::vector< MX > &boundary = std::vector< MX >(),
                     const Dict& options = Dict()) {
  return matrix_expand(e, boundary, options);
}

inline MX casadi_matrix_expand(const MX& e,
                            const std::vector< MX > &boundary = std::vector< MX >(),
                            const Dict& options = Dict()) {
  return matrix_expand(e, boundary, options);
}

inline MX casadi_graph_substitute(const MX& ex, const std::vector< MX >& v,
                         const std::vector< MX > &vdef) {
  return graph_substitute(ex, v, vdef);
}

inline std::vector< MX >
casadi_graph_substitute(const std::vector< MX > &ex,
                 const std::vector< MX > &v,
                 const std::vector< MX > &vdef) {
  return graph_substitute(ex, v, vdef);
}
inline MX casadi_bspline(const MX& x,
        const DM& coeffs,
        const std::vector< std::vector<double> >& knots,
        const std::vector<casadi_int>& degree,
        casadi_int m,
        const Dict& opts = Dict()) {
  return bspline(x, coeffs, knots, degree, m, opts);
}
inline MX casadi_bspline(const MX& x,
        const MX& coeffs,
        const std::vector< std::vector<double> >& knots,
        const std::vector<casadi_int>& degree,
        casadi_int m,
        const Dict& opts = Dict()) {
  return bspline(x, coeffs, knots, degree, m, opts);
}
inline MX casadi_convexify(const MX& H,
        const Dict& opts = Dict()) {
  return convexify(H, opts);
}
inline MX casadi_stop_diff(const MX& expr, casadi_int order) {
  return stop_diff(expr, order);
}
inline MX casadi_stop_diff(const MX& expr, const MX& var, casadi_int order) {
  return stop_diff(expr, var, order);
}
inline MX casadi_no_hess(const MX& expr) {
  return no_hess(expr);
}
inline MX casadi_no_grad(const MX& expr) {
  return no_grad(expr);
}


/*@SWIG@*/
/*@SWIG@*/
  }



/* ---------------------------------------------------
 * C++ director class methods
 * --------------------------------------------------- */

#include "casadiMATLAB_wrap.h"

SwigDirector_Callback::SwigDirector_Callback(mxArray *self): casadi::Callback(), Swig::Director(self) {
  SWIG_DIRECTOR_RGTR((casadi::Callback *)this, this); 
  SWIG_Matlab_getSwigPtr(self);
}




SwigDirector_Callback::SwigDirector_Callback(mxArray *self, casadi::Callback const &obj): casadi::Callback(obj), Swig::Director(self) {
  SWIG_DIRECTOR_RGTR((casadi::Callback *)this, this); 
  SWIG_Matlab_getSwigPtr(self);
}




SwigDirector_Callback::~SwigDirector_Callback() {
}

void SwigDirector_Callback::init() {
  if (!swig_get_self()) {
    Swig::DirectorException::raise("'self' uninitialized, maybe you forgot to call Callback.__init__.");
  }
  mxArray* dispatch_in[1] = {
    swig_get_self()
  };
  mxArray* error = SWIG_Matlab_CallInterpEx(0, 0, 1, dispatch_in, "init");
  if (error != 0) {
    mexCallMATLAB(0, (mxArray **)NULL,1, &error, "throw");  if (error) {
      Swig::DirectorMethodException::raise("Error detected when calling 'Callback.init'");
    }
  }
}


void SwigDirector_Callback::finalize() {
  if (!swig_get_self()) {
    Swig::DirectorException::raise("'self' uninitialized, maybe you forgot to call Callback.__init__.");
  }
  mxArray* dispatch_in[1] = {
    swig_get_self()
  };
  mxArray* error = SWIG_Matlab_CallInterpEx(0, 0, 1, dispatch_in, "finalize");
  if (error != 0) {
    mexCallMATLAB(0, (mxArray **)NULL,1, &error, "throw");  if (error) {
      Swig::DirectorMethodException::raise("Error detected when calling 'Callback.finalize'");
    }
  }
}


std::vector< casadi::DM,std::allocator< casadi::DM > > SwigDirector_Callback::eval(std::vector< casadi::DM,std::allocator< casadi::DM > > const &arg) const {
  std::vector< casadi::DM,std::allocator< casadi::DM > > c_result;
  SwigVar_mxArray obj0;
  if(!(obj0 = casadi::from_ptr(&arg))) Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(SWIG_TypeError)), "in output value of type '""For director inputs, failed to convert input to " "{" "DM" "}" ".""'");
  if (!swig_get_self()) {
    Swig::DirectorException::raise("'self' uninitialized, maybe you forgot to call Callback.__init__.");
  }
  mxArray* dispatch_in[2] = {
    swig_get_self(),(mxArray *)obj0
  };
  mxArray* dispatch_out[1];
  mxArray* error = SWIG_Matlab_CallInterpEx(1, dispatch_out, 2, dispatch_in, "eval");
  mxArray* result = dispatch_out[0];
  if (error != 0) {
    mexCallMATLAB(0, (mxArray **)NULL,1, &error, "throw");  if (error) {
      Swig::DirectorMethodException::raise("Error detected when calling 'Callback.eval'");
    }
  }
  if (!casadi::to_val(result, &c_result)) {
    Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(SWIG_TypeError)), "in output value of type '""std::vector< casadi::DM,std::allocator< casadi::DM > >""'");
  }
  return (std::vector< casadi::DM,std::allocator< casadi::DM > >) c_result;
}


int SwigDirector_Callback::eval_buffer(double const **arg, std::vector< casadi_int,std::allocator< casadi_int > > const &sizes_arg, double **res, std::vector< casadi_int,std::allocator< casadi_int > > const &sizes_res) const {
  int c_result;
  SwigVar_mxArray obj0;
  obj0 = SWIG_NewPointerObj(SWIG_as_voidptr(arg), SWIGTYPE_p_p_double,  0 );
  SwigVar_mxArray obj1;
  if(!(obj1 = casadi::from_ptr(&sizes_arg))) Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(SWIG_TypeError)), "in output value of type '""For director inputs, failed to convert input to " "[" "int" "]" ".""'");
  SwigVar_mxArray obj2;
  obj2 = SWIG_NewPointerObj(SWIG_as_voidptr(res), SWIGTYPE_p_p_double,  0 );
  SwigVar_mxArray obj3;
  if(!(obj3 = casadi::from_ptr(&sizes_res))) Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(SWIG_TypeError)), "in output value of type '""For director inputs, failed to convert input to " "[" "int" "]" ".""'");
  if (!swig_get_self()) {
    Swig::DirectorException::raise("'self' uninitialized, maybe you forgot to call Callback.__init__.");
  }
  mxArray* dispatch_in[5] = {
    swig_get_self(),(mxArray *)obj0,(mxArray *)obj1,(mxArray *)obj2,(mxArray *)obj3
  };
  mxArray* dispatch_out[1];
  mxArray* error = SWIG_Matlab_CallInterpEx(1, dispatch_out, 5, dispatch_in, "eval_buffer");
  mxArray* result = dispatch_out[0];
  if (error != 0) {
    mexCallMATLAB(0, (mxArray **)NULL,1, &error, "throw");  if (error) {
      Swig::DirectorMethodException::raise("Error detected when calling 'Callback.eval_buffer'");
    }
  }
  int swig_val;
  int swig_res = SWIG_AsVal_int(result, &swig_val);
  if (!SWIG_IsOK(swig_res)) {
    Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(swig_res)), "in output value of type '""int""'");
  }
  c_result = static_cast< int >(swig_val);
  return (int) c_result;
}


bool SwigDirector_Callback::has_eval_buffer() const {
  bool c_result;
  if (!swig_get_self()) {
    Swig::DirectorException::raise("'self' uninitialized, maybe you forgot to call Callback.__init__.");
  }
  mxArray* dispatch_in[1] = {
    swig_get_self()
  };
  mxArray* dispatch_out[1];
  mxArray* error = SWIG_Matlab_CallInterpEx(1, dispatch_out, 1, dispatch_in, "has_eval_buffer");
  mxArray* result = dispatch_out[0];
  if (error != 0) {
    mexCallMATLAB(0, (mxArray **)NULL,1, &error, "throw");  if (error) {
      Swig::DirectorMethodException::raise("Error detected when calling 'Callback.has_eval_buffer'");
    }
  }
  if (!casadi::to_val(result, &c_result)) {
    Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(SWIG_TypeError)), "in output value of type '""bool""'");
  }
  return (bool) c_result;
}


casadi_int SwigDirector_Callback::get_n_in() {
  casadi_int c_result;
  if (!swig_get_self()) {
    Swig::DirectorException::raise("'self' uninitialized, maybe you forgot to call Callback.__init__.");
  }
  mxArray* dispatch_in[1] = {
    swig_get_self()
  };
  mxArray* dispatch_out[1];
  mxArray* error = SWIG_Matlab_CallInterpEx(1, dispatch_out, 1, dispatch_in, "get_n_in");
  mxArray* result = dispatch_out[0];
  if (error != 0) {
    mexCallMATLAB(0, (mxArray **)NULL,1, &error, "throw");  if (error) {
      Swig::DirectorMethodException::raise("Error detected when calling 'Callback.get_n_in'");
    }
  }
  if (!casadi::to_val(result, &c_result)) {
    Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(SWIG_TypeError)), "in output value of type '""casadi_int""'");
  }
  return (casadi_int) c_result;
}


casadi_int SwigDirector_Callback::get_n_out() {
  casadi_int c_result;
  if (!swig_get_self()) {
    Swig::DirectorException::raise("'self' uninitialized, maybe you forgot to call Callback.__init__.");
  }
  mxArray* dispatch_in[1] = {
    swig_get_self()
  };
  mxArray* dispatch_out[1];
  mxArray* error = SWIG_Matlab_CallInterpEx(1, dispatch_out, 1, dispatch_in, "get_n_out");
  mxArray* result = dispatch_out[0];
  if (error != 0) {
    mexCallMATLAB(0, (mxArray **)NULL,1, &error, "throw");  if (error) {
      Swig::DirectorMethodException::raise("Error detected when calling 'Callback.get_n_out'");
    }
  }
  if (!casadi::to_val(result, &c_result)) {
    Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(SWIG_TypeError)), "in output value of type '""casadi_int""'");
  }
  return (casadi_int) c_result;
}


casadi::Sparsity SwigDirector_Callback::get_sparsity_in(casadi_int i) {
  casadi::Sparsity c_result;
  SwigVar_mxArray obj0;
  if(!(obj0 = casadi::from_ref(i))) Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(SWIG_TypeError)), "in output value of type '""For director inputs, failed to convert input to " "int" ".""'");
  if (!swig_get_self()) {
    Swig::DirectorException::raise("'self' uninitialized, maybe you forgot to call Callback.__init__.");
  }
  mxArray* dispatch_in[2] = {
    swig_get_self(),(mxArray *)obj0
  };
  mxArray* dispatch_out[1];
  mxArray* error = SWIG_Matlab_CallInterpEx(1, dispatch_out, 2, dispatch_in, "get_sparsity_in");
  mxArray* result = dispatch_out[0];
  if (error != 0) {
    mexCallMATLAB(0, (mxArray **)NULL,1, &error, "throw");  if (error) {
      Swig::DirectorMethodException::raise("Error detected when calling 'Callback.get_sparsity_in'");
    }
  }
  if (!casadi::to_val(result, &c_result)) {
    Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(SWIG_TypeError)), "in output value of type '""casadi::Sparsity""'");
  }
  return (casadi::Sparsity) c_result;
}


casadi::Sparsity SwigDirector_Callback::get_sparsity_out(casadi_int i) {
  casadi::Sparsity c_result;
  SwigVar_mxArray obj0;
  if(!(obj0 = casadi::from_ref(i))) Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(SWIG_TypeError)), "in output value of type '""For director inputs, failed to convert input to " "int" ".""'");
  if (!swig_get_self()) {
    Swig::DirectorException::raise("'self' uninitialized, maybe you forgot to call Callback.__init__.");
  }
  mxArray* dispatch_in[2] = {
    swig_get_self(),(mxArray *)obj0
  };
  mxArray* dispatch_out[1];
  mxArray* error = SWIG_Matlab_CallInterpEx(1, dispatch_out, 2, dispatch_in, "get_sparsity_out");
  mxArray* result = dispatch_out[0];
  if (error != 0) {
    mexCallMATLAB(0, (mxArray **)NULL,1, &error, "throw");  if (error) {
      Swig::DirectorMethodException::raise("Error detected when calling 'Callback.get_sparsity_out'");
    }
  }
  if (!casadi::to_val(result, &c_result)) {
    Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(SWIG_TypeError)), "in output value of type '""casadi::Sparsity""'");
  }
  return (casadi::Sparsity) c_result;
}


std::string SwigDirector_Callback::get_name_in(casadi_int i) {
  std::string c_result;
  SwigVar_mxArray obj0;
  if(!(obj0 = casadi::from_ref(i))) Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(SWIG_TypeError)), "in output value of type '""For director inputs, failed to convert input to " "int" ".""'");
  if (!swig_get_self()) {
    Swig::DirectorException::raise("'self' uninitialized, maybe you forgot to call Callback.__init__.");
  }
  mxArray* dispatch_in[2] = {
    swig_get_self(),(mxArray *)obj0
  };
  mxArray* dispatch_out[1];
  mxArray* error = SWIG_Matlab_CallInterpEx(1, dispatch_out, 2, dispatch_in, "get_name_in");
  mxArray* result = dispatch_out[0];
  if (error != 0) {
    mexCallMATLAB(0, (mxArray **)NULL,1, &error, "throw");  if (error) {
      Swig::DirectorMethodException::raise("Error detected when calling 'Callback.get_name_in'");
    }
  }
  if (!casadi::to_val(result, &c_result)) {
    Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(SWIG_TypeError)), "in output value of type '""std::string""'");
  }
  return (std::string) c_result;
}


std::string SwigDirector_Callback::get_name_out(casadi_int i) {
  std::string c_result;
  SwigVar_mxArray obj0;
  if(!(obj0 = casadi::from_ref(i))) Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(SWIG_TypeError)), "in output value of type '""For director inputs, failed to convert input to " "int" ".""'");
  if (!swig_get_self()) {
    Swig::DirectorException::raise("'self' uninitialized, maybe you forgot to call Callback.__init__.");
  }
  mxArray* dispatch_in[2] = {
    swig_get_self(),(mxArray *)obj0
  };
  mxArray* dispatch_out[1];
  mxArray* error = SWIG_Matlab_CallInterpEx(1, dispatch_out, 2, dispatch_in, "get_name_out");
  mxArray* result = dispatch_out[0];
  if (error != 0) {
    mexCallMATLAB(0, (mxArray **)NULL,1, &error, "throw");  if (error) {
      Swig::DirectorMethodException::raise("Error detected when calling 'Callback.get_name_out'");
    }
  }
  if (!casadi::to_val(result, &c_result)) {
    Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(SWIG_TypeError)), "in output value of type '""std::string""'");
  }
  return (std::string) c_result;
}


bool SwigDirector_Callback::uses_output() const {
  bool c_result;
  if (!swig_get_self()) {
    Swig::DirectorException::raise("'self' uninitialized, maybe you forgot to call Callback.__init__.");
  }
  mxArray* dispatch_in[1] = {
    swig_get_self()
  };
  mxArray* dispatch_out[1];
  mxArray* error = SWIG_Matlab_CallInterpEx(1, dispatch_out, 1, dispatch_in, "uses_output");
  mxArray* result = dispatch_out[0];
  if (error != 0) {
    mexCallMATLAB(0, (mxArray **)NULL,1, &error, "throw");  if (error) {
      Swig::DirectorMethodException::raise("Error detected when calling 'Callback.uses_output'");
    }
  }
  if (!casadi::to_val(result, &c_result)) {
    Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(SWIG_TypeError)), "in output value of type '""bool""'");
  }
  return (bool) c_result;
}


bool SwigDirector_Callback::has_jacobian() const {
  bool c_result;
  if (!swig_get_self()) {
    Swig::DirectorException::raise("'self' uninitialized, maybe you forgot to call Callback.__init__.");
  }
  mxArray* dispatch_in[1] = {
    swig_get_self()
  };
  mxArray* dispatch_out[1];
  mxArray* error = SWIG_Matlab_CallInterpEx(1, dispatch_out, 1, dispatch_in, "has_jacobian");
  mxArray* result = dispatch_out[0];
  if (error != 0) {
    mexCallMATLAB(0, (mxArray **)NULL,1, &error, "throw");  if (error) {
      Swig::DirectorMethodException::raise("Error detected when calling 'Callback.has_jacobian'");
    }
  }
  if (!casadi::to_val(result, &c_result)) {
    Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(SWIG_TypeError)), "in output value of type '""bool""'");
  }
  return (bool) c_result;
}


casadi::Function SwigDirector_Callback::get_jacobian(std::string const &name, std::vector< std::string,std::allocator< std::string > > const &inames, std::vector< std::string,std::allocator< std::string > > const &onames, casadi::Dict const &opts) const {
  casadi::Function c_result;
  SwigVar_mxArray obj0;
  if(!(obj0 = casadi::from_ptr(&name))) Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(SWIG_TypeError)), "in output value of type '""For director inputs, failed to convert input to " "char" ".""'");
  SwigVar_mxArray obj1;
  if(!(obj1 = casadi::from_ptr(&inames))) Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(SWIG_TypeError)), "in output value of type '""For director inputs, failed to convert input to " "{" "char" "}" ".""'");
  SwigVar_mxArray obj2;
  if(!(obj2 = casadi::from_ptr(&onames))) Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(SWIG_TypeError)), "in output value of type '""For director inputs, failed to convert input to " "{" "char" "}" ".""'");
  SwigVar_mxArray obj3;
  if(!(obj3 = casadi::from_ptr(&opts))) Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(SWIG_TypeError)), "in output value of type '""For director inputs, failed to convert input to " "struct" ".""'");
  if (!swig_get_self()) {
    Swig::DirectorException::raise("'self' uninitialized, maybe you forgot to call Callback.__init__.");
  }
  mxArray* dispatch_in[5] = {
    swig_get_self(),(mxArray *)obj0,(mxArray *)obj1,(mxArray *)obj2,(mxArray *)obj3
  };
  mxArray* dispatch_out[1];
  mxArray* error = SWIG_Matlab_CallInterpEx(1, dispatch_out, 5, dispatch_in, "get_jacobian");
  mxArray* result = dispatch_out[0];
  if (error != 0) {
    mexCallMATLAB(0, (mxArray **)NULL,1, &error, "throw");  if (error) {
      Swig::DirectorMethodException::raise("Error detected when calling 'Callback.get_jacobian'");
    }
  }
  if (!casadi::to_val(result, &c_result)) {
    Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(SWIG_TypeError)), "in output value of type '""casadi::Function""'");
  }
  return (casadi::Function) c_result;
}


bool SwigDirector_Callback::has_forward(casadi_int nfwd) const {
  bool c_result;
  SwigVar_mxArray obj0;
  if(!(obj0 = casadi::from_ref(nfwd))) Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(SWIG_TypeError)), "in output value of type '""For director inputs, failed to convert input to " "int" ".""'");
  if (!swig_get_self()) {
    Swig::DirectorException::raise("'self' uninitialized, maybe you forgot to call Callback.__init__.");
  }
  mxArray* dispatch_in[2] = {
    swig_get_self(),(mxArray *)obj0
  };
  mxArray* dispatch_out[1];
  mxArray* error = SWIG_Matlab_CallInterpEx(1, dispatch_out, 2, dispatch_in, "has_forward");
  mxArray* result = dispatch_out[0];
  if (error != 0) {
    mexCallMATLAB(0, (mxArray **)NULL,1, &error, "throw");  if (error) {
      Swig::DirectorMethodException::raise("Error detected when calling 'Callback.has_forward'");
    }
  }
  if (!casadi::to_val(result, &c_result)) {
    Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(SWIG_TypeError)), "in output value of type '""bool""'");
  }
  return (bool) c_result;
}


casadi::Function SwigDirector_Callback::get_forward(casadi_int nfwd, std::string const &name, std::vector< std::string,std::allocator< std::string > > const &inames, std::vector< std::string,std::allocator< std::string > > const &onames, casadi::Dict const &opts) const {
  casadi::Function c_result;
  SwigVar_mxArray obj0;
  if(!(obj0 = casadi::from_ref(nfwd))) Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(SWIG_TypeError)), "in output value of type '""For director inputs, failed to convert input to " "int" ".""'");
  SwigVar_mxArray obj1;
  if(!(obj1 = casadi::from_ptr(&name))) Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(SWIG_TypeError)), "in output value of type '""For director inputs, failed to convert input to " "char" ".""'");
  SwigVar_mxArray obj2;
  if(!(obj2 = casadi::from_ptr(&inames))) Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(SWIG_TypeError)), "in output value of type '""For director inputs, failed to convert input to " "{" "char" "}" ".""'");
  SwigVar_mxArray obj3;
  if(!(obj3 = casadi::from_ptr(&onames))) Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(SWIG_TypeError)), "in output value of type '""For director inputs, failed to convert input to " "{" "char" "}" ".""'");
  SwigVar_mxArray obj4;
  if(!(obj4 = casadi::from_ptr(&opts))) Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(SWIG_TypeError)), "in output value of type '""For director inputs, failed to convert input to " "struct" ".""'");
  if (!swig_get_self()) {
    Swig::DirectorException::raise("'self' uninitialized, maybe you forgot to call Callback.__init__.");
  }
  mxArray* dispatch_in[6] = {
    swig_get_self(),(mxArray *)obj0,(mxArray *)obj1,(mxArray *)obj2,(mxArray *)obj3,(mxArray *)obj4
  };
  mxArray* dispatch_out[1];
  mxArray* error = SWIG_Matlab_CallInterpEx(1, dispatch_out, 6, dispatch_in, "get_forward");
  mxArray* result = dispatch_out[0];
  if (error != 0) {
    mexCallMATLAB(0, (mxArray **)NULL,1, &error, "throw");  if (error) {
      Swig::DirectorMethodException::raise("Error detected when calling 'Callback.get_forward'");
    }
  }
  if (!casadi::to_val(result, &c_result)) {
    Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(SWIG_TypeError)), "in output value of type '""casadi::Function""'");
  }
  return (casadi::Function) c_result;
}


bool SwigDirector_Callback::has_reverse(casadi_int nadj) const {
  bool c_result;
  SwigVar_mxArray obj0;
  if(!(obj0 = casadi::from_ref(nadj))) Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(SWIG_TypeError)), "in output value of type '""For director inputs, failed to convert input to " "int" ".""'");
  if (!swig_get_self()) {
    Swig::DirectorException::raise("'self' uninitialized, maybe you forgot to call Callback.__init__.");
  }
  mxArray* dispatch_in[2] = {
    swig_get_self(),(mxArray *)obj0
  };
  mxArray* dispatch_out[1];
  mxArray* error = SWIG_Matlab_CallInterpEx(1, dispatch_out, 2, dispatch_in, "has_reverse");
  mxArray* result = dispatch_out[0];
  if (error != 0) {
    mexCallMATLAB(0, (mxArray **)NULL,1, &error, "throw");  if (error) {
      Swig::DirectorMethodException::raise("Error detected when calling 'Callback.has_reverse'");
    }
  }
  if (!casadi::to_val(result, &c_result)) {
    Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(SWIG_TypeError)), "in output value of type '""bool""'");
  }
  return (bool) c_result;
}


casadi::Function SwigDirector_Callback::get_reverse(casadi_int nadj, std::string const &name, std::vector< std::string,std::allocator< std::string > > const &inames, std::vector< std::string,std::allocator< std::string > > const &onames, casadi::Dict const &opts) const {
  casadi::Function c_result;
  SwigVar_mxArray obj0;
  if(!(obj0 = casadi::from_ref(nadj))) Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(SWIG_TypeError)), "in output value of type '""For director inputs, failed to convert input to " "int" ".""'");
  SwigVar_mxArray obj1;
  if(!(obj1 = casadi::from_ptr(&name))) Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(SWIG_TypeError)), "in output value of type '""For director inputs, failed to convert input to " "char" ".""'");
  SwigVar_mxArray obj2;
  if(!(obj2 = casadi::from_ptr(&inames))) Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(SWIG_TypeError)), "in output value of type '""For director inputs, failed to convert input to " "{" "char" "}" ".""'");
  SwigVar_mxArray obj3;
  if(!(obj3 = casadi::from_ptr(&onames))) Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(SWIG_TypeError)), "in output value of type '""For director inputs, failed to convert input to " "{" "char" "}" ".""'");
  SwigVar_mxArray obj4;
  if(!(obj4 = casadi::from_ptr(&opts))) Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(SWIG_TypeError)), "in output value of type '""For director inputs, failed to convert input to " "struct" ".""'");
  if (!swig_get_self()) {
    Swig::DirectorException::raise("'self' uninitialized, maybe you forgot to call Callback.__init__.");
  }
  mxArray* dispatch_in[6] = {
    swig_get_self(),(mxArray *)obj0,(mxArray *)obj1,(mxArray *)obj2,(mxArray *)obj3,(mxArray *)obj4
  };
  mxArray* dispatch_out[1];
  mxArray* error = SWIG_Matlab_CallInterpEx(1, dispatch_out, 6, dispatch_in, "get_reverse");
  mxArray* result = dispatch_out[0];
  if (error != 0) {
    mexCallMATLAB(0, (mxArray **)NULL,1, &error, "throw");  if (error) {
      Swig::DirectorMethodException::raise("Error detected when calling 'Callback.get_reverse'");
    }
  }
  if (!casadi::to_val(result, &c_result)) {
    Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(SWIG_TypeError)), "in output value of type '""casadi::Function""'");
  }
  return (casadi::Function) c_result;
}


bool SwigDirector_Callback::has_jac_sparsity(casadi_int oind, casadi_int iind) const {
  bool c_result;
  SwigVar_mxArray obj0;
  if(!(obj0 = casadi::from_ref(oind))) Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(SWIG_TypeError)), "in output value of type '""For director inputs, failed to convert input to " "int" ".""'");
  SwigVar_mxArray obj1;
  if(!(obj1 = casadi::from_ref(iind))) Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(SWIG_TypeError)), "in output value of type '""For director inputs, failed to convert input to " "int" ".""'");
  if (!swig_get_self()) {
    Swig::DirectorException::raise("'self' uninitialized, maybe you forgot to call Callback.__init__.");
  }
  mxArray* dispatch_in[3] = {
    swig_get_self(),(mxArray *)obj0,(mxArray *)obj1
  };
  mxArray* dispatch_out[1];
  mxArray* error = SWIG_Matlab_CallInterpEx(1, dispatch_out, 3, dispatch_in, "has_jac_sparsity");
  mxArray* result = dispatch_out[0];
  if (error != 0) {
    mexCallMATLAB(0, (mxArray **)NULL,1, &error, "throw");  if (error) {
      Swig::DirectorMethodException::raise("Error detected when calling 'Callback.has_jac_sparsity'");
    }
  }
  if (!casadi::to_val(result, &c_result)) {
    Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(SWIG_TypeError)), "in output value of type '""bool""'");
  }
  return (bool) c_result;
}


casadi::Sparsity SwigDirector_Callback::get_jac_sparsity(casadi_int oind, casadi_int iind, bool symmetric) const {
  casadi::Sparsity c_result;
  SwigVar_mxArray obj0;
  if(!(obj0 = casadi::from_ref(oind))) Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(SWIG_TypeError)), "in output value of type '""For director inputs, failed to convert input to " "int" ".""'");
  SwigVar_mxArray obj1;
  if(!(obj1 = casadi::from_ref(iind))) Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(SWIG_TypeError)), "in output value of type '""For director inputs, failed to convert input to " "int" ".""'");
  SwigVar_mxArray obj2;
  if(!(obj2 = casadi::from_ref(symmetric))) Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(SWIG_TypeError)), "in output value of type '""For director inputs, failed to convert input to " "bool" ".""'");
  if (!swig_get_self()) {
    Swig::DirectorException::raise("'self' uninitialized, maybe you forgot to call Callback.__init__.");
  }
  mxArray* dispatch_in[4] = {
    swig_get_self(),(mxArray *)obj0,(mxArray *)obj1,(mxArray *)obj2
  };
  mxArray* dispatch_out[1];
  mxArray* error = SWIG_Matlab_CallInterpEx(1, dispatch_out, 4, dispatch_in, "get_jac_sparsity");
  mxArray* result = dispatch_out[0];
  if (error != 0) {
    mexCallMATLAB(0, (mxArray **)NULL,1, &error, "throw");  if (error) {
      Swig::DirectorMethodException::raise("Error detected when calling 'Callback.get_jac_sparsity'");
    }
  }
  if (!casadi::to_val(result, &c_result)) {
    Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(SWIG_TypeError)), "in output value of type '""casadi::Sparsity""'");
  }
  return (casadi::Sparsity) c_result;
}


SwigDirector_OptiCallback::SwigDirector_OptiCallback(mxArray *self): casadi::OptiCallback(), Swig::Director(self) {
  SWIG_DIRECTOR_RGTR((casadi::OptiCallback *)this, this); 
  SWIG_Matlab_getSwigPtr(self);
}




SwigDirector_OptiCallback::SwigDirector_OptiCallback(mxArray *self, casadi::OptiCallback const &obj): casadi::OptiCallback(obj), Swig::Director(self) {
  SWIG_DIRECTOR_RGTR((casadi::OptiCallback *)this, this); 
  SWIG_Matlab_getSwigPtr(self);
}




void SwigDirector_OptiCallback::call(casadi_int i) {
  SwigVar_mxArray obj0;
  if(!(obj0 = casadi::from_ref(i))) Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(SWIG_ArgError(SWIG_TypeError)), "in output value of type '""For director inputs, failed to convert input to " "int" ".""'");
  if (!swig_get_self()) {
    Swig::DirectorException::raise("'self' uninitialized, maybe you forgot to call OptiCallback.__init__.");
  }
  mxArray* dispatch_in[2] = {
    swig_get_self(),(mxArray *)obj0
  };
  mxArray* error = SWIG_Matlab_CallInterpEx(0, 0, 2, dispatch_in, "call");
  if (error != 0) {
    mexCallMATLAB(0, (mxArray **)NULL,1, &error, "throw");  if (error) {
      Swig::DirectorMethodException::raise("Error detected when calling 'OptiCallback.call'");
    }
  }
}


SwigDirector_OptiCallback::~SwigDirector_OptiCallback() {
}

int _wrap_delete_MatlabSwigIterator(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  swig::MatlabSwigIterator *arg1 = (swig::MatlabSwigIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  int is_owned;
  if (!SWIG_check_num_args("delete_MatlabSwigIterator",argc,1,1,0)) {
    SWIG_fail;
  }
  is_owned = SWIG_Matlab_isOwned(argv[0]);
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_swig__MatlabSwigIterator, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_MatlabSwigIterator" "', argument " "1"" of type '" "swig::MatlabSwigIterator *""'"); 
  }
  arg1 = reinterpret_cast< swig::MatlabSwigIterator * >(argp1);
  if (is_owned) {
    delete arg1;
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'delete_MatlabSwigIterator'."
      "  Prototype:\n"
      "    MATLABSWIGITERATOR(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatlabSwigIterator_value(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  swig::MatlabSwigIterator *arg1 = (swig::MatlabSwigIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  mxArray *result = 0 ;
  
  if (!SWIG_check_num_args("MatlabSwigIterator_value",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_swig__MatlabSwigIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MatlabSwigIterator_value" "', argument " "1"" of type '" "swig::MatlabSwigIterator const *""'"); 
  }
  arg1 = reinterpret_cast< swig::MatlabSwigIterator * >(argp1);
  try {
    result = (mxArray *)((swig::MatlabSwigIterator const *)arg1)->value();
  }
  catch(swig::stop_iteration &_e) {
    {
      SWIG_Error(SWIG_RuntimeError,"stop_iteration exception"); /* KT TODO */
      SWIG_fail;
    }
  }
  
  _out = result;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatlabSwigIterator_value'."
      "  Prototype:\n"
      "    VALUE(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatlabSwigIterator_incr(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  swig::MatlabSwigIterator *arg1 = (swig::MatlabSwigIterator *) 0 ;
  size_t arg2 = (size_t) 1 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  mxArray * _out;
  swig::MatlabSwigIterator *result = 0 ;
  
  if (!SWIG_check_num_args("MatlabSwigIterator_incr",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_swig__MatlabSwigIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MatlabSwigIterator_incr" "', argument " "1"" of type '" "swig::MatlabSwigIterator *""'"); 
  }
  arg1 = reinterpret_cast< swig::MatlabSwigIterator * >(argp1);
  if (1<argc) {
    ecode2 = SWIG_AsVal_size_t(argv[1], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MatlabSwigIterator_incr" "', argument " "2"" of type '" "size_t""'");
    } 
    arg2 = static_cast< size_t >(val2);
  }
  try {
    result = (swig::MatlabSwigIterator *)(arg1)->incr(arg2);
  }
  catch(swig::stop_iteration &_e) {
    {
      SWIG_Error(SWIG_RuntimeError,"stop_iteration exception"); /* KT TODO */
      SWIG_fail;
    }
  }
  
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__MatlabSwigIterator, 0 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatlabSwigIterator_incr'."
      "  Prototype:\n"
      "    INCR(self,size_t)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatlabSwigIterator_decr(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  swig::MatlabSwigIterator *arg1 = (swig::MatlabSwigIterator *) 0 ;
  size_t arg2 = (size_t) 1 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  mxArray * _out;
  swig::MatlabSwigIterator *result = 0 ;
  
  if (!SWIG_check_num_args("MatlabSwigIterator_decr",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_swig__MatlabSwigIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MatlabSwigIterator_decr" "', argument " "1"" of type '" "swig::MatlabSwigIterator *""'"); 
  }
  arg1 = reinterpret_cast< swig::MatlabSwigIterator * >(argp1);
  if (1<argc) {
    ecode2 = SWIG_AsVal_size_t(argv[1], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MatlabSwigIterator_decr" "', argument " "2"" of type '" "size_t""'");
    } 
    arg2 = static_cast< size_t >(val2);
  }
  try {
    result = (swig::MatlabSwigIterator *)(arg1)->decr(arg2);
  }
  catch(swig::stop_iteration &_e) {
    {
      SWIG_Error(SWIG_RuntimeError,"stop_iteration exception"); /* KT TODO */
      SWIG_fail;
    }
  }
  
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__MatlabSwigIterator, 0 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatlabSwigIterator_decr'."
      "  Prototype:\n"
      "    DECR(self,size_t)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatlabSwigIterator_distance(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  swig::MatlabSwigIterator *arg1 = (swig::MatlabSwigIterator *) 0 ;
  swig::MatlabSwigIterator *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  mxArray * _out;
  ptrdiff_t result;
  
  if (!SWIG_check_num_args("MatlabSwigIterator_distance",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_swig__MatlabSwigIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MatlabSwigIterator_distance" "', argument " "1"" of type '" "swig::MatlabSwigIterator const *""'"); 
  }
  arg1 = reinterpret_cast< swig::MatlabSwigIterator * >(argp1);
  res2 = SWIG_ConvertPtr(argv[1], &argp2, SWIGTYPE_p_swig__MatlabSwigIterator,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "MatlabSwigIterator_distance" "', argument " "2"" of type '" "swig::MatlabSwigIterator const &""'"); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "MatlabSwigIterator_distance" "', argument " "2"" of type '" "swig::MatlabSwigIterator const &""'"); 
  }
  arg2 = reinterpret_cast< swig::MatlabSwigIterator * >(argp2);
  try {
    result = ((swig::MatlabSwigIterator const *)arg1)->distance((swig::MatlabSwigIterator const &)*arg2);
  }
  catch(std::invalid_argument &_e) {
    SWIG_Matlab_ErrorId("SWIG:RuntimeError", "C++ side threw an exception of type " "std::invalid_argument"); SWIG_fail;
  }
  
  _out = SWIG_From_ptrdiff_t(static_cast< ptrdiff_t >(result));
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatlabSwigIterator_distance'."
      "  Prototype:\n"
      "    DISTANCE(self,MatlabSwigIterator)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatlabSwigIterator_equal(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  swig::MatlabSwigIterator *arg1 = (swig::MatlabSwigIterator *) 0 ;
  swig::MatlabSwigIterator *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("MatlabSwigIterator_equal",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_swig__MatlabSwigIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MatlabSwigIterator_equal" "', argument " "1"" of type '" "swig::MatlabSwigIterator const *""'"); 
  }
  arg1 = reinterpret_cast< swig::MatlabSwigIterator * >(argp1);
  res2 = SWIG_ConvertPtr(argv[1], &argp2, SWIGTYPE_p_swig__MatlabSwigIterator,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "MatlabSwigIterator_equal" "', argument " "2"" of type '" "swig::MatlabSwigIterator const &""'"); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "MatlabSwigIterator_equal" "', argument " "2"" of type '" "swig::MatlabSwigIterator const &""'"); 
  }
  arg2 = reinterpret_cast< swig::MatlabSwigIterator * >(argp2);
  try {
    result = (bool)((swig::MatlabSwigIterator const *)arg1)->equal((swig::MatlabSwigIterator const &)*arg2);
  }
  catch(std::invalid_argument &_e) {
    SWIG_Matlab_ErrorId("SWIG:RuntimeError", "C++ side threw an exception of type " "std::invalid_argument"); SWIG_fail;
  }
  
  _out = SWIG_From_bool(static_cast< bool >(result));
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatlabSwigIterator_equal'."
      "  Prototype:\n"
      "    EQUAL(self,MatlabSwigIterator)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatlabSwigIterator_copy(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  swig::MatlabSwigIterator *arg1 = (swig::MatlabSwigIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  swig::MatlabSwigIterator *result = 0 ;
  
  if (!SWIG_check_num_args("MatlabSwigIterator_copy",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_swig__MatlabSwigIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MatlabSwigIterator_copy" "', argument " "1"" of type '" "swig::MatlabSwigIterator const *""'"); 
  }
  arg1 = reinterpret_cast< swig::MatlabSwigIterator * >(argp1);
  result = (swig::MatlabSwigIterator *)((swig::MatlabSwigIterator const *)arg1)->copy();
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__MatlabSwigIterator, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatlabSwigIterator_copy'."
      "  Prototype:\n"
      "    COPY(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatlabSwigIterator_next(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  swig::MatlabSwigIterator *arg1 = (swig::MatlabSwigIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  mxArray *result = 0 ;
  
  if (!SWIG_check_num_args("MatlabSwigIterator_next",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_swig__MatlabSwigIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MatlabSwigIterator_next" "', argument " "1"" of type '" "swig::MatlabSwigIterator *""'"); 
  }
  arg1 = reinterpret_cast< swig::MatlabSwigIterator * >(argp1);
  try {
    result = (mxArray *)(arg1)->next();
  }
  catch(swig::stop_iteration &_e) {
    {
      SWIG_Error(SWIG_RuntimeError,"stop_iteration exception"); /* KT TODO */
      SWIG_fail;
    }
  }
  
  _out = result;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatlabSwigIterator_next'."
      "  Prototype:\n"
      "    NEXT(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatlabSwigIterator_previous(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  swig::MatlabSwigIterator *arg1 = (swig::MatlabSwigIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  mxArray *result = 0 ;
  
  if (!SWIG_check_num_args("MatlabSwigIterator_previous",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_swig__MatlabSwigIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MatlabSwigIterator_previous" "', argument " "1"" of type '" "swig::MatlabSwigIterator *""'"); 
  }
  arg1 = reinterpret_cast< swig::MatlabSwigIterator * >(argp1);
  try {
    result = (mxArray *)(arg1)->previous();
  }
  catch(swig::stop_iteration &_e) {
    {
      SWIG_Error(SWIG_RuntimeError,"stop_iteration exception"); /* KT TODO */
      SWIG_fail;
    }
  }
  
  _out = result;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatlabSwigIterator_previous'."
      "  Prototype:\n"
      "    PREVIOUS(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatlabSwigIterator_advance(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  swig::MatlabSwigIterator *arg1 = (swig::MatlabSwigIterator *) 0 ;
  ptrdiff_t arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  ptrdiff_t val2 ;
  int ecode2 = 0 ;
  mxArray * _out;
  swig::MatlabSwigIterator *result = 0 ;
  
  if (!SWIG_check_num_args("MatlabSwigIterator_advance",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_swig__MatlabSwigIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MatlabSwigIterator_advance" "', argument " "1"" of type '" "swig::MatlabSwigIterator *""'"); 
  }
  arg1 = reinterpret_cast< swig::MatlabSwigIterator * >(argp1);
  ecode2 = SWIG_AsVal_ptrdiff_t(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MatlabSwigIterator_advance" "', argument " "2"" of type '" "ptrdiff_t""'");
  } 
  arg2 = static_cast< ptrdiff_t >(val2);
  try {
    result = (swig::MatlabSwigIterator *)(arg1)->advance(arg2);
  }
  catch(swig::stop_iteration &_e) {
    {
      SWIG_Error(SWIG_RuntimeError,"stop_iteration exception"); /* KT TODO */
      SWIG_fail;
    }
  }
  
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__MatlabSwigIterator, 0 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatlabSwigIterator_advance'."
      "  Prototype:\n"
      "    ADVANCE(self,ptrdiff_t)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatlabSwigIterator_eq(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  swig::MatlabSwigIterator *arg1 = (swig::MatlabSwigIterator *) 0 ;
  swig::MatlabSwigIterator *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("MatlabSwigIterator_eq",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_swig__MatlabSwigIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MatlabSwigIterator_eq" "', argument " "1"" of type '" "swig::MatlabSwigIterator const *""'"); 
  }
  arg1 = reinterpret_cast< swig::MatlabSwigIterator * >(argp1);
  res2 = SWIG_ConvertPtr(argv[1], &argp2, SWIGTYPE_p_swig__MatlabSwigIterator,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "MatlabSwigIterator_eq" "', argument " "2"" of type '" "swig::MatlabSwigIterator const &""'"); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "MatlabSwigIterator_eq" "', argument " "2"" of type '" "swig::MatlabSwigIterator const &""'"); 
  }
  arg2 = reinterpret_cast< swig::MatlabSwigIterator * >(argp2);
  result = (bool)((swig::MatlabSwigIterator const *)arg1)->operator ==((swig::MatlabSwigIterator const &)*arg2);
  _out = SWIG_From_bool(static_cast< bool >(result));
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatlabSwigIterator_eq'."
      "  Prototype:\n"
      "    EQ(self,MatlabSwigIterator)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatlabSwigIterator_ne(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  swig::MatlabSwigIterator *arg1 = (swig::MatlabSwigIterator *) 0 ;
  swig::MatlabSwigIterator *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("MatlabSwigIterator_ne",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_swig__MatlabSwigIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MatlabSwigIterator_ne" "', argument " "1"" of type '" "swig::MatlabSwigIterator const *""'"); 
  }
  arg1 = reinterpret_cast< swig::MatlabSwigIterator * >(argp1);
  res2 = SWIG_ConvertPtr(argv[1], &argp2, SWIGTYPE_p_swig__MatlabSwigIterator,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "MatlabSwigIterator_ne" "', argument " "2"" of type '" "swig::MatlabSwigIterator const &""'"); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "MatlabSwigIterator_ne" "', argument " "2"" of type '" "swig::MatlabSwigIterator const &""'"); 
  }
  arg2 = reinterpret_cast< swig::MatlabSwigIterator * >(argp2);
  result = (bool)((swig::MatlabSwigIterator const *)arg1)->operator !=((swig::MatlabSwigIterator const &)*arg2);
  _out = SWIG_From_bool(static_cast< bool >(result));
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatlabSwigIterator_ne'."
      "  Prototype:\n"
      "    NE(self,MatlabSwigIterator)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatlabSwigIterator_TODOincr(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  swig::MatlabSwigIterator *arg1 = (swig::MatlabSwigIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  swig::MatlabSwigIterator *result = 0 ;
  
  if (!SWIG_check_num_args("MatlabSwigIterator_TODOincr",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_swig__MatlabSwigIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MatlabSwigIterator_TODOincr" "', argument " "1"" of type '" "swig::MatlabSwigIterator *""'"); 
  }
  arg1 = reinterpret_cast< swig::MatlabSwigIterator * >(argp1);
  result = (swig::MatlabSwigIterator *)(arg1)->operator ++();
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__MatlabSwigIterator, 0 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatlabSwigIterator_TODOincr'."
      "  Prototype:\n"
      "    TODOINCR(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatlabSwigIterator_TODOdecr(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  swig::MatlabSwigIterator *arg1 = (swig::MatlabSwigIterator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  swig::MatlabSwigIterator *result = 0 ;
  
  if (!SWIG_check_num_args("MatlabSwigIterator_TODOdecr",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_swig__MatlabSwigIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MatlabSwigIterator_TODOdecr" "', argument " "1"" of type '" "swig::MatlabSwigIterator *""'"); 
  }
  arg1 = reinterpret_cast< swig::MatlabSwigIterator * >(argp1);
  result = (swig::MatlabSwigIterator *)(arg1)->operator --();
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__MatlabSwigIterator, 0 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatlabSwigIterator_TODOdecr'."
      "  Prototype:\n"
      "    TODODECR(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatlabSwigIterator_plus(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  swig::MatlabSwigIterator *arg1 = (swig::MatlabSwigIterator *) 0 ;
  ptrdiff_t arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  ptrdiff_t val2 ;
  int ecode2 = 0 ;
  mxArray * _out;
  swig::MatlabSwigIterator *result = 0 ;
  
  if (!SWIG_check_num_args("MatlabSwigIterator_plus",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_swig__MatlabSwigIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MatlabSwigIterator_plus" "', argument " "1"" of type '" "swig::MatlabSwigIterator const *""'"); 
  }
  arg1 = reinterpret_cast< swig::MatlabSwigIterator * >(argp1);
  ecode2 = SWIG_AsVal_ptrdiff_t(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MatlabSwigIterator_plus" "', argument " "2"" of type '" "ptrdiff_t""'");
  } 
  arg2 = static_cast< ptrdiff_t >(val2);
  try {
    result = (swig::MatlabSwigIterator *)((swig::MatlabSwigIterator const *)arg1)->operator +(arg2);
  }
  catch(swig::stop_iteration &_e) {
    {
      SWIG_Error(SWIG_RuntimeError,"stop_iteration exception"); /* KT TODO */
      SWIG_fail;
    }
  }
  
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__MatlabSwigIterator, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatlabSwigIterator_plus'."
      "  Prototype:\n"
      "    PLUS(self,ptrdiff_t)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatlabSwigIterator_minus__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  swig::MatlabSwigIterator *arg1 = (swig::MatlabSwigIterator *) 0 ;
  ptrdiff_t arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  ptrdiff_t val2 ;
  int ecode2 = 0 ;
  mxArray * _out;
  swig::MatlabSwigIterator *result = 0 ;
  
  if (!SWIG_check_num_args("MatlabSwigIterator_minus",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_swig__MatlabSwigIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MatlabSwigIterator_minus" "', argument " "1"" of type '" "swig::MatlabSwigIterator const *""'"); 
  }
  arg1 = reinterpret_cast< swig::MatlabSwigIterator * >(argp1);
  ecode2 = SWIG_AsVal_ptrdiff_t(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MatlabSwigIterator_minus" "', argument " "2"" of type '" "ptrdiff_t""'");
  } 
  arg2 = static_cast< ptrdiff_t >(val2);
  try {
    result = (swig::MatlabSwigIterator *)((swig::MatlabSwigIterator const *)arg1)->operator -(arg2);
  }
  catch(swig::stop_iteration &_e) {
    {
      SWIG_Error(SWIG_RuntimeError,"stop_iteration exception"); /* KT TODO */
      SWIG_fail;
    }
  }
  
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__MatlabSwigIterator, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatlabSwigIterator_minus'."
      "  Prototype:\n"
      "    MINUS(self,ptrdiff_t)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatlabSwigIterator_minus__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  swig::MatlabSwigIterator *arg1 = (swig::MatlabSwigIterator *) 0 ;
  swig::MatlabSwigIterator *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  mxArray * _out;
  ptrdiff_t result;
  
  if (!SWIG_check_num_args("MatlabSwigIterator_minus",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_swig__MatlabSwigIterator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MatlabSwigIterator_minus" "', argument " "1"" of type '" "swig::MatlabSwigIterator const *""'"); 
  }
  arg1 = reinterpret_cast< swig::MatlabSwigIterator * >(argp1);
  res2 = SWIG_ConvertPtr(argv[1], &argp2, SWIGTYPE_p_swig__MatlabSwigIterator,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "MatlabSwigIterator_minus" "', argument " "2"" of type '" "swig::MatlabSwigIterator const &""'"); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "MatlabSwigIterator_minus" "', argument " "2"" of type '" "swig::MatlabSwigIterator const &""'"); 
  }
  arg2 = reinterpret_cast< swig::MatlabSwigIterator * >(argp2);
  result = ((swig::MatlabSwigIterator const *)arg1)->operator -((swig::MatlabSwigIterator const &)*arg2);
  _out = SWIG_From_ptrdiff_t(static_cast< ptrdiff_t >(result));
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatlabSwigIterator_minus'."
      "  Prototype:\n"
      "    MINUS(self,MatlabSwigIterator)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatlabSwigIterator_minus(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__MatlabSwigIterator, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_swig__MatlabSwigIterator, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap_MatlabSwigIterator_minus__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__MatlabSwigIterator, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_MatlabSwigIterator_minus__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatlabSwigIterator_minus'."
    "  Possible prototypes are:\n"
    "    MINUS(self,MatlabSwigIterator)\n"
    "    MINUS(self,ptrdiff_t)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_new_PrintableCommon__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  casadi::PrintableCommon *result = 0 ;
  
  if (!SWIG_check_num_args("new_PrintableCommon",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    result = (casadi::PrintableCommon *)new casadi::PrintableCommon();
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__PrintableCommon, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_PrintableCommon'."
      "  Prototype:\n"
      "    PRINTABLECOMMON()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_PrintableCommon__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::PrintableCommon *arg1 = 0 ;
  void *argp1 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::PrintableCommon *result = 0 ;
  
  if (!SWIG_check_num_args("new_PrintableCommon",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_casadi__PrintableCommon,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_PrintableCommon" "', argument " "1"" of type '" "casadi::PrintableCommon const &""'"); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_PrintableCommon" "', argument " "1"" of type '" "casadi::PrintableCommon const &""'"); 
  }
  arg1 = reinterpret_cast< casadi::PrintableCommon * >(argp1);
  {
    result = (casadi::PrintableCommon *)new casadi::PrintableCommon((casadi::PrintableCommon const &)*arg1);
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__PrintableCommon, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_PrintableCommon'."
      "  Prototype:\n"
      "    PRINTABLECOMMON(PrintableCommon)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_PrintableCommon(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 0) {
    return _wrap_new_PrintableCommon__SWIG_0(resc,resv,argc,argv);
  }
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__PrintableCommon, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_new_PrintableCommon__SWIG_1(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_PrintableCommon'."
    "  Possible prototypes are:\n"
    "    PRINTABLECOMMON()\n"
    "    PRINTABLECOMMON(PrintableCommon)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_delete_PrintableCommon(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::PrintableCommon *arg1 = (casadi::PrintableCommon *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  int is_owned;
  if (!SWIG_check_num_args("delete_PrintableCommon",argc,1,1,0)) {
    SWIG_fail;
  }
  is_owned = SWIG_Matlab_isOwned(argv[0]);
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__PrintableCommon, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_PrintableCommon" "', argument " "1"" of type '" "casadi::PrintableCommon *""'"); 
  }
  arg1 = reinterpret_cast< casadi::PrintableCommon * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  if (is_owned) {
    {
      delete arg1;
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'delete_PrintableCommon'."
      "  Prototype:\n"
      "    PRINTABLECOMMON(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SharedObject_class_name(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::SharedObject *arg1 = (casadi::SharedObject *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("SharedObject_class_name",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__SharedObject, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SharedObject_class_name" "', argument " "1"" of type '" "casadi::SharedObject const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::SharedObject * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::SharedObject const *)arg1)->class_name();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SharedObject_class_name'."
      "  Prototype:\n"
      "    CLASS_NAME(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SharedObject_disp(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::SharedObject *arg1 = (casadi::SharedObject *) 0 ;
  std::ostream *arg2 = 0 ;
  bool arg3 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  arg2 = &casadi::uout();
  if (!SWIG_check_num_args("SharedObject_disp",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__SharedObject, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SharedObject_disp" "', argument " "1"" of type '" "casadi::SharedObject const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::SharedObject * >(argp1);
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::SharedObject const *)arg1)->disp(*arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  *arg2 << "\n" << std::flush;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SharedObject_disp'."
      "  Prototype:\n"
      "    DISP(self,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SharedObject_str(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::SharedObject *arg1 = (casadi::SharedObject *) 0 ;
  bool arg2 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("SharedObject_str",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__SharedObject, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SharedObject_str" "', argument " "1"" of type '" "casadi::SharedObject const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::SharedObject * >(argp1);
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::SharedObject const *)arg1)->get_str(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SharedObject_str'."
      "  Prototype:\n"
      "    STR(self,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SharedObject_print_ptr(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::SharedObject *arg1 = (casadi::SharedObject *) 0 ;
  std::ostream &arg2_defvalue = casadi::uout() ;
  std::ostream *arg2 = (std::ostream *) &arg2_defvalue ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  arg2 = &casadi::uout();
  if (!SWIG_check_num_args("SharedObject_print_ptr",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__SharedObject, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SharedObject_print_ptr" "', argument " "1"" of type '" "casadi::SharedObject const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::SharedObject * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::SharedObject const *)arg1)->print_ptr(*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  *arg2 << "\n" << std::flush;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SharedObject_print_ptr'."
      "  Prototype:\n"
      "    PRINT_PTR(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SharedObject_is_null(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::SharedObject *arg1 = (casadi::SharedObject *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("SharedObject_is_null",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__SharedObject, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SharedObject_is_null" "', argument " "1"" of type '" "casadi::SharedObject const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::SharedObject * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::SharedObject const *)arg1)->is_null();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SharedObject_is_null'."
      "  Prototype:\n"
      "    IS_NULL(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SharedObject_hash(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::SharedObject *arg1 = (casadi::SharedObject *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("SharedObject_hash",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__SharedObject, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SharedObject_hash" "', argument " "1"" of type '" "casadi::SharedObject const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::SharedObject * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::SharedObject const *)arg1)->__hash__();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SharedObject_hash'."
      "  Prototype:\n"
      "    HASH(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_SharedObject__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  casadi::SharedObject *result = 0 ;
  
  if (!SWIG_check_num_args("new_SharedObject",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    result = (casadi::SharedObject *)new casadi::SharedObject();
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__SharedObject, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_SharedObject'."
      "  Prototype:\n"
      "    SHAREDOBJECT()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_SharedObject__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::SharedObject *arg1 = 0 ;
  void *argp1 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::SharedObject *result = 0 ;
  
  if (!SWIG_check_num_args("new_SharedObject",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_casadi__SharedObject,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_SharedObject" "', argument " "1"" of type '" "casadi::SharedObject const &""'"); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_SharedObject" "', argument " "1"" of type '" "casadi::SharedObject const &""'"); 
  }
  arg1 = reinterpret_cast< casadi::SharedObject * >(argp1);
  {
    result = (casadi::SharedObject *)new casadi::SharedObject((casadi::SharedObject const &)*arg1);
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__SharedObject, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_SharedObject'."
      "  Prototype:\n"
      "    SHAREDOBJECT(SharedObject)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_SharedObject(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 0) {
    return _wrap_new_SharedObject__SWIG_0(resc,resv,argc,argv);
  }
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__SharedObject, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_new_SharedObject__SWIG_1(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_SharedObject'."
    "  Possible prototypes are:\n"
    "    SHAREDOBJECT()\n"
    "    SHAREDOBJECT(SharedObject)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_delete_SharedObject(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::SharedObject *arg1 = (casadi::SharedObject *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  int is_owned;
  if (!SWIG_check_num_args("delete_SharedObject",argc,1,1,0)) {
    SWIG_fail;
  }
  is_owned = SWIG_Matlab_isOwned(argv[0]);
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__SharedObject, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_SharedObject" "', argument " "1"" of type '" "casadi::SharedObject *""'"); 
  }
  arg1 = reinterpret_cast< casadi::SharedObject * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  if (is_owned) {
    {
      delete arg1;
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'delete_SharedObject'."
      "  Prototype:\n"
      "    SHAREDOBJECT(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_WeakRef__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  int arg1 = (int) 0 ;
  int val1 ;
  int ecode1 = 0 ;
  mxArray * _out;
  casadi::WeakRef *result = 0 ;
  
  if (!SWIG_check_num_args("new_WeakRef",argc,1,0,0)) {
    SWIG_fail;
  }
  if (0<argc) {
    ecode1 = SWIG_AsVal_int(argv[0], &val1);
    if (!SWIG_IsOK(ecode1)) {
      SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_WeakRef" "', argument " "1"" of type '" "int""'");
    } 
    arg1 = static_cast< int >(val1);
  }
  {
    try {
      result = (casadi::WeakRef *)new casadi::WeakRef(arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__WeakRef, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_WeakRef'."
      "  Prototype:\n"
      "    WEAKREF(int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_WeakRef__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::SharedObject arg1 ;
  void *argp1 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::WeakRef *result = 0 ;
  
  if (!SWIG_check_num_args("new_WeakRef",argc,1,1,0)) {
    SWIG_fail;
  }
  {
    res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_casadi__SharedObject,  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_WeakRef" "', argument " "1"" of type '" "casadi::SharedObject""'"); 
    }  
    if (!argp1) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_WeakRef" "', argument " "1"" of type '" "casadi::SharedObject""'");
    } else {
      arg1 = *(reinterpret_cast< casadi::SharedObject * >(argp1));
    }
  }
  {
    try {
      result = (casadi::WeakRef *)new casadi::WeakRef(arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__WeakRef, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_WeakRef'."
      "  Prototype:\n"
      "    WEAKREF(SharedObject)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_WeakRef_shared(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::WeakRef *arg1 = (casadi::WeakRef *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::SharedObject result;
  
  if (!SWIG_check_num_args("WeakRef_shared",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__WeakRef, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WeakRef_shared" "', argument " "1"" of type '" "casadi::WeakRef *""'"); 
  }
  arg1 = reinterpret_cast< casadi::WeakRef * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->shared();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj((new casadi::SharedObject(static_cast< const casadi::SharedObject& >(result))), SWIGTYPE_p_casadi__SharedObject, SWIG_POINTER_OWN |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'WeakRef_shared'."
      "  Prototype:\n"
      "    SHARED(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_WeakRef_alive(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::WeakRef *arg1 = (casadi::WeakRef *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("WeakRef_alive",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__WeakRef, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WeakRef_alive" "', argument " "1"" of type '" "casadi::WeakRef const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::WeakRef * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::WeakRef const *)arg1)->alive();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'WeakRef_alive'."
      "  Prototype:\n"
      "    ALIVE(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_WeakRef__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::WeakRef *arg1 = 0 ;
  void *argp1 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::WeakRef *result = 0 ;
  
  if (!SWIG_check_num_args("new_WeakRef",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_casadi__WeakRef,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_WeakRef" "', argument " "1"" of type '" "casadi::WeakRef const &""'"); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_WeakRef" "', argument " "1"" of type '" "casadi::WeakRef const &""'"); 
  }
  arg1 = reinterpret_cast< casadi::WeakRef * >(argp1);
  {
    result = (casadi::WeakRef *)new casadi::WeakRef((casadi::WeakRef const &)*arg1);
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__WeakRef, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_WeakRef'."
      "  Prototype:\n"
      "    WEAKREF(WeakRef)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_WeakRef(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 0) && (argc <= 1)) {
    int _v;
    if (argc <= 0) {
      return _wrap_new_WeakRef__SWIG_0(resc,resv,argc,argv);
    }
    {
      int res = SWIG_AsVal_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      return _wrap_new_WeakRef__SWIG_0(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__WeakRef, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_new_WeakRef__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__SharedObject, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_new_WeakRef__SWIG_1(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_WeakRef'."
    "  Possible prototypes are:\n"
    "    WEAKREF(int)\n"
    "    WEAKREF(WeakRef)\n"
    "    WEAKREF(SharedObject)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_delete_WeakRef(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::WeakRef *arg1 = (casadi::WeakRef *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  int is_owned;
  if (!SWIG_check_num_args("delete_WeakRef",argc,1,1,0)) {
    SWIG_fail;
  }
  is_owned = SWIG_Matlab_isOwned(argv[0]);
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__WeakRef, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_WeakRef" "', argument " "1"" of type '" "casadi::WeakRef *""'"); 
  }
  arg1 = reinterpret_cast< casadi::WeakRef * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  if (is_owned) {
    {
      delete arg1;
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'delete_WeakRef'."
      "  Prototype:\n"
      "    WEAKREF(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_complement(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< casadi_int,std::allocator< casadi_int > > *arg1 = 0 ;
  casadi_int arg2 ;
  std::vector< casadi_int > m1 ;
  mxArray * _out;
  std::vector< casadi_int,std::allocator< casadi_int > > result;
  
  if (!SWIG_check_num_args("complement",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "[" "int" "]" "'.");
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  {
    try {
      result = casadi::complement((std::vector< long long,std::allocator< long long > > const &)*arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[" "int" "]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'complement'."
      "  Prototype:\n"
      "    COMPLEMENT([int],int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_lookupvector__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< casadi_int,std::allocator< casadi_int > > *arg1 = 0 ;
  casadi_int arg2 ;
  std::vector< casadi_int > m1 ;
  mxArray * _out;
  std::vector< casadi_int,std::allocator< casadi_int > > result;
  
  if (!SWIG_check_num_args("lookupvector",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "[" "int" "]" "'.");
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  {
    try {
      result = casadi::lookupvector((std::vector< long long,std::allocator< long long > > const &)*arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[" "int" "]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'lookupvector'."
      "  Prototype:\n"
      "    LOOKUPVECTOR([int],int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_lookupvector__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< casadi_int,std::allocator< casadi_int > > *arg1 = 0 ;
  std::vector< casadi_int > m1 ;
  mxArray * _out;
  std::vector< casadi_int,std::allocator< casadi_int > > result;
  
  if (!SWIG_check_num_args("lookupvector",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "[" "int" "]" "'.");
  {
    try {
      result = casadi::lookupvector((std::vector< long long,std::allocator< long long > > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[" "int" "]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'lookupvector'."
      "  Prototype:\n"
      "    LOOKUPVECTOR([int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_lookupvector(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::vector<casadi_int> **>(0));
    if (_v) {
      return _wrap_lookupvector__SWIG_1(resc,resv,argc,argv);
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::vector<casadi_int> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_lookupvector__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'lookupvector'."
    "  Possible prototypes are:\n"
    "    LOOKUPVECTOR([int])\n"
    "    LOOKUPVECTOR([int],int)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_temporary_file(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  std::string m1 ;
  std::string m2 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("temporary_file",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  {
    try {
      result = casadi::temporary_file((std::string const &)*arg1,(std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'temporary_file'."
      "  Prototype:\n"
      "    TEMPORARY_FILE(char,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_normalized_setup__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::istream *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("normalized_setup",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_std__istream,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "normalized_setup" "', argument " "1"" of type '" "std::istream &""'"); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "normalized_setup" "', argument " "1"" of type '" "std::istream &""'"); 
  }
  arg1 = reinterpret_cast< std::istream * >(argp1);
  {
    try {
      casadi::normalized_setup(*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'normalized_setup'."
      "  Prototype:\n"
      "    NORMALIZED_SETUP(std::istream &)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_normalized_setup__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::ostream *arg1 = 0 ;
  mxArray * _out;
  
  arg1 = &casadi::uout();
  if (!SWIG_check_num_args("normalized_setup",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      casadi::normalized_setup(*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  *arg1 << "\n" << std::flush;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'normalized_setup'."
      "  Prototype:\n"
      "    NORMALIZED_SETUP()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_normalized_setup(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 0) {
    return _wrap_normalized_setup__SWIG_1(resc,resv,argc,argv);
  }
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_std__istream, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_normalized_setup__SWIG_0(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'normalized_setup'."
    "  Possible prototypes are:\n"
    "    NORMALIZED_SETUP()\n"
    "    NORMALIZED_SETUP(std::istream &)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_normalized_out(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::ostream *arg1 = 0 ;
  double arg2 ;
  mxArray * _out;
  
  arg1 = &casadi::uout();
  if (!SWIG_check_num_args("normalized_out",argc,1,1,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "double" "'.");
  {
    try {
      casadi::normalized_out(*arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  *arg1 << "\n" << std::flush;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'normalized_out'."
      "  Prototype:\n"
      "    NORMALIZED_OUT(double)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_normalized_in(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::istream *arg1 = 0 ;
  double *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  mxArray * _out;
  int result;
  
  if (!SWIG_check_num_args("normalized_in",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_std__istream,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "normalized_in" "', argument " "1"" of type '" "std::istream &""'"); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "normalized_in" "', argument " "1"" of type '" "std::istream &""'"); 
  }
  arg1 = reinterpret_cast< std::istream * >(argp1);
  res2 = SWIG_ConvertPtr(argv[1], &argp2, SWIGTYPE_p_double,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "normalized_in" "', argument " "2"" of type '" "double &""'"); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "normalized_in" "', argument " "2"" of type '" "double &""'"); 
  }
  arg2 = reinterpret_cast< double * >(argp2);
  {
    try {
      result = (int)casadi::normalized_in(*arg1,*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_From_int(static_cast< int >(result));
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'normalized_in'."
      "  Prototype:\n"
      "    NORMALIZED_IN(std::istream &,double &)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericType_serialize(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericType *arg1 = (casadi::GenericType *) 0 ;
  casadi::SerializingStream *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("GenericType_serialize",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericType, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenericType_serialize" "', argument " "1"" of type '" "casadi::GenericType const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericType * >(argp1);
  res2 = SWIG_ConvertPtr(argv[1], &argp2, SWIGTYPE_p_casadi__SerializingStream,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GenericType_serialize" "', argument " "2"" of type '" "casadi::SerializingStream &""'"); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "GenericType_serialize" "', argument " "2"" of type '" "casadi::SerializingStream &""'"); 
  }
  arg2 = reinterpret_cast< casadi::SerializingStream * >(argp2);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::GenericType const *)arg1)->serialize(*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericType_serialize'."
      "  Prototype:\n"
      "    SERIALIZE(self,casadi::SerializingStream &)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericType_deserialize(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DeserializingStream *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::GenericType result;
  
  if (!SWIG_check_num_args("GenericType_deserialize",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_casadi__DeserializingStream,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenericType_deserialize" "', argument " "1"" of type '" "casadi::DeserializingStream &""'"); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "GenericType_deserialize" "', argument " "1"" of type '" "casadi::DeserializingStream &""'"); 
  }
  arg1 = reinterpret_cast< casadi::DeserializingStream * >(argp1);
  {
    try {
      result = casadi::GenericType::deserialize(*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "GenericType" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericType_deserialize'."
      "  Prototype:\n"
      "    DESERIALIZE(casadi::DeserializingStream &)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_GenericType__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  casadi::GenericType *result = 0 ;
  
  if (!SWIG_check_num_args("new_GenericType",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    result = (casadi::GenericType *)new casadi::GenericType();
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__GenericType, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_GenericType'."
      "  Prototype:\n"
      "    GENERICTYPE()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_GenericType__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericType *arg1 = 0 ;
  casadi::GenericType m1 ;
  mxArray * _out;
  casadi::GenericType *result = 0 ;
  
  if (!SWIG_check_num_args("new_GenericType",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "GenericType" "'.");
  {
    result = (casadi::GenericType *)new casadi::GenericType((casadi::GenericType const &)*arg1);
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__GenericType, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_GenericType'."
      "  Prototype:\n"
      "    GENERICTYPE(GenericType)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_GenericType(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 0) {
    return _wrap_new_GenericType__SWIG_0(resc,resv,argc,argv);
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::GenericType **>(0));
    if (_v) {
      return _wrap_new_GenericType__SWIG_1(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_GenericType'."
    "  Possible prototypes are:\n"
    "    GENERICTYPE()\n"
    "    GENERICTYPE(GenericType)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_delete_GenericType(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericType *arg1 = (casadi::GenericType *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  int is_owned;
  if (!SWIG_check_num_args("delete_GenericType",argc,1,1,0)) {
    SWIG_fail;
  }
  is_owned = SWIG_Matlab_isOwned(argv[0]);
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericType, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GenericType" "', argument " "1"" of type '" "casadi::GenericType *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericType * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  if (is_owned) {
    {
      delete arg1;
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'delete_GenericType'."
      "  Prototype:\n"
      "    GENERICTYPE(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_horzcat__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< casadi::Sparsity,std::allocator< casadi::Sparsity > > *arg1 = 0 ;
  std::vector< casadi::Sparsity > m1 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_horzcat",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "{" "Sparsity" "}" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_horzcat__SWIG_0((std::vector< casadi::Sparsity,std::allocator< casadi::Sparsity > > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_horzcat'."
      "  Prototype:\n"
      "    HORZCAT({Sparsity})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_vertcat__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< casadi::Sparsity,std::allocator< casadi::Sparsity > > *arg1 = 0 ;
  std::vector< casadi::Sparsity > m1 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_vertcat",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "{" "Sparsity" "}" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_vertcat__SWIG_0((std::vector< casadi::Sparsity,std::allocator< casadi::Sparsity > > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_vertcat'."
      "  Prototype:\n"
      "    VERTCAT({Sparsity})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_horzsplit__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg2 = 0 ;
  casadi::Sparsity m1 ;
  std::vector< casadi_int > m2 ;
  mxArray * _out;
  std::vector< casadi::Sparsity,std::allocator< casadi::Sparsity > > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_horzsplit",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Sparsity" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "[" "int" "]" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_horzsplit__SWIG_0((casadi::Sparsity const &)*arg1,(std::vector< long long,std::allocator< long long > > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "Sparsity" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_horzsplit'."
      "  Prototype:\n"
      "    HORZSPLIT(Sparsity,[int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_horzsplit__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = 0 ;
  casadi_int arg2 = (casadi_int) 1 ;
  casadi::Sparsity m1 ;
  mxArray * _out;
  std::vector< casadi::Sparsity,std::allocator< casadi::Sparsity > > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_horzsplit",argc,2,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Sparsity" "'.");
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  }
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_horzsplit__SWIG_1((casadi::Sparsity const &)*arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "Sparsity" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_horzsplit'."
      "  Prototype:\n"
      "    HORZSPLIT(Sparsity,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_horzsplit_n__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = 0 ;
  casadi_int arg2 ;
  casadi::Sparsity m1 ;
  mxArray * _out;
  std::vector< casadi::Sparsity,std::allocator< casadi::Sparsity > > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_horzsplit_n",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Sparsity" "'.");
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_horzsplit_n__SWIG_0((casadi::Sparsity const &)*arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "Sparsity" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_horzsplit_n'."
      "  Prototype:\n"
      "    HORZSPLIT_N(Sparsity,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_vertsplit__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg2 = 0 ;
  casadi::Sparsity m1 ;
  std::vector< casadi_int > m2 ;
  mxArray * _out;
  std::vector< casadi::Sparsity,std::allocator< casadi::Sparsity > > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_vertsplit",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Sparsity" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "[" "int" "]" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_vertsplit__SWIG_0((casadi::Sparsity const &)*arg1,(std::vector< long long,std::allocator< long long > > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "Sparsity" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_vertsplit'."
      "  Prototype:\n"
      "    VERTSPLIT(Sparsity,[int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_offset__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< casadi::Sparsity,std::allocator< casadi::Sparsity > > *arg1 = 0 ;
  bool arg2 = (bool) true ;
  std::vector< casadi::Sparsity > m1 ;
  mxArray * _out;
  std::vector< casadi_int,std::allocator< casadi_int > > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_offset",argc,2,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "{" "Sparsity" "}" "'.");
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "bool" "'.");
  }
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_offset__SWIG_0((std::vector< casadi::Sparsity,std::allocator< casadi::Sparsity > > const &)*arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[" "int" "]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_offset'."
      "  Prototype:\n"
      "    OFFSET({Sparsity},bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_vertsplit__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = 0 ;
  casadi_int arg2 = (casadi_int) 1 ;
  casadi::Sparsity m1 ;
  mxArray * _out;
  std::vector< casadi::Sparsity,std::allocator< casadi::Sparsity > > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_vertsplit",argc,2,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Sparsity" "'.");
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  }
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_vertsplit__SWIG_1((casadi::Sparsity const &)*arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "Sparsity" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_vertsplit'."
      "  Prototype:\n"
      "    VERTSPLIT(Sparsity,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_vertsplit_n__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = 0 ;
  casadi_int arg2 ;
  casadi::Sparsity m1 ;
  mxArray * _out;
  std::vector< casadi::Sparsity,std::allocator< casadi::Sparsity > > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_vertsplit_n",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Sparsity" "'.");
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_vertsplit_n__SWIG_0((casadi::Sparsity const &)*arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "Sparsity" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_vertsplit_n'."
      "  Prototype:\n"
      "    VERTSPLIT_N(Sparsity,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_blockcat__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = 0 ;
  casadi::Sparsity *arg2 = 0 ;
  casadi::Sparsity *arg3 = 0 ;
  casadi::Sparsity *arg4 = 0 ;
  casadi::Sparsity m1 ;
  casadi::Sparsity m2 ;
  casadi::Sparsity m3 ;
  casadi::Sparsity m4 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_blockcat",argc,4,4,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Sparsity" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "Sparsity" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "Sparsity" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "Sparsity" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_blockcat__SWIG_0((casadi::Sparsity const &)*arg1,(casadi::Sparsity const &)*arg2,(casadi::Sparsity const &)*arg3,(casadi::Sparsity const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_blockcat'."
      "  Prototype:\n"
      "    BLOCKCAT(Sparsity,Sparsity,Sparsity,Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_blocksplit__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg2 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg3 = 0 ;
  casadi::Sparsity m1 ;
  std::vector< casadi_int > m2 ;
  std::vector< casadi_int > m3 ;
  mxArray * _out;
  std::vector< std::vector< casadi::Sparsity,std::allocator< casadi::Sparsity > >,std::allocator< std::vector< casadi::Sparsity,std::allocator< casadi::Sparsity > > > > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_blocksplit",argc,3,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Sparsity" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "[" "int" "]" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "[" "int" "]" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_blocksplit__SWIG_0((casadi::Sparsity const &)*arg1,(std::vector< long long,std::allocator< long long > > const &)*arg2,(std::vector< long long,std::allocator< long long > > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "{" "Sparsity"  "}"  "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_blocksplit'."
      "  Prototype:\n"
      "    BLOCKSPLIT(Sparsity,[int],[int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_blocksplit__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = 0 ;
  casadi_int arg2 = (casadi_int) 1 ;
  casadi_int arg3 = (casadi_int) 1 ;
  casadi::Sparsity m1 ;
  mxArray * _out;
  std::vector< std::vector< casadi::Sparsity,std::allocator< casadi::Sparsity > >,std::allocator< std::vector< casadi::Sparsity,std::allocator< casadi::Sparsity > > > > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_blocksplit",argc,3,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Sparsity" "'.");
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  }
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  }
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_blocksplit__SWIG_1((casadi::Sparsity const &)*arg1,arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "{" "Sparsity"  "}"  "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_blocksplit'."
      "  Prototype:\n"
      "    BLOCKSPLIT(Sparsity,int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_diagcat__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< casadi::Sparsity,std::allocator< casadi::Sparsity > > *arg1 = 0 ;
  std::vector< casadi::Sparsity > m1 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_diagcat",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "{" "Sparsity" "}" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_diagcat__SWIG_0((std::vector< casadi::Sparsity,std::allocator< casadi::Sparsity > > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_diagcat'."
      "  Prototype:\n"
      "    DIAGCAT({Sparsity})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_diagsplit__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg2 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg3 = 0 ;
  casadi::Sparsity m1 ;
  std::vector< casadi_int > m2 ;
  std::vector< casadi_int > m3 ;
  mxArray * _out;
  std::vector< casadi::Sparsity,std::allocator< casadi::Sparsity > > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_diagsplit",argc,3,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Sparsity" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "[" "int" "]" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "[" "int" "]" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_diagsplit__SWIG_0((casadi::Sparsity const &)*arg1,(std::vector< long long,std::allocator< long long > > const &)*arg2,(std::vector< long long,std::allocator< long long > > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "Sparsity" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_diagsplit'."
      "  Prototype:\n"
      "    DIAGSPLIT(Sparsity,[int],[int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_diagsplit__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg2 = 0 ;
  casadi::Sparsity m1 ;
  std::vector< casadi_int > m2 ;
  mxArray * _out;
  std::vector< casadi::Sparsity,std::allocator< casadi::Sparsity > > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_diagsplit",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Sparsity" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "[" "int" "]" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_diagsplit__SWIG_1((casadi::Sparsity const &)*arg1,(std::vector< long long,std::allocator< long long > > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "Sparsity" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_diagsplit'."
      "  Prototype:\n"
      "    DIAGSPLIT(Sparsity,[int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_diagsplit__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = 0 ;
  casadi_int arg2 = (casadi_int) 1 ;
  casadi::Sparsity m1 ;
  mxArray * _out;
  std::vector< casadi::Sparsity,std::allocator< casadi::Sparsity > > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_diagsplit",argc,2,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Sparsity" "'.");
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  }
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_diagsplit__SWIG_2((casadi::Sparsity const &)*arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "Sparsity" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_diagsplit'."
      "  Prototype:\n"
      "    DIAGSPLIT(Sparsity,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_diagsplit__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = 0 ;
  casadi_int arg2 ;
  casadi_int arg3 ;
  casadi::Sparsity m1 ;
  mxArray * _out;
  std::vector< casadi::Sparsity,std::allocator< casadi::Sparsity > > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_diagsplit",argc,3,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Sparsity" "'.");
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_diagsplit__SWIG_3((casadi::Sparsity const &)*arg1,arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "Sparsity" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_diagsplit'."
      "  Prototype:\n"
      "    DIAGSPLIT(Sparsity,int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_veccat__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< casadi::Sparsity,std::allocator< casadi::Sparsity > > *arg1 = 0 ;
  std::vector< casadi::Sparsity > m1 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_veccat",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "{" "Sparsity" "}" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_veccat__SWIG_0((std::vector< casadi::Sparsity,std::allocator< casadi::Sparsity > > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_veccat'."
      "  Prototype:\n"
      "    VECCAT({Sparsity})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_mtimes__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = 0 ;
  casadi::Sparsity *arg2 = 0 ;
  casadi::Sparsity m1 ;
  casadi::Sparsity m2 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_mtimes",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Sparsity" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "Sparsity" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_mtimes__SWIG_0((casadi::Sparsity const &)*arg1,(casadi::Sparsity const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_mtimes'."
      "  Prototype:\n"
      "    MTIMES(Sparsity,Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_mtimes__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< casadi::Sparsity,std::allocator< casadi::Sparsity > > *arg1 = 0 ;
  std::vector< casadi::Sparsity > m1 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_mtimes",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "{" "Sparsity" "}" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_mtimes__SWIG_1((std::vector< casadi::Sparsity,std::allocator< casadi::Sparsity > > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_mtimes'."
      "  Prototype:\n"
      "    MTIMES({Sparsity})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_mac__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = 0 ;
  casadi::Sparsity *arg2 = 0 ;
  casadi::Sparsity *arg3 = 0 ;
  casadi::Sparsity m1 ;
  casadi::Sparsity m2 ;
  casadi::Sparsity m3 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_mac",argc,3,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Sparsity" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "Sparsity" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "Sparsity" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_mac__SWIG_0((casadi::Sparsity const &)*arg1,(casadi::Sparsity const &)*arg2,(casadi::Sparsity const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_mac'."
      "  Prototype:\n"
      "    MAC(Sparsity,Sparsity,Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_transpose__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = 0 ;
  casadi::Sparsity m1 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_transpose",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Sparsity" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_transpose__SWIG_0((casadi::Sparsity const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_transpose'."
      "  Prototype:\n"
      "    TRANSPOSE(Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_vec__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = 0 ;
  casadi::Sparsity m1 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_vec",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Sparsity" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_vec__SWIG_0((casadi::Sparsity const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_vec'."
      "  Prototype:\n"
      "    VEC(Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_reshape__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = 0 ;
  casadi_int arg2 ;
  casadi_int arg3 ;
  casadi::Sparsity m1 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_reshape",argc,3,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Sparsity" "'.");
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_reshape__SWIG_0((casadi::Sparsity const &)*arg1,arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_reshape'."
      "  Prototype:\n"
      "    RESHAPE(Sparsity,int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_reshape__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = 0 ;
  std::pair< casadi_int,casadi_int > arg2 ;
  casadi::Sparsity m1 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_reshape",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Sparsity" "'.");
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "[int,int]" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_reshape__SWIG_1((casadi::Sparsity const &)*arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_reshape'."
      "  Prototype:\n"
      "    RESHAPE(Sparsity,[int,int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_reshape__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = 0 ;
  casadi::Sparsity *arg2 = 0 ;
  casadi::Sparsity m1 ;
  casadi::Sparsity m2 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_reshape",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Sparsity" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "Sparsity" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_reshape__SWIG_2((casadi::Sparsity const &)*arg1,(casadi::Sparsity const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_reshape'."
      "  Prototype:\n"
      "    RESHAPE(Sparsity,Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_sparsity_cast__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = 0 ;
  casadi::Sparsity *arg2 = 0 ;
  casadi::Sparsity m1 ;
  casadi::Sparsity m2 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_sparsity_cast",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Sparsity" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "Sparsity" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_sparsity_cast__SWIG_0((casadi::Sparsity const &)*arg1,(casadi::Sparsity const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_sparsity_cast'."
      "  Prototype:\n"
      "    SPARSITY_CAST(Sparsity,Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_sprank__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = 0 ;
  casadi::Sparsity m1 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_sprank",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Sparsity" "'.");
  {
    try {
      result = (casadi_int)casadi_SparsityInterfaceCommon_casadi_sprank__SWIG_0((casadi::Sparsity const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_sprank'."
      "  Prototype:\n"
      "    SPRANK(Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_norm_0_mul__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = 0 ;
  casadi::Sparsity *arg2 = 0 ;
  casadi::Sparsity m1 ;
  casadi::Sparsity m2 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_norm_0_mul",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Sparsity" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "Sparsity" "'.");
  {
    try {
      result = (casadi_int)casadi_SparsityInterfaceCommon_casadi_norm_0_mul__SWIG_0((casadi::Sparsity const &)*arg1,(casadi::Sparsity const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_norm_0_mul'."
      "  Prototype:\n"
      "    NORM_0_MUL(Sparsity,Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_triu__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = 0 ;
  bool arg2 = (bool) true ;
  casadi::Sparsity m1 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_triu",argc,2,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Sparsity" "'.");
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "bool" "'.");
  }
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_triu__SWIG_0((casadi::Sparsity const &)*arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_triu'."
      "  Prototype:\n"
      "    TRIU(Sparsity,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_tril__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = 0 ;
  bool arg2 = (bool) true ;
  casadi::Sparsity m1 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_tril",argc,2,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Sparsity" "'.");
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "bool" "'.");
  }
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_tril__SWIG_0((casadi::Sparsity const &)*arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_tril'."
      "  Prototype:\n"
      "    TRIL(Sparsity,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_kron__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = 0 ;
  casadi::Sparsity *arg2 = 0 ;
  casadi::Sparsity m1 ;
  casadi::Sparsity m2 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_kron",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Sparsity" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "Sparsity" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_kron__SWIG_0((casadi::Sparsity const &)*arg1,(casadi::Sparsity const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_kron'."
      "  Prototype:\n"
      "    KRON(Sparsity,Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_repmat__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = 0 ;
  casadi_int arg2 ;
  casadi_int arg3 = (casadi_int) 1 ;
  casadi::Sparsity m1 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_repmat",argc,3,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Sparsity" "'.");
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  }
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_repmat__SWIG_0((casadi::Sparsity const &)*arg1,arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_repmat'."
      "  Prototype:\n"
      "    REPMAT(Sparsity,int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_repmat__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = 0 ;
  std::pair< casadi_int,casadi_int > *arg2 = 0 ;
  casadi::Sparsity m1 ;
  std::pair< casadi_int,casadi_int > m2 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_repmat",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Sparsity" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "[int,int]" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_repmat__SWIG_1((casadi::Sparsity const &)*arg1,(std::pair< long long,long long > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_repmat'."
      "  Prototype:\n"
      "    REPMAT(Sparsity,[int,int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_sum2__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = 0 ;
  casadi::Sparsity m1 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_sum2",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Sparsity" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_sum2__SWIG_0((casadi::Sparsity const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_sum2'."
      "  Prototype:\n"
      "    SUM2(Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_sum1__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = 0 ;
  casadi::Sparsity m1 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_sum1",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Sparsity" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_sum1__SWIG_0((casadi::Sparsity const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_sum1'."
      "  Prototype:\n"
      "    SUM1(Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_length__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = 0 ;
  casadi::Sparsity m1 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_length",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Sparsity" "'.");
  {
    try {
      result = (casadi_int)casadi_SparsityInterfaceCommon_casadi_length__SWIG_0((casadi::Sparsity const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_length'."
      "  Prototype:\n"
      "    LENGTH(Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_horzcat__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< casadi::MX,std::allocator< casadi::MX > > *arg1 = 0 ;
  std::vector< casadi::MX > m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_horzcat",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "{" "MX" "}" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_horzcat__SWIG_1((std::vector< casadi::MX,std::allocator< casadi::MX > > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_horzcat'."
      "  Prototype:\n"
      "    HORZCAT({MX})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_vertcat__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< casadi::MX,std::allocator< casadi::MX > > *arg1 = 0 ;
  std::vector< casadi::MX > m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_vertcat",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "{" "MX" "}" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_vertcat__SWIG_1((std::vector< casadi::MX,std::allocator< casadi::MX > > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_vertcat'."
      "  Prototype:\n"
      "    VERTCAT({MX})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_horzsplit__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg2 = 0 ;
  casadi::MX m1 ;
  std::vector< casadi_int > m2 ;
  mxArray * _out;
  std::vector< casadi::MX,std::allocator< casadi::MX > > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_horzsplit",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "[" "int" "]" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_horzsplit__SWIG_2((casadi::MX const &)*arg1,(std::vector< long long,std::allocator< long long > > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "MX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_horzsplit'."
      "  Prototype:\n"
      "    HORZSPLIT(MX,[int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_horzsplit__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi_int arg2 = (casadi_int) 1 ;
  casadi::MX m1 ;
  mxArray * _out;
  std::vector< casadi::MX,std::allocator< casadi::MX > > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_horzsplit",argc,2,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  }
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_horzsplit__SWIG_3((casadi::MX const &)*arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "MX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_horzsplit'."
      "  Prototype:\n"
      "    HORZSPLIT(MX,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_horzsplit_n__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi_int arg2 ;
  casadi::MX m1 ;
  mxArray * _out;
  std::vector< casadi::MX,std::allocator< casadi::MX > > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_horzsplit_n",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_horzsplit_n__SWIG_1((casadi::MX const &)*arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "MX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_horzsplit_n'."
      "  Prototype:\n"
      "    HORZSPLIT_N(MX,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_vertsplit__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg2 = 0 ;
  casadi::MX m1 ;
  std::vector< casadi_int > m2 ;
  mxArray * _out;
  std::vector< casadi::MX,std::allocator< casadi::MX > > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_vertsplit",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "[" "int" "]" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_vertsplit__SWIG_2((casadi::MX const &)*arg1,(std::vector< long long,std::allocator< long long > > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "MX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_vertsplit'."
      "  Prototype:\n"
      "    VERTSPLIT(MX,[int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_offset__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< casadi::MX,std::allocator< casadi::MX > > *arg1 = 0 ;
  bool arg2 = (bool) true ;
  std::vector< casadi::MX > m1 ;
  mxArray * _out;
  std::vector< casadi_int,std::allocator< casadi_int > > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_offset",argc,2,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "{" "MX" "}" "'.");
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "bool" "'.");
  }
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_offset__SWIG_1((std::vector< casadi::MX,std::allocator< casadi::MX > > const &)*arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[" "int" "]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_offset'."
      "  Prototype:\n"
      "    OFFSET({MX},bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_vertsplit__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi_int arg2 = (casadi_int) 1 ;
  casadi::MX m1 ;
  mxArray * _out;
  std::vector< casadi::MX,std::allocator< casadi::MX > > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_vertsplit",argc,2,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  }
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_vertsplit__SWIG_3((casadi::MX const &)*arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "MX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_vertsplit'."
      "  Prototype:\n"
      "    VERTSPLIT(MX,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_vertsplit_n__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi_int arg2 ;
  casadi::MX m1 ;
  mxArray * _out;
  std::vector< casadi::MX,std::allocator< casadi::MX > > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_vertsplit_n",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_vertsplit_n__SWIG_1((casadi::MX const &)*arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "MX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_vertsplit_n'."
      "  Prototype:\n"
      "    VERTSPLIT_N(MX,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_blockcat__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::MX *arg3 = 0 ;
  casadi::MX *arg4 = 0 ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  casadi::MX m3 ;
  casadi::MX m4 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_blockcat",argc,4,4,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "MX" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "MX" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_blockcat__SWIG_1((casadi::MX const &)*arg1,(casadi::MX const &)*arg2,(casadi::MX const &)*arg3,(casadi::MX const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_blockcat'."
      "  Prototype:\n"
      "    BLOCKCAT(MX,MX,MX,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_blocksplit__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg2 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg3 = 0 ;
  casadi::MX m1 ;
  std::vector< casadi_int > m2 ;
  std::vector< casadi_int > m3 ;
  mxArray * _out;
  std::vector< std::vector< casadi::MX,std::allocator< casadi::MX > >,std::allocator< std::vector< casadi::MX,std::allocator< casadi::MX > > > > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_blocksplit",argc,3,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "[" "int" "]" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "[" "int" "]" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_blocksplit__SWIG_2((casadi::MX const &)*arg1,(std::vector< long long,std::allocator< long long > > const &)*arg2,(std::vector< long long,std::allocator< long long > > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "{" "MX" "}" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_blocksplit'."
      "  Prototype:\n"
      "    BLOCKSPLIT(MX,[int],[int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_blocksplit__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi_int arg2 = (casadi_int) 1 ;
  casadi_int arg3 = (casadi_int) 1 ;
  casadi::MX m1 ;
  mxArray * _out;
  std::vector< std::vector< casadi::MX,std::allocator< casadi::MX > >,std::allocator< std::vector< casadi::MX,std::allocator< casadi::MX > > > > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_blocksplit",argc,3,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  }
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  }
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_blocksplit__SWIG_3((casadi::MX const &)*arg1,arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "{" "MX" "}" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_blocksplit'."
      "  Prototype:\n"
      "    BLOCKSPLIT(MX,int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_diagcat__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< casadi::MX,std::allocator< casadi::MX > > *arg1 = 0 ;
  std::vector< casadi::MX > m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_diagcat",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "{" "MX" "}" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_diagcat__SWIG_1((std::vector< casadi::MX,std::allocator< casadi::MX > > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_diagcat'."
      "  Prototype:\n"
      "    DIAGCAT({MX})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_diagsplit__SWIG_4(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg2 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg3 = 0 ;
  casadi::MX m1 ;
  std::vector< casadi_int > m2 ;
  std::vector< casadi_int > m3 ;
  mxArray * _out;
  std::vector< casadi::MX,std::allocator< casadi::MX > > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_diagsplit",argc,3,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "[" "int" "]" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "[" "int" "]" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_diagsplit__SWIG_4((casadi::MX const &)*arg1,(std::vector< long long,std::allocator< long long > > const &)*arg2,(std::vector< long long,std::allocator< long long > > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "MX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_diagsplit'."
      "  Prototype:\n"
      "    DIAGSPLIT(MX,[int],[int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_diagsplit__SWIG_5(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg2 = 0 ;
  casadi::MX m1 ;
  std::vector< casadi_int > m2 ;
  mxArray * _out;
  std::vector< casadi::MX,std::allocator< casadi::MX > > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_diagsplit",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "[" "int" "]" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_diagsplit__SWIG_5((casadi::MX const &)*arg1,(std::vector< long long,std::allocator< long long > > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "MX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_diagsplit'."
      "  Prototype:\n"
      "    DIAGSPLIT(MX,[int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_diagsplit__SWIG_6(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi_int arg2 = (casadi_int) 1 ;
  casadi::MX m1 ;
  mxArray * _out;
  std::vector< casadi::MX,std::allocator< casadi::MX > > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_diagsplit",argc,2,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  }
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_diagsplit__SWIG_6((casadi::MX const &)*arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "MX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_diagsplit'."
      "  Prototype:\n"
      "    DIAGSPLIT(MX,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_diagsplit__SWIG_7(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi_int arg2 ;
  casadi_int arg3 ;
  casadi::MX m1 ;
  mxArray * _out;
  std::vector< casadi::MX,std::allocator< casadi::MX > > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_diagsplit",argc,3,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_diagsplit__SWIG_7((casadi::MX const &)*arg1,arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "MX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_diagsplit'."
      "  Prototype:\n"
      "    DIAGSPLIT(MX,int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_veccat__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< casadi::MX,std::allocator< casadi::MX > > *arg1 = 0 ;
  std::vector< casadi::MX > m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_veccat",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "{" "MX" "}" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_veccat__SWIG_1((std::vector< casadi::MX,std::allocator< casadi::MX > > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_veccat'."
      "  Prototype:\n"
      "    VECCAT({MX})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_mtimes__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_mtimes",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_mtimes__SWIG_2((casadi::MX const &)*arg1,(casadi::MX const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_mtimes'."
      "  Prototype:\n"
      "    MTIMES(MX,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_mtimes__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< casadi::MX,std::allocator< casadi::MX > > *arg1 = 0 ;
  std::vector< casadi::MX > m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_mtimes",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "{" "MX" "}" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_mtimes__SWIG_3((std::vector< casadi::MX,std::allocator< casadi::MX > > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_mtimes'."
      "  Prototype:\n"
      "    MTIMES({MX})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_mac__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::MX *arg3 = 0 ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  casadi::MX m3 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_mac",argc,3,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "MX" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_mac__SWIG_1((casadi::MX const &)*arg1,(casadi::MX const &)*arg2,(casadi::MX const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_mac'."
      "  Prototype:\n"
      "    MAC(MX,MX,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_transpose__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_transpose",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_transpose__SWIG_1((casadi::MX const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_transpose'."
      "  Prototype:\n"
      "    TRANSPOSE(MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_vec__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_vec",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_vec__SWIG_1((casadi::MX const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_vec'."
      "  Prototype:\n"
      "    VEC(MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_reshape__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi_int arg2 ;
  casadi_int arg3 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_reshape",argc,3,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_reshape__SWIG_3((casadi::MX const &)*arg1,arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_reshape'."
      "  Prototype:\n"
      "    RESHAPE(MX,int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_reshape__SWIG_4(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  std::pair< casadi_int,casadi_int > arg2 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_reshape",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "[int,int]" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_reshape__SWIG_4((casadi::MX const &)*arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_reshape'."
      "  Prototype:\n"
      "    RESHAPE(MX,[int,int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_reshape__SWIG_5(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::Sparsity *arg2 = 0 ;
  casadi::MX m1 ;
  casadi::Sparsity m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_reshape",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "Sparsity" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_reshape__SWIG_5((casadi::MX const &)*arg1,(casadi::Sparsity const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_reshape'."
      "  Prototype:\n"
      "    RESHAPE(MX,Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_sparsity_cast__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::Sparsity *arg2 = 0 ;
  casadi::MX m1 ;
  casadi::Sparsity m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_sparsity_cast",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "Sparsity" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_sparsity_cast__SWIG_1((casadi::MX const &)*arg1,(casadi::Sparsity const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_sparsity_cast'."
      "  Prototype:\n"
      "    SPARSITY_CAST(MX,Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_sprank__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_sprank",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  {
    try {
      result = (casadi_int)casadi_SparsityInterfaceCommon_casadi_sprank__SWIG_1((casadi::MX const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_sprank'."
      "  Prototype:\n"
      "    SPRANK(MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_norm_0_mul__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_norm_0_mul",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  {
    try {
      result = (casadi_int)casadi_SparsityInterfaceCommon_casadi_norm_0_mul__SWIG_1((casadi::MX const &)*arg1,(casadi::MX const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_norm_0_mul'."
      "  Prototype:\n"
      "    NORM_0_MUL(MX,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_triu__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  bool arg2 = (bool) true ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_triu",argc,2,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "bool" "'.");
  }
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_triu__SWIG_1((casadi::MX const &)*arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_triu'."
      "  Prototype:\n"
      "    TRIU(MX,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_tril__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  bool arg2 = (bool) true ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_tril",argc,2,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "bool" "'.");
  }
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_tril__SWIG_1((casadi::MX const &)*arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_tril'."
      "  Prototype:\n"
      "    TRIL(MX,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_kron__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_kron",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_kron__SWIG_1((casadi::MX const &)*arg1,(casadi::MX const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_kron'."
      "  Prototype:\n"
      "    KRON(MX,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_repmat__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi_int arg2 ;
  casadi_int arg3 = (casadi_int) 1 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_repmat",argc,3,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  }
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_repmat__SWIG_2((casadi::MX const &)*arg1,arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_repmat'."
      "  Prototype:\n"
      "    REPMAT(MX,int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_repmat__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  std::pair< casadi_int,casadi_int > *arg2 = 0 ;
  casadi::MX m1 ;
  std::pair< casadi_int,casadi_int > m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_repmat",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "[int,int]" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_repmat__SWIG_3((casadi::MX const &)*arg1,(std::pair< long long,long long > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_repmat'."
      "  Prototype:\n"
      "    REPMAT(MX,[int,int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_sum2__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_sum2",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_sum2__SWIG_1((casadi::MX const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_sum2'."
      "  Prototype:\n"
      "    SUM2(MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_sum1__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_sum1",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_sum1__SWIG_1((casadi::MX const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_sum1'."
      "  Prototype:\n"
      "    SUM1(MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_length__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_length",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  {
    try {
      result = (casadi_int)casadi_SparsityInterfaceCommon_casadi_length__SWIG_1((casadi::MX const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_length'."
      "  Prototype:\n"
      "    LENGTH(MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_horzcat__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > *arg1 = 0 ;
  std::vector< casadi::Matrix< double > > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_horzcat",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "{" "DM" "}" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_horzcat__SWIG_2((std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_horzcat'."
      "  Prototype:\n"
      "    HORZCAT({DM})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_vertcat__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > *arg1 = 0 ;
  std::vector< casadi::Matrix< double > > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_vertcat",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "{" "DM" "}" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_vertcat__SWIG_2((std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_vertcat'."
      "  Prototype:\n"
      "    VERTCAT({DM})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_horzsplit__SWIG_4(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg2 = 0 ;
  casadi::Matrix< double > m1 ;
  std::vector< casadi_int > m2 ;
  mxArray * _out;
  std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_horzsplit",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "[" "int" "]" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_horzsplit__SWIG_4((casadi::Matrix< double > const &)*arg1,(std::vector< long long,std::allocator< long long > > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "DM" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_horzsplit'."
      "  Prototype:\n"
      "    HORZSPLIT(DM,[int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_horzsplit__SWIG_5(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi_int arg2 = (casadi_int) 1 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_horzsplit",argc,2,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  }
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_horzsplit__SWIG_5((casadi::Matrix< double > const &)*arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "DM" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_horzsplit'."
      "  Prototype:\n"
      "    HORZSPLIT(DM,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_horzsplit_n__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi_int arg2 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_horzsplit_n",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_horzsplit_n__SWIG_2((casadi::Matrix< double > const &)*arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "DM" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_horzsplit_n'."
      "  Prototype:\n"
      "    HORZSPLIT_N(DM,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_vertsplit__SWIG_4(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg2 = 0 ;
  casadi::Matrix< double > m1 ;
  std::vector< casadi_int > m2 ;
  mxArray * _out;
  std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_vertsplit",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "[" "int" "]" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_vertsplit__SWIG_4((casadi::Matrix< double > const &)*arg1,(std::vector< long long,std::allocator< long long > > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "DM" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_vertsplit'."
      "  Prototype:\n"
      "    VERTSPLIT(DM,[int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_offset__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > *arg1 = 0 ;
  bool arg2 = (bool) true ;
  std::vector< casadi::Matrix< double > > m1 ;
  mxArray * _out;
  std::vector< casadi_int,std::allocator< casadi_int > > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_offset",argc,2,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "{" "DM" "}" "'.");
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "bool" "'.");
  }
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_offset__SWIG_2((std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > const &)*arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[" "int" "]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_offset'."
      "  Prototype:\n"
      "    OFFSET({DM},bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_vertsplit__SWIG_5(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi_int arg2 = (casadi_int) 1 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_vertsplit",argc,2,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  }
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_vertsplit__SWIG_5((casadi::Matrix< double > const &)*arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "DM" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_vertsplit'."
      "  Prototype:\n"
      "    VERTSPLIT(DM,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_vertsplit_n__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi_int arg2 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_vertsplit_n",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_vertsplit_n__SWIG_2((casadi::Matrix< double > const &)*arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "DM" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_vertsplit_n'."
      "  Prototype:\n"
      "    VERTSPLIT_N(DM,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_blockcat__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > *arg3 = 0 ;
  casadi::Matrix< double > *arg4 = 0 ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  casadi::Matrix< double > m3 ;
  casadi::Matrix< double > m4 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_blockcat",argc,4,4,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "DM" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "DM" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_blockcat__SWIG_2((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2,(casadi::Matrix< double > const &)*arg3,(casadi::Matrix< double > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_blockcat'."
      "  Prototype:\n"
      "    BLOCKCAT(DM,DM,DM,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_blocksplit__SWIG_4(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg2 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg3 = 0 ;
  casadi::Matrix< double > m1 ;
  std::vector< casadi_int > m2 ;
  std::vector< casadi_int > m3 ;
  mxArray * _out;
  std::vector< std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > >,std::allocator< std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > > > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_blocksplit",argc,3,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "[" "int" "]" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "[" "int" "]" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_blocksplit__SWIG_4((casadi::Matrix< double > const &)*arg1,(std::vector< long long,std::allocator< long long > > const &)*arg2,(std::vector< long long,std::allocator< long long > > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "{" "DM" "}" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_blocksplit'."
      "  Prototype:\n"
      "    BLOCKSPLIT(DM,[int],[int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_blocksplit__SWIG_5(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi_int arg2 = (casadi_int) 1 ;
  casadi_int arg3 = (casadi_int) 1 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  std::vector< std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > >,std::allocator< std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > > > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_blocksplit",argc,3,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  }
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  }
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_blocksplit__SWIG_5((casadi::Matrix< double > const &)*arg1,arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "{" "DM" "}" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_blocksplit'."
      "  Prototype:\n"
      "    BLOCKSPLIT(DM,int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_diagcat__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > *arg1 = 0 ;
  std::vector< casadi::Matrix< double > > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_diagcat",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "{" "DM" "}" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_diagcat__SWIG_2((std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_diagcat'."
      "  Prototype:\n"
      "    DIAGCAT({DM})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_diagsplit__SWIG_8(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg2 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg3 = 0 ;
  casadi::Matrix< double > m1 ;
  std::vector< casadi_int > m2 ;
  std::vector< casadi_int > m3 ;
  mxArray * _out;
  std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_diagsplit",argc,3,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "[" "int" "]" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "[" "int" "]" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_diagsplit__SWIG_8((casadi::Matrix< double > const &)*arg1,(std::vector< long long,std::allocator< long long > > const &)*arg2,(std::vector< long long,std::allocator< long long > > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "DM" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_diagsplit'."
      "  Prototype:\n"
      "    DIAGSPLIT(DM,[int],[int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_diagsplit__SWIG_9(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg2 = 0 ;
  casadi::Matrix< double > m1 ;
  std::vector< casadi_int > m2 ;
  mxArray * _out;
  std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_diagsplit",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "[" "int" "]" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_diagsplit__SWIG_9((casadi::Matrix< double > const &)*arg1,(std::vector< long long,std::allocator< long long > > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "DM" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_diagsplit'."
      "  Prototype:\n"
      "    DIAGSPLIT(DM,[int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_diagsplit__SWIG_10(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi_int arg2 = (casadi_int) 1 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_diagsplit",argc,2,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  }
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_diagsplit__SWIG_10((casadi::Matrix< double > const &)*arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "DM" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_diagsplit'."
      "  Prototype:\n"
      "    DIAGSPLIT(DM,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_diagsplit__SWIG_11(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi_int arg2 ;
  casadi_int arg3 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_diagsplit",argc,3,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_diagsplit__SWIG_11((casadi::Matrix< double > const &)*arg1,arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "DM" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_diagsplit'."
      "  Prototype:\n"
      "    DIAGSPLIT(DM,int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_veccat__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > *arg1 = 0 ;
  std::vector< casadi::Matrix< double > > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_veccat",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "{" "DM" "}" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_veccat__SWIG_2((std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_veccat'."
      "  Prototype:\n"
      "    VECCAT({DM})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_mtimes__SWIG_4(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_mtimes",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_mtimes__SWIG_4((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_mtimes'."
      "  Prototype:\n"
      "    MTIMES(DM,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_mtimes__SWIG_5(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > *arg1 = 0 ;
  std::vector< casadi::Matrix< double > > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_mtimes",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "{" "DM" "}" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_mtimes__SWIG_5((std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_mtimes'."
      "  Prototype:\n"
      "    MTIMES({DM})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_mac__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > *arg3 = 0 ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  casadi::Matrix< double > m3 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_mac",argc,3,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "DM" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_mac__SWIG_2((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2,(casadi::Matrix< double > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_mac'."
      "  Prototype:\n"
      "    MAC(DM,DM,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_transpose__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_transpose",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_transpose__SWIG_2((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_transpose'."
      "  Prototype:\n"
      "    TRANSPOSE(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_vec__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_vec",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_vec__SWIG_2((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_vec'."
      "  Prototype:\n"
      "    VEC(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_reshape__SWIG_6(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi_int arg2 ;
  casadi_int arg3 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_reshape",argc,3,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_reshape__SWIG_6((casadi::Matrix< double > const &)*arg1,arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_reshape'."
      "  Prototype:\n"
      "    RESHAPE(DM,int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_reshape__SWIG_7(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  std::pair< casadi_int,casadi_int > arg2 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_reshape",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "[int,int]" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_reshape__SWIG_7((casadi::Matrix< double > const &)*arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_reshape'."
      "  Prototype:\n"
      "    RESHAPE(DM,[int,int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_reshape__SWIG_8(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Sparsity *arg2 = 0 ;
  casadi::Matrix< double > m1 ;
  casadi::Sparsity m2 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_reshape",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "Sparsity" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_reshape__SWIG_8((casadi::Matrix< double > const &)*arg1,(casadi::Sparsity const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_reshape'."
      "  Prototype:\n"
      "    RESHAPE(DM,Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_sparsity_cast__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Sparsity *arg2 = 0 ;
  casadi::Matrix< double > m1 ;
  casadi::Sparsity m2 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_sparsity_cast",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "Sparsity" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_sparsity_cast__SWIG_2((casadi::Matrix< double > const &)*arg1,(casadi::Sparsity const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_sparsity_cast'."
      "  Prototype:\n"
      "    SPARSITY_CAST(DM,Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_sprank__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_sprank",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = (casadi_int)casadi_SparsityInterfaceCommon_casadi_sprank__SWIG_2((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_sprank'."
      "  Prototype:\n"
      "    SPRANK(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_norm_0_mul__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_norm_0_mul",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  {
    try {
      result = (casadi_int)casadi_SparsityInterfaceCommon_casadi_norm_0_mul__SWIG_2((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_norm_0_mul'."
      "  Prototype:\n"
      "    NORM_0_MUL(DM,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_triu__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  bool arg2 = (bool) true ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_triu",argc,2,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "bool" "'.");
  }
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_triu__SWIG_2((casadi::Matrix< double > const &)*arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_triu'."
      "  Prototype:\n"
      "    TRIU(DM,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_tril__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  bool arg2 = (bool) true ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_tril",argc,2,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "bool" "'.");
  }
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_tril__SWIG_2((casadi::Matrix< double > const &)*arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_tril'."
      "  Prototype:\n"
      "    TRIL(DM,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_kron__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_kron",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_kron__SWIG_2((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_kron'."
      "  Prototype:\n"
      "    KRON(DM,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_repmat__SWIG_4(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi_int arg2 ;
  casadi_int arg3 = (casadi_int) 1 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_repmat",argc,3,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  }
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_repmat__SWIG_4((casadi::Matrix< double > const &)*arg1,arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_repmat'."
      "  Prototype:\n"
      "    REPMAT(DM,int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_repmat__SWIG_5(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  std::pair< casadi_int,casadi_int > *arg2 = 0 ;
  casadi::Matrix< double > m1 ;
  std::pair< casadi_int,casadi_int > m2 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_repmat",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "[int,int]" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_repmat__SWIG_5((casadi::Matrix< double > const &)*arg1,(std::pair< long long,long long > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_repmat'."
      "  Prototype:\n"
      "    REPMAT(DM,[int,int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_sum2__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_sum2",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_sum2__SWIG_2((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_sum2'."
      "  Prototype:\n"
      "    SUM2(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_sum1__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_sum1",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_sum1__SWIG_2((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_sum1'."
      "  Prototype:\n"
      "    SUM1(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_length__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_length",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = (casadi_int)casadi_SparsityInterfaceCommon_casadi_length__SWIG_2((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_length'."
      "  Prototype:\n"
      "    LENGTH(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_horzcat__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > *arg1 = 0 ;
  std::vector< casadi::Matrix< casadi::SXElem > > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_horzcat",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "{" "SX" "}" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_horzcat__SWIG_3((std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_horzcat'."
      "  Prototype:\n"
      "    HORZCAT({SX})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_horzcat(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::vector< casadi::Sparsity> **>(0));
    if (_v) {
      return _wrap_SparsityInterfaceCommon_horzcat__SWIG_0(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::vector< casadi::Matrix<double> > **>(0));
    if (_v) {
      return _wrap_SparsityInterfaceCommon_horzcat__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::vector< casadi::Matrix<casadi::SXElem> > **>(0));
    if (_v) {
      return _wrap_SparsityInterfaceCommon_horzcat__SWIG_3(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::vector<casadi::MX> **>(0));
    if (_v) {
      return _wrap_SparsityInterfaceCommon_horzcat__SWIG_1(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_horzcat'."
    "  Possible prototypes are:\n"
    "    HORZCAT({Sparsity})\n"
    "    HORZCAT({DM})\n"
    "    HORZCAT({SX})\n"
    "    HORZCAT({MX})\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_SparsityInterfaceCommon_vertcat__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > *arg1 = 0 ;
  std::vector< casadi::Matrix< casadi::SXElem > > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_vertcat",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "{" "SX" "}" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_vertcat__SWIG_3((std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_vertcat'."
      "  Prototype:\n"
      "    VERTCAT({SX})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_vertcat(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::vector< casadi::Sparsity> **>(0));
    if (_v) {
      return _wrap_SparsityInterfaceCommon_vertcat__SWIG_0(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::vector< casadi::Matrix<double> > **>(0));
    if (_v) {
      return _wrap_SparsityInterfaceCommon_vertcat__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::vector< casadi::Matrix<casadi::SXElem> > **>(0));
    if (_v) {
      return _wrap_SparsityInterfaceCommon_vertcat__SWIG_3(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::vector<casadi::MX> **>(0));
    if (_v) {
      return _wrap_SparsityInterfaceCommon_vertcat__SWIG_1(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_vertcat'."
    "  Possible prototypes are:\n"
    "    VERTCAT({Sparsity})\n"
    "    VERTCAT({DM})\n"
    "    VERTCAT({SX})\n"
    "    VERTCAT({MX})\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_SparsityInterfaceCommon_horzsplit__SWIG_6(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  std::vector< casadi_int > m2 ;
  mxArray * _out;
  std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_horzsplit",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "[" "int" "]" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_horzsplit__SWIG_6((casadi::Matrix< casadi::SXElem > const &)*arg1,(std::vector< long long,std::allocator< long long > > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "SX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_horzsplit'."
      "  Prototype:\n"
      "    HORZSPLIT(SX,[int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_horzsplit__SWIG_7(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi_int arg2 = (casadi_int) 1 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_horzsplit",argc,2,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  }
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_horzsplit__SWIG_7((casadi::Matrix< casadi::SXElem > const &)*arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "SX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_horzsplit'."
      "  Prototype:\n"
      "    HORZSPLIT(SX,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_horzsplit(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 1) && (argc <= 2)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Sparsity **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_SparsityInterfaceCommon_horzsplit__SWIG_1(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_horzsplit__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if ((argc >= 1) && (argc <= 2)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_SparsityInterfaceCommon_horzsplit__SWIG_5(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_horzsplit__SWIG_5(resc,resv,argc,argv);
      }
    }
  }
  if ((argc >= 1) && (argc <= 2)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_SparsityInterfaceCommon_horzsplit__SWIG_7(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_horzsplit__SWIG_7(resc,resv,argc,argv);
      }
    }
  }
  if ((argc >= 1) && (argc <= 2)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_SparsityInterfaceCommon_horzsplit__SWIG_3(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_horzsplit__SWIG_3(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Sparsity **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<casadi_int> **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_horzsplit__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<casadi_int> **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_horzsplit__SWIG_4(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<casadi_int> **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_horzsplit__SWIG_6(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<casadi_int> **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_horzsplit__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_horzsplit'."
    "  Possible prototypes are:\n"
    "    HORZSPLIT(Sparsity,int)\n"
    "    HORZSPLIT(DM,int)\n"
    "    HORZSPLIT(SX,int)\n"
    "    HORZSPLIT(MX,int)\n"
    "    HORZSPLIT(Sparsity,[int])\n"
    "    HORZSPLIT(DM,[int])\n"
    "    HORZSPLIT(SX,[int])\n"
    "    HORZSPLIT(MX,[int])\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_SparsityInterfaceCommon_horzsplit_n__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi_int arg2 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_horzsplit_n",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_horzsplit_n__SWIG_3((casadi::Matrix< casadi::SXElem > const &)*arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "SX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_horzsplit_n'."
      "  Prototype:\n"
      "    HORZSPLIT_N(SX,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_horzsplit_n(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Sparsity **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_horzsplit_n__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_horzsplit_n__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_horzsplit_n__SWIG_3(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_horzsplit_n__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_horzsplit_n'."
    "  Possible prototypes are:\n"
    "    HORZSPLIT_N(Sparsity,int)\n"
    "    HORZSPLIT_N(DM,int)\n"
    "    HORZSPLIT_N(SX,int)\n"
    "    HORZSPLIT_N(MX,int)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_SparsityInterfaceCommon_vertsplit__SWIG_6(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  std::vector< casadi_int > m2 ;
  mxArray * _out;
  std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_vertsplit",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "[" "int" "]" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_vertsplit__SWIG_6((casadi::Matrix< casadi::SXElem > const &)*arg1,(std::vector< long long,std::allocator< long long > > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "SX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_vertsplit'."
      "  Prototype:\n"
      "    VERTSPLIT(SX,[int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_offset__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > *arg1 = 0 ;
  bool arg2 = (bool) true ;
  std::vector< casadi::Matrix< casadi::SXElem > > m1 ;
  mxArray * _out;
  std::vector< casadi_int,std::allocator< casadi_int > > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_offset",argc,2,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "{" "SX" "}" "'.");
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "bool" "'.");
  }
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_offset__SWIG_3((std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > const &)*arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[" "int" "]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_offset'."
      "  Prototype:\n"
      "    OFFSET({SX},bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_offset(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 1) && (argc <= 2)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::vector< casadi::Sparsity> **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_SparsityInterfaceCommon_offset__SWIG_0(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< bool **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_offset__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  if ((argc >= 1) && (argc <= 2)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::vector< casadi::Matrix<double> > **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_SparsityInterfaceCommon_offset__SWIG_2(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< bool **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_offset__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if ((argc >= 1) && (argc <= 2)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::vector< casadi::Matrix<casadi::SXElem> > **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_SparsityInterfaceCommon_offset__SWIG_3(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< bool **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_offset__SWIG_3(resc,resv,argc,argv);
      }
    }
  }
  if ((argc >= 1) && (argc <= 2)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::vector<casadi::MX> **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_SparsityInterfaceCommon_offset__SWIG_1(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< bool **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_offset__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_offset'."
    "  Possible prototypes are:\n"
    "    OFFSET({Sparsity},bool)\n"
    "    OFFSET({DM},bool)\n"
    "    OFFSET({SX},bool)\n"
    "    OFFSET({MX},bool)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_SparsityInterfaceCommon_vertsplit__SWIG_7(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi_int arg2 = (casadi_int) 1 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_vertsplit",argc,2,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  }
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_vertsplit__SWIG_7((casadi::Matrix< casadi::SXElem > const &)*arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "SX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_vertsplit'."
      "  Prototype:\n"
      "    VERTSPLIT(SX,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_vertsplit(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 1) && (argc <= 2)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Sparsity **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_SparsityInterfaceCommon_vertsplit__SWIG_1(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_vertsplit__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if ((argc >= 1) && (argc <= 2)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_SparsityInterfaceCommon_vertsplit__SWIG_5(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_vertsplit__SWIG_5(resc,resv,argc,argv);
      }
    }
  }
  if ((argc >= 1) && (argc <= 2)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_SparsityInterfaceCommon_vertsplit__SWIG_7(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_vertsplit__SWIG_7(resc,resv,argc,argv);
      }
    }
  }
  if ((argc >= 1) && (argc <= 2)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_SparsityInterfaceCommon_vertsplit__SWIG_3(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_vertsplit__SWIG_3(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Sparsity **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<casadi_int> **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_vertsplit__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<casadi_int> **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_vertsplit__SWIG_4(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<casadi_int> **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_vertsplit__SWIG_6(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<casadi_int> **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_vertsplit__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_vertsplit'."
    "  Possible prototypes are:\n"
    "    VERTSPLIT(Sparsity,int)\n"
    "    VERTSPLIT(DM,int)\n"
    "    VERTSPLIT(SX,int)\n"
    "    VERTSPLIT(MX,int)\n"
    "    VERTSPLIT(Sparsity,[int])\n"
    "    VERTSPLIT(DM,[int])\n"
    "    VERTSPLIT(SX,[int])\n"
    "    VERTSPLIT(MX,[int])\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_SparsityInterfaceCommon_vertsplit_n__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi_int arg2 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_vertsplit_n",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_vertsplit_n__SWIG_3((casadi::Matrix< casadi::SXElem > const &)*arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "SX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_vertsplit_n'."
      "  Prototype:\n"
      "    VERTSPLIT_N(SX,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_vertsplit_n(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Sparsity **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_vertsplit_n__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_vertsplit_n__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_vertsplit_n__SWIG_3(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_vertsplit_n__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_vertsplit_n'."
    "  Possible prototypes are:\n"
    "    VERTSPLIT_N(Sparsity,int)\n"
    "    VERTSPLIT_N(DM,int)\n"
    "    VERTSPLIT_N(SX,int)\n"
    "    VERTSPLIT_N(MX,int)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_SparsityInterfaceCommon_blockcat__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg3 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg4 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  casadi::Matrix< casadi::SXElem > m3 ;
  casadi::Matrix< casadi::SXElem > m4 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_blockcat",argc,4,4,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "SX" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "SX" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_blockcat__SWIG_3((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2,(casadi::Matrix< casadi::SXElem > const &)*arg3,(casadi::Matrix< casadi::SXElem > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_blockcat'."
      "  Prototype:\n"
      "    BLOCKCAT(SX,SX,SX,SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_blockcat(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 4) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Sparsity **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Sparsity **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Sparsity **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::Sparsity **>(0));
          if (_v) {
            return _wrap_SparsityInterfaceCommon_blockcat__SWIG_0(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<double> **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::Matrix<double> **>(0));
          if (_v) {
            return _wrap_SparsityInterfaceCommon_blockcat__SWIG_2(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
          if (_v) {
            return _wrap_SparsityInterfaceCommon_blockcat__SWIG_3(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::MX **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::MX **>(0));
          if (_v) {
            return _wrap_SparsityInterfaceCommon_blockcat__SWIG_1(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_blockcat'."
    "  Possible prototypes are:\n"
    "    BLOCKCAT(Sparsity,Sparsity,Sparsity,Sparsity)\n"
    "    BLOCKCAT(DM,DM,DM,DM)\n"
    "    BLOCKCAT(SX,SX,SX,SX)\n"
    "    BLOCKCAT(MX,MX,MX,MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_SparsityInterfaceCommon_blocksplit__SWIG_6(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg2 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg3 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  std::vector< casadi_int > m2 ;
  std::vector< casadi_int > m3 ;
  mxArray * _out;
  std::vector< std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > >,std::allocator< std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > > > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_blocksplit",argc,3,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "[" "int" "]" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "[" "int" "]" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_blocksplit__SWIG_6((casadi::Matrix< casadi::SXElem > const &)*arg1,(std::vector< long long,std::allocator< long long > > const &)*arg2,(std::vector< long long,std::allocator< long long > > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "{" "SX" "}" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_blocksplit'."
      "  Prototype:\n"
      "    BLOCKSPLIT(SX,[int],[int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_blocksplit__SWIG_7(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi_int arg2 = (casadi_int) 1 ;
  casadi_int arg3 = (casadi_int) 1 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  std::vector< std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > >,std::allocator< std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > > > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_blocksplit",argc,3,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  }
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  }
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_blocksplit__SWIG_7((casadi::Matrix< casadi::SXElem > const &)*arg1,arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "{" "SX" "}" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_blocksplit'."
      "  Prototype:\n"
      "    BLOCKSPLIT(SX,int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_blocksplit(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 1) && (argc <= 3)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Sparsity **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_SparsityInterfaceCommon_blocksplit__SWIG_1(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_SparsityInterfaceCommon_blocksplit__SWIG_1(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          return _wrap_SparsityInterfaceCommon_blocksplit__SWIG_1(resc,resv,argc,argv);
        }
      }
    }
  }
  if ((argc >= 1) && (argc <= 3)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_SparsityInterfaceCommon_blocksplit__SWIG_5(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_SparsityInterfaceCommon_blocksplit__SWIG_5(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          return _wrap_SparsityInterfaceCommon_blocksplit__SWIG_5(resc,resv,argc,argv);
        }
      }
    }
  }
  if ((argc >= 1) && (argc <= 3)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_SparsityInterfaceCommon_blocksplit__SWIG_7(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_SparsityInterfaceCommon_blocksplit__SWIG_7(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          return _wrap_SparsityInterfaceCommon_blocksplit__SWIG_7(resc,resv,argc,argv);
        }
      }
    }
  }
  if ((argc >= 1) && (argc <= 3)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_SparsityInterfaceCommon_blocksplit__SWIG_3(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_SparsityInterfaceCommon_blocksplit__SWIG_3(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          return _wrap_SparsityInterfaceCommon_blocksplit__SWIG_3(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Sparsity **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<casadi_int> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::vector<casadi_int> **>(0));
        if (_v) {
          return _wrap_SparsityInterfaceCommon_blocksplit__SWIG_0(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<casadi_int> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::vector<casadi_int> **>(0));
        if (_v) {
          return _wrap_SparsityInterfaceCommon_blocksplit__SWIG_4(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<casadi_int> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::vector<casadi_int> **>(0));
        if (_v) {
          return _wrap_SparsityInterfaceCommon_blocksplit__SWIG_6(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<casadi_int> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::vector<casadi_int> **>(0));
        if (_v) {
          return _wrap_SparsityInterfaceCommon_blocksplit__SWIG_2(resc,resv,argc,argv);
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_blocksplit'."
    "  Possible prototypes are:\n"
    "    BLOCKSPLIT(Sparsity,int,int)\n"
    "    BLOCKSPLIT(DM,int,int)\n"
    "    BLOCKSPLIT(SX,int,int)\n"
    "    BLOCKSPLIT(MX,int,int)\n"
    "    BLOCKSPLIT(Sparsity,[int],[int])\n"
    "    BLOCKSPLIT(DM,[int],[int])\n"
    "    BLOCKSPLIT(SX,[int],[int])\n"
    "    BLOCKSPLIT(MX,[int],[int])\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_SparsityInterfaceCommon_diagcat__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > *arg1 = 0 ;
  std::vector< casadi::Matrix< casadi::SXElem > > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_diagcat",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "{" "SX" "}" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_diagcat__SWIG_3((std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_diagcat'."
      "  Prototype:\n"
      "    DIAGCAT({SX})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_diagcat(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::vector< casadi::Sparsity> **>(0));
    if (_v) {
      return _wrap_SparsityInterfaceCommon_diagcat__SWIG_0(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::vector< casadi::Matrix<double> > **>(0));
    if (_v) {
      return _wrap_SparsityInterfaceCommon_diagcat__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::vector< casadi::Matrix<casadi::SXElem> > **>(0));
    if (_v) {
      return _wrap_SparsityInterfaceCommon_diagcat__SWIG_3(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::vector<casadi::MX> **>(0));
    if (_v) {
      return _wrap_SparsityInterfaceCommon_diagcat__SWIG_1(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_diagcat'."
    "  Possible prototypes are:\n"
    "    DIAGCAT({Sparsity})\n"
    "    DIAGCAT({DM})\n"
    "    DIAGCAT({SX})\n"
    "    DIAGCAT({MX})\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_SparsityInterfaceCommon_diagsplit__SWIG_12(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg2 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg3 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  std::vector< casadi_int > m2 ;
  std::vector< casadi_int > m3 ;
  mxArray * _out;
  std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_diagsplit",argc,3,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "[" "int" "]" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "[" "int" "]" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_diagsplit__SWIG_12((casadi::Matrix< casadi::SXElem > const &)*arg1,(std::vector< long long,std::allocator< long long > > const &)*arg2,(std::vector< long long,std::allocator< long long > > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "SX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_diagsplit'."
      "  Prototype:\n"
      "    DIAGSPLIT(SX,[int],[int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_diagsplit__SWIG_13(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  std::vector< casadi_int > m2 ;
  mxArray * _out;
  std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_diagsplit",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "[" "int" "]" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_diagsplit__SWIG_13((casadi::Matrix< casadi::SXElem > const &)*arg1,(std::vector< long long,std::allocator< long long > > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "SX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_diagsplit'."
      "  Prototype:\n"
      "    DIAGSPLIT(SX,[int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_diagsplit__SWIG_14(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi_int arg2 = (casadi_int) 1 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_diagsplit",argc,2,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  }
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_diagsplit__SWIG_14((casadi::Matrix< casadi::SXElem > const &)*arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "SX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_diagsplit'."
      "  Prototype:\n"
      "    DIAGSPLIT(SX,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_diagsplit__SWIG_15(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi_int arg2 ;
  casadi_int arg3 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_diagsplit",argc,3,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_diagsplit__SWIG_15((casadi::Matrix< casadi::SXElem > const &)*arg1,arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "SX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_diagsplit'."
      "  Prototype:\n"
      "    DIAGSPLIT(SX,int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_diagsplit(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 1) && (argc <= 2)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Sparsity **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_SparsityInterfaceCommon_diagsplit__SWIG_2(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_diagsplit__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if ((argc >= 1) && (argc <= 2)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_SparsityInterfaceCommon_diagsplit__SWIG_10(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_diagsplit__SWIG_10(resc,resv,argc,argv);
      }
    }
  }
  if ((argc >= 1) && (argc <= 2)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_SparsityInterfaceCommon_diagsplit__SWIG_14(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_diagsplit__SWIG_14(resc,resv,argc,argv);
      }
    }
  }
  if ((argc >= 1) && (argc <= 2)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_SparsityInterfaceCommon_diagsplit__SWIG_6(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_diagsplit__SWIG_6(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Sparsity **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<casadi_int> **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_diagsplit__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<casadi_int> **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_diagsplit__SWIG_9(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<casadi_int> **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_diagsplit__SWIG_13(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<casadi_int> **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_diagsplit__SWIG_5(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 3) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Sparsity **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          return _wrap_SparsityInterfaceCommon_diagsplit__SWIG_3(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Sparsity **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<casadi_int> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::vector<casadi_int> **>(0));
        if (_v) {
          return _wrap_SparsityInterfaceCommon_diagsplit__SWIG_0(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          return _wrap_SparsityInterfaceCommon_diagsplit__SWIG_11(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<casadi_int> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::vector<casadi_int> **>(0));
        if (_v) {
          return _wrap_SparsityInterfaceCommon_diagsplit__SWIG_8(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          return _wrap_SparsityInterfaceCommon_diagsplit__SWIG_15(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<casadi_int> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::vector<casadi_int> **>(0));
        if (_v) {
          return _wrap_SparsityInterfaceCommon_diagsplit__SWIG_12(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          return _wrap_SparsityInterfaceCommon_diagsplit__SWIG_7(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<casadi_int> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::vector<casadi_int> **>(0));
        if (_v) {
          return _wrap_SparsityInterfaceCommon_diagsplit__SWIG_4(resc,resv,argc,argv);
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_diagsplit'."
    "  Possible prototypes are:\n"
    "    DIAGSPLIT(Sparsity,int)\n"
    "    DIAGSPLIT(DM,int)\n"
    "    DIAGSPLIT(SX,int)\n"
    "    DIAGSPLIT(MX,int)\n"
    "    DIAGSPLIT(Sparsity,[int])\n"
    "    DIAGSPLIT(DM,[int])\n"
    "    DIAGSPLIT(SX,[int])\n"
    "    DIAGSPLIT(MX,[int])\n"
    "    DIAGSPLIT(Sparsity,int,int)\n"
    "    DIAGSPLIT(Sparsity,[int],[int])\n"
    "    DIAGSPLIT(DM,int,int)\n"
    "    DIAGSPLIT(DM,[int],[int])\n"
    "    DIAGSPLIT(SX,int,int)\n"
    "    DIAGSPLIT(SX,[int],[int])\n"
    "    DIAGSPLIT(MX,int,int)\n"
    "    DIAGSPLIT(MX,[int],[int])\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_SparsityInterfaceCommon_veccat__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > *arg1 = 0 ;
  std::vector< casadi::Matrix< casadi::SXElem > > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_veccat",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "{" "SX" "}" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_veccat__SWIG_3((std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_veccat'."
      "  Prototype:\n"
      "    VECCAT({SX})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_veccat(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::vector< casadi::Sparsity> **>(0));
    if (_v) {
      return _wrap_SparsityInterfaceCommon_veccat__SWIG_0(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::vector< casadi::Matrix<double> > **>(0));
    if (_v) {
      return _wrap_SparsityInterfaceCommon_veccat__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::vector< casadi::Matrix<casadi::SXElem> > **>(0));
    if (_v) {
      return _wrap_SparsityInterfaceCommon_veccat__SWIG_3(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::vector<casadi::MX> **>(0));
    if (_v) {
      return _wrap_SparsityInterfaceCommon_veccat__SWIG_1(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_veccat'."
    "  Possible prototypes are:\n"
    "    VECCAT({Sparsity})\n"
    "    VECCAT({DM})\n"
    "    VECCAT({SX})\n"
    "    VECCAT({MX})\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_SparsityInterfaceCommon_mtimes__SWIG_6(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_mtimes",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_mtimes__SWIG_6((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_mtimes'."
      "  Prototype:\n"
      "    MTIMES(SX,SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_mtimes__SWIG_7(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > *arg1 = 0 ;
  std::vector< casadi::Matrix< casadi::SXElem > > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_mtimes",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "{" "SX" "}" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_mtimes__SWIG_7((std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_mtimes'."
      "  Prototype:\n"
      "    MTIMES({SX})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_mtimes(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::vector< casadi::Sparsity> **>(0));
    if (_v) {
      return _wrap_SparsityInterfaceCommon_mtimes__SWIG_1(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::vector< casadi::Matrix<double> > **>(0));
    if (_v) {
      return _wrap_SparsityInterfaceCommon_mtimes__SWIG_5(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::vector< casadi::Matrix<casadi::SXElem> > **>(0));
    if (_v) {
      return _wrap_SparsityInterfaceCommon_mtimes__SWIG_7(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::vector<casadi::MX> **>(0));
    if (_v) {
      return _wrap_SparsityInterfaceCommon_mtimes__SWIG_3(resc,resv,argc,argv);
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Sparsity **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Sparsity **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_mtimes__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_mtimes__SWIG_4(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_mtimes__SWIG_6(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_mtimes__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_mtimes'."
    "  Possible prototypes are:\n"
    "    MTIMES({Sparsity})\n"
    "    MTIMES({DM})\n"
    "    MTIMES({SX})\n"
    "    MTIMES({MX})\n"
    "    MTIMES(Sparsity,Sparsity)\n"
    "    MTIMES(DM,DM)\n"
    "    MTIMES(SX,SX)\n"
    "    MTIMES(MX,MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_SparsityInterfaceCommon_mac__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg3 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  casadi::Matrix< casadi::SXElem > m3 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_mac",argc,3,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "SX" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_mac__SWIG_3((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2,(casadi::Matrix< casadi::SXElem > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_mac'."
      "  Prototype:\n"
      "    MAC(SX,SX,SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_mac(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 3) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Sparsity **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Sparsity **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Sparsity **>(0));
        if (_v) {
          return _wrap_SparsityInterfaceCommon_mac__SWIG_0(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<double> **>(0));
        if (_v) {
          return _wrap_SparsityInterfaceCommon_mac__SWIG_2(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
        if (_v) {
          return _wrap_SparsityInterfaceCommon_mac__SWIG_3(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::MX **>(0));
        if (_v) {
          return _wrap_SparsityInterfaceCommon_mac__SWIG_1(resc,resv,argc,argv);
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_mac'."
    "  Possible prototypes are:\n"
    "    MAC(Sparsity,Sparsity,Sparsity)\n"
    "    MAC(DM,DM,DM)\n"
    "    MAC(SX,SX,SX)\n"
    "    MAC(MX,MX,MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_SparsityInterfaceCommon_transpose__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_transpose",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_transpose__SWIG_3((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_transpose'."
      "  Prototype:\n"
      "    TRANSPOSE(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_transpose(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Sparsity **>(0));
    if (_v) {
      return _wrap_SparsityInterfaceCommon_transpose__SWIG_0(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_SparsityInterfaceCommon_transpose__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_SparsityInterfaceCommon_transpose__SWIG_3(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      return _wrap_SparsityInterfaceCommon_transpose__SWIG_1(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_transpose'."
    "  Possible prototypes are:\n"
    "    TRANSPOSE(Sparsity)\n"
    "    TRANSPOSE(DM)\n"
    "    TRANSPOSE(SX)\n"
    "    TRANSPOSE(MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_SparsityInterfaceCommon_vec__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_vec",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_vec__SWIG_3((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_vec'."
      "  Prototype:\n"
      "    VEC(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_vec(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Sparsity **>(0));
    if (_v) {
      return _wrap_SparsityInterfaceCommon_vec__SWIG_0(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_SparsityInterfaceCommon_vec__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_SparsityInterfaceCommon_vec__SWIG_3(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      return _wrap_SparsityInterfaceCommon_vec__SWIG_1(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_vec'."
    "  Possible prototypes are:\n"
    "    VEC(Sparsity)\n"
    "    VEC(DM)\n"
    "    VEC(SX)\n"
    "    VEC(MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_SparsityInterfaceCommon_reshape__SWIG_9(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi_int arg2 ;
  casadi_int arg3 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_reshape",argc,3,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_reshape__SWIG_9((casadi::Matrix< casadi::SXElem > const &)*arg1,arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_reshape'."
      "  Prototype:\n"
      "    RESHAPE(SX,int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_reshape__SWIG_10(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  std::pair< casadi_int,casadi_int > arg2 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_reshape",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "[int,int]" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_reshape__SWIG_10((casadi::Matrix< casadi::SXElem > const &)*arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_reshape'."
      "  Prototype:\n"
      "    RESHAPE(SX,[int,int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_reshape__SWIG_11(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Sparsity *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Sparsity m2 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_reshape",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "Sparsity" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_reshape__SWIG_11((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Sparsity const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_reshape'."
      "  Prototype:\n"
      "    RESHAPE(SX,Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_reshape(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Sparsity **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::pair<casadi_int,casadi_int> **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_reshape__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Sparsity **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Sparsity **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_reshape__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::pair<casadi_int,casadi_int> **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_reshape__SWIG_7(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Sparsity **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_reshape__SWIG_8(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::pair<casadi_int,casadi_int> **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_reshape__SWIG_10(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Sparsity **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_reshape__SWIG_11(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::pair<casadi_int,casadi_int> **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_reshape__SWIG_4(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Sparsity **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_reshape__SWIG_5(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 3) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Sparsity **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          return _wrap_SparsityInterfaceCommon_reshape__SWIG_0(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          return _wrap_SparsityInterfaceCommon_reshape__SWIG_6(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          return _wrap_SparsityInterfaceCommon_reshape__SWIG_9(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          return _wrap_SparsityInterfaceCommon_reshape__SWIG_3(resc,resv,argc,argv);
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_reshape'."
    "  Possible prototypes are:\n"
    "    RESHAPE(Sparsity,[int,int])\n"
    "    RESHAPE(Sparsity,Sparsity)\n"
    "    RESHAPE(DM,[int,int])\n"
    "    RESHAPE(DM,Sparsity)\n"
    "    RESHAPE(SX,[int,int])\n"
    "    RESHAPE(SX,Sparsity)\n"
    "    RESHAPE(MX,[int,int])\n"
    "    RESHAPE(MX,Sparsity)\n"
    "    RESHAPE(Sparsity,int,int)\n"
    "    RESHAPE(DM,int,int)\n"
    "    RESHAPE(SX,int,int)\n"
    "    RESHAPE(MX,int,int)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_SparsityInterfaceCommon_sparsity_cast__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Sparsity *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Sparsity m2 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_sparsity_cast",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "Sparsity" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_sparsity_cast__SWIG_3((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Sparsity const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_sparsity_cast'."
      "  Prototype:\n"
      "    SPARSITY_CAST(SX,Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_sparsity_cast(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Sparsity **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Sparsity **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_sparsity_cast__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Sparsity **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_sparsity_cast__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Sparsity **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_sparsity_cast__SWIG_3(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Sparsity **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_sparsity_cast__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_sparsity_cast'."
    "  Possible prototypes are:\n"
    "    SPARSITY_CAST(Sparsity,Sparsity)\n"
    "    SPARSITY_CAST(DM,Sparsity)\n"
    "    SPARSITY_CAST(SX,Sparsity)\n"
    "    SPARSITY_CAST(MX,Sparsity)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_SparsityInterfaceCommon_sprank__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_sprank",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = (casadi_int)casadi_SparsityInterfaceCommon_casadi_sprank__SWIG_3((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_sprank'."
      "  Prototype:\n"
      "    SPRANK(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_sprank(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Sparsity **>(0));
    if (_v) {
      return _wrap_SparsityInterfaceCommon_sprank__SWIG_0(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_SparsityInterfaceCommon_sprank__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_SparsityInterfaceCommon_sprank__SWIG_3(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      return _wrap_SparsityInterfaceCommon_sprank__SWIG_1(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_sprank'."
    "  Possible prototypes are:\n"
    "    SPRANK(Sparsity)\n"
    "    SPRANK(DM)\n"
    "    SPRANK(SX)\n"
    "    SPRANK(MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_SparsityInterfaceCommon_norm_0_mul__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_norm_0_mul",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  {
    try {
      result = (casadi_int)casadi_SparsityInterfaceCommon_casadi_norm_0_mul__SWIG_3((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_norm_0_mul'."
      "  Prototype:\n"
      "    NORM_0_MUL(SX,SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_norm_0_mul(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Sparsity **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Sparsity **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_norm_0_mul__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_norm_0_mul__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_norm_0_mul__SWIG_3(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_norm_0_mul__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_norm_0_mul'."
    "  Possible prototypes are:\n"
    "    NORM_0_MUL(Sparsity,Sparsity)\n"
    "    NORM_0_MUL(DM,DM)\n"
    "    NORM_0_MUL(SX,SX)\n"
    "    NORM_0_MUL(MX,MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_SparsityInterfaceCommon_triu__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  bool arg2 = (bool) true ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_triu",argc,2,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "bool" "'.");
  }
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_triu__SWIG_3((casadi::Matrix< casadi::SXElem > const &)*arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_triu'."
      "  Prototype:\n"
      "    TRIU(SX,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_triu(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 1) && (argc <= 2)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Sparsity **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_SparsityInterfaceCommon_triu__SWIG_0(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< bool **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_triu__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  if ((argc >= 1) && (argc <= 2)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_SparsityInterfaceCommon_triu__SWIG_2(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< bool **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_triu__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if ((argc >= 1) && (argc <= 2)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_SparsityInterfaceCommon_triu__SWIG_3(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< bool **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_triu__SWIG_3(resc,resv,argc,argv);
      }
    }
  }
  if ((argc >= 1) && (argc <= 2)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_SparsityInterfaceCommon_triu__SWIG_1(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< bool **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_triu__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_triu'."
    "  Possible prototypes are:\n"
    "    TRIU(Sparsity,bool)\n"
    "    TRIU(DM,bool)\n"
    "    TRIU(SX,bool)\n"
    "    TRIU(MX,bool)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_SparsityInterfaceCommon_tril__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  bool arg2 = (bool) true ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_tril",argc,2,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "bool" "'.");
  }
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_tril__SWIG_3((casadi::Matrix< casadi::SXElem > const &)*arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_tril'."
      "  Prototype:\n"
      "    TRIL(SX,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_tril(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 1) && (argc <= 2)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Sparsity **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_SparsityInterfaceCommon_tril__SWIG_0(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< bool **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_tril__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  if ((argc >= 1) && (argc <= 2)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_SparsityInterfaceCommon_tril__SWIG_2(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< bool **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_tril__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if ((argc >= 1) && (argc <= 2)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_SparsityInterfaceCommon_tril__SWIG_3(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< bool **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_tril__SWIG_3(resc,resv,argc,argv);
      }
    }
  }
  if ((argc >= 1) && (argc <= 2)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_SparsityInterfaceCommon_tril__SWIG_1(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< bool **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_tril__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_tril'."
    "  Possible prototypes are:\n"
    "    TRIL(Sparsity,bool)\n"
    "    TRIL(DM,bool)\n"
    "    TRIL(SX,bool)\n"
    "    TRIL(MX,bool)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_SparsityInterfaceCommon_kron__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_kron",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_kron__SWIG_3((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_kron'."
      "  Prototype:\n"
      "    KRON(SX,SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_kron(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Sparsity **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Sparsity **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_kron__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_kron__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_kron__SWIG_3(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_kron__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_kron'."
    "  Possible prototypes are:\n"
    "    KRON(Sparsity,Sparsity)\n"
    "    KRON(DM,DM)\n"
    "    KRON(SX,SX)\n"
    "    KRON(MX,MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_SparsityInterfaceCommon_repmat__SWIG_6(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi_int arg2 ;
  casadi_int arg3 = (casadi_int) 1 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_repmat",argc,3,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  }
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_repmat__SWIG_6((casadi::Matrix< casadi::SXElem > const &)*arg1,arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_repmat'."
      "  Prototype:\n"
      "    REPMAT(SX,int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_repmat__SWIG_7(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  std::pair< casadi_int,casadi_int > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  std::pair< casadi_int,casadi_int > m2 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_repmat",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "[int,int]" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_repmat__SWIG_7((casadi::Matrix< casadi::SXElem > const &)*arg1,(std::pair< long long,long long > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_repmat'."
      "  Prototype:\n"
      "    REPMAT(SX,[int,int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_repmat(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 2) && (argc <= 3)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Sparsity **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_SparsityInterfaceCommon_repmat__SWIG_0(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          return _wrap_SparsityInterfaceCommon_repmat__SWIG_0(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Sparsity **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::pair<casadi_int,casadi_int> **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_repmat__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if ((argc >= 2) && (argc <= 3)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_SparsityInterfaceCommon_repmat__SWIG_4(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          return _wrap_SparsityInterfaceCommon_repmat__SWIG_4(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::pair<casadi_int,casadi_int> **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_repmat__SWIG_5(resc,resv,argc,argv);
      }
    }
  }
  if ((argc >= 2) && (argc <= 3)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_SparsityInterfaceCommon_repmat__SWIG_6(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          return _wrap_SparsityInterfaceCommon_repmat__SWIG_6(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::pair<casadi_int,casadi_int> **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_repmat__SWIG_7(resc,resv,argc,argv);
      }
    }
  }
  if ((argc >= 2) && (argc <= 3)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_SparsityInterfaceCommon_repmat__SWIG_2(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          return _wrap_SparsityInterfaceCommon_repmat__SWIG_2(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::pair<casadi_int,casadi_int> **>(0));
      if (_v) {
        return _wrap_SparsityInterfaceCommon_repmat__SWIG_3(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_repmat'."
    "  Possible prototypes are:\n"
    "    REPMAT(Sparsity,int,int)\n"
    "    REPMAT(Sparsity,[int,int])\n"
    "    REPMAT(DM,int,int)\n"
    "    REPMAT(DM,[int,int])\n"
    "    REPMAT(SX,int,int)\n"
    "    REPMAT(SX,[int,int])\n"
    "    REPMAT(MX,int,int)\n"
    "    REPMAT(MX,[int,int])\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_SparsityInterfaceCommon_sum2__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_sum2",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_sum2__SWIG_3((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_sum2'."
      "  Prototype:\n"
      "    SUM2(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_sum2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Sparsity **>(0));
    if (_v) {
      return _wrap_SparsityInterfaceCommon_sum2__SWIG_0(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_SparsityInterfaceCommon_sum2__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_SparsityInterfaceCommon_sum2__SWIG_3(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      return _wrap_SparsityInterfaceCommon_sum2__SWIG_1(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_sum2'."
    "  Possible prototypes are:\n"
    "    SUM2(Sparsity)\n"
    "    SUM2(DM)\n"
    "    SUM2(SX)\n"
    "    SUM2(MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_SparsityInterfaceCommon_sum1__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_sum1",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = casadi_SparsityInterfaceCommon_casadi_sum1__SWIG_3((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_sum1'."
      "  Prototype:\n"
      "    SUM1(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_sum1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Sparsity **>(0));
    if (_v) {
      return _wrap_SparsityInterfaceCommon_sum1__SWIG_0(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_SparsityInterfaceCommon_sum1__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_SparsityInterfaceCommon_sum1__SWIG_3(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      return _wrap_SparsityInterfaceCommon_sum1__SWIG_1(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_sum1'."
    "  Possible prototypes are:\n"
    "    SUM1(Sparsity)\n"
    "    SUM1(DM)\n"
    "    SUM1(SX)\n"
    "    SUM1(MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_SparsityInterfaceCommon_length__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("SparsityInterfaceCommon_length",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = (casadi_int)casadi_SparsityInterfaceCommon_casadi_length__SWIG_3((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_length'."
      "  Prototype:\n"
      "    LENGTH(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SparsityInterfaceCommon_length(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Sparsity **>(0));
    if (_v) {
      return _wrap_SparsityInterfaceCommon_length__SWIG_0(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_SparsityInterfaceCommon_length__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_SparsityInterfaceCommon_length__SWIG_3(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      return _wrap_SparsityInterfaceCommon_length__SWIG_1(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SparsityInterfaceCommon_length'."
    "  Possible prototypes are:\n"
    "    LENGTH(Sparsity)\n"
    "    LENGTH(DM)\n"
    "    LENGTH(SX)\n"
    "    LENGTH(MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_new_SparsityInterfaceCommon__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  casadi::SparsityInterfaceCommon *result = 0 ;
  
  if (!SWIG_check_num_args("new_SparsityInterfaceCommon",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    result = (casadi::SparsityInterfaceCommon *)new casadi::SparsityInterfaceCommon();
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__SparsityInterfaceCommon, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_SparsityInterfaceCommon'."
      "  Prototype:\n"
      "    SPARSITYINTERFACECOMMON()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_SparsityInterfaceCommon__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::SparsityInterfaceCommon *arg1 = 0 ;
  void *argp1 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::SparsityInterfaceCommon *result = 0 ;
  
  if (!SWIG_check_num_args("new_SparsityInterfaceCommon",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_casadi__SparsityInterfaceCommon,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_SparsityInterfaceCommon" "', argument " "1"" of type '" "casadi::SparsityInterfaceCommon const &""'"); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_SparsityInterfaceCommon" "', argument " "1"" of type '" "casadi::SparsityInterfaceCommon const &""'"); 
  }
  arg1 = reinterpret_cast< casadi::SparsityInterfaceCommon * >(argp1);
  {
    result = (casadi::SparsityInterfaceCommon *)new casadi::SparsityInterfaceCommon((casadi::SparsityInterfaceCommon const &)*arg1);
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__SparsityInterfaceCommon, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_SparsityInterfaceCommon'."
      "  Prototype:\n"
      "    SPARSITYINTERFACECOMMON(SparsityInterfaceCommon)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_SparsityInterfaceCommon(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 0) {
    return _wrap_new_SparsityInterfaceCommon__SWIG_0(resc,resv,argc,argv);
  }
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__SparsityInterfaceCommon, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_new_SparsityInterfaceCommon__SWIG_1(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_SparsityInterfaceCommon'."
    "  Possible prototypes are:\n"
    "    SPARSITYINTERFACECOMMON()\n"
    "    SPARSITYINTERFACECOMMON(SparsityInterfaceCommon)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_delete_SparsityInterfaceCommon(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::SparsityInterfaceCommon *arg1 = (casadi::SparsityInterfaceCommon *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  int is_owned;
  if (!SWIG_check_num_args("delete_SparsityInterfaceCommon",argc,1,1,0)) {
    SWIG_fail;
  }
  is_owned = SWIG_Matlab_isOwned(argv[0]);
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__SparsityInterfaceCommon, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_SparsityInterfaceCommon" "', argument " "1"" of type '" "casadi::SparsityInterfaceCommon *""'"); 
  }
  arg1 = reinterpret_cast< casadi::SparsityInterfaceCommon * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  if (is_owned) {
    {
      delete arg1;
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'delete_SparsityInterfaceCommon'."
      "  Prototype:\n"
      "    SPARSITYINTERFACECOMMON(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_Sparsity__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 = (casadi_int) 0 ;
  mxArray * _out;
  casadi::Sparsity *result = 0 ;
  
  if (!SWIG_check_num_args("new_Sparsity",argc,1,0,0)) {
    SWIG_fail;
  }
  if (0<argc) {
    if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  }
  {
    try {
      result = (casadi::Sparsity *)new casadi::Sparsity(arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__Sparsity, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_Sparsity'."
      "  Prototype:\n"
      "    SPARSITY(int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_Sparsity__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 ;
  casadi_int arg2 ;
  mxArray * _out;
  casadi::Sparsity *result = 0 ;
  
  if (!SWIG_check_num_args("new_Sparsity",argc,2,2,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  {
    try {
      result = (casadi::Sparsity *)new casadi::Sparsity(arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__Sparsity, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_Sparsity'."
      "  Prototype:\n"
      "    SPARSITY(int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_Sparsity__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 ;
  casadi_int arg2 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg3 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg4 = 0 ;
  bool arg5 = (bool) false ;
  std::vector< casadi_int > m3 ;
  std::vector< casadi_int > m4 ;
  mxArray * _out;
  casadi::Sparsity *result = 0 ;
  
  if (!SWIG_check_num_args("new_Sparsity",argc,5,4,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "[" "int" "]" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "[" "int" "]" "'.");
  if (4<argc) {
    if (!casadi::to_val(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "bool" "'.");
  }
  {
    try {
      result = (casadi::Sparsity *)new casadi::Sparsity(arg1,arg2,(std::vector< casadi_int,std::allocator< casadi_int > > const &)*arg3,(std::vector< casadi_int,std::allocator< casadi_int > > const &)*arg4,arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__Sparsity, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_Sparsity'."
      "  Prototype:\n"
      "    SPARSITY(int,int,[int],[int],bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_Sparsity__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::pair< casadi_int,casadi_int > *arg1 = 0 ;
  std::pair< casadi_int,casadi_int > m1 ;
  mxArray * _out;
  casadi::Sparsity *result = 0 ;
  
  if (!SWIG_check_num_args("new_Sparsity",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "[int,int]" "'.");
  {
    try {
      result = (casadi::Sparsity *)new casadi::Sparsity((std::pair< casadi_int,casadi_int > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__Sparsity, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_Sparsity'."
      "  Prototype:\n"
      "    SPARSITY([int,int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_scalar(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  bool arg1 = (bool) true ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("Sparsity_scalar",argc,1,0,0)) {
    SWIG_fail;
  }
  if (0<argc) {
    if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "bool" "'.");
  }
  {
    try {
      result = casadi::Sparsity::scalar(arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_scalar'."
      "  Prototype:\n"
      "    SCALAR(bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_dense__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 ;
  casadi_int arg2 = (casadi_int) 1 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("Sparsity_dense",argc,2,1,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  }
  {
    try {
      result = casadi::Sparsity::dense(arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_dense'."
      "  Prototype:\n"
      "    DENSE(int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_dense__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::pair< casadi_int,casadi_int > *arg1 = 0 ;
  std::pair< casadi_int,casadi_int > m1 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("Sparsity_dense",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "[int,int]" "'.");
  {
    try {
      result = casadi::Sparsity::dense((std::pair< long long,long long > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_dense'."
      "  Prototype:\n"
      "    DENSE([int,int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_dense(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 1) && (argc <= 2)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi_int **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_Sparsity_dense__SWIG_0(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_Sparsity_dense__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::pair<casadi_int,casadi_int> **>(0));
    if (_v) {
      return _wrap_Sparsity_dense__SWIG_1(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_dense'."
    "  Possible prototypes are:\n"
    "    DENSE(int,int)\n"
    "    DENSE([int,int])\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_Sparsity_unit(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 ;
  casadi_int arg2 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("Sparsity_unit",argc,2,2,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  {
    try {
      result = casadi::Sparsity::unit(arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_unit'."
      "  Prototype:\n"
      "    UNIT(int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_upper(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("Sparsity_upper",argc,1,1,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  {
    try {
      result = casadi::Sparsity::upper(arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_upper'."
      "  Prototype:\n"
      "    UPPER(int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_lower(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("Sparsity_lower",argc,1,1,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  {
    try {
      result = casadi::Sparsity::lower(arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_lower'."
      "  Prototype:\n"
      "    LOWER(int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_diag__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("Sparsity_diag",argc,1,1,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  {
    try {
      result = casadi::Sparsity::diag(arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_diag'."
      "  Prototype:\n"
      "    DIAG(int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_diag__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 ;
  casadi_int arg2 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("Sparsity_diag",argc,2,2,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  {
    try {
      result = casadi::Sparsity::diag(arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_diag'."
      "  Prototype:\n"
      "    DIAG(int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_diag__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::pair< casadi_int,casadi_int > *arg1 = 0 ;
  std::pair< casadi_int,casadi_int > m1 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("Sparsity_diag",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "[int,int]" "'.");
  {
    try {
      result = casadi::Sparsity::diag((std::pair< long long,long long > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_diag'."
      "  Prototype:\n"
      "    DIAG([int,int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_diag(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi_int **>(0));
    if (_v) {
      return _wrap_Sparsity_diag__SWIG_0(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::pair<casadi_int,casadi_int> **>(0));
    if (_v) {
      return _wrap_Sparsity_diag__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi_int **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_Sparsity_diag__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_diag'."
    "  Possible prototypes are:\n"
    "    DIAG(int)\n"
    "    DIAG([int,int])\n"
    "    DIAG(int,int)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_Sparsity_band(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 ;
  casadi_int arg2 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("Sparsity_band",argc,2,2,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  {
    try {
      result = casadi::Sparsity::band(arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_band'."
      "  Prototype:\n"
      "    BAND(int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_banded(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 ;
  casadi_int arg2 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("Sparsity_banded",argc,2,2,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  {
    try {
      result = casadi::Sparsity::banded(arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_banded'."
      "  Prototype:\n"
      "    BANDED(int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_rowcol(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< casadi_int,std::allocator< casadi_int > > *arg1 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg2 = 0 ;
  casadi_int arg3 ;
  casadi_int arg4 ;
  std::vector< casadi_int > m1 ;
  std::vector< casadi_int > m2 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("Sparsity_rowcol",argc,4,4,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "[" "int" "]" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "[" "int" "]" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  if (!casadi::to_val(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "int" "'.");
  {
    try {
      result = casadi::Sparsity::rowcol((std::vector< long long,std::allocator< long long > > const &)*arg1,(std::vector< long long,std::allocator< long long > > const &)*arg2,arg3,arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_rowcol'."
      "  Prototype:\n"
      "    ROWCOL([int],[int],int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_triplet__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 ;
  casadi_int arg2 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg3 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg4 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg5 = 0 ;
  bool arg6 ;
  std::vector< casadi_int > m3 ;
  std::vector< casadi_int > m4 ;
  std::vector< casadi_int > m5 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  arg5 = &m5;
  if (!SWIG_check_num_args("Sparsity_triplet",argc,5,5,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "[" "int" "]" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "[" "int" "]" "'.");
  if (!casadi::to_val(argv[4], &arg6)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 6 to type '" "bool" "'.");
  {
    try {
      result = casadi::Sparsity::triplet(arg1,arg2,(std::vector< long long,std::allocator< long long > > const &)*arg3,(std::vector< long long,std::allocator< long long > > const &)*arg4,*arg5,arg6);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg5);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_triplet'."
      "  Prototype:\n"
      "    TRIPLET(int,int,[int],[int],bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_triplet__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 ;
  casadi_int arg2 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg3 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg4 = 0 ;
  std::vector< casadi_int > m3 ;
  std::vector< casadi_int > m4 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("Sparsity_triplet",argc,4,4,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "[" "int" "]" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "[" "int" "]" "'.");
  {
    try {
      result = casadi::Sparsity::triplet(arg1,arg2,(std::vector< long long,std::allocator< long long > > const &)*arg3,(std::vector< long long,std::allocator< long long > > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_triplet'."
      "  Prototype:\n"
      "    TRIPLET(int,int,[int],[int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_triplet(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 4) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi_int **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::vector<casadi_int> **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< std::vector<casadi_int> **>(0));
          if (_v) {
            return _wrap_Sparsity_triplet__SWIG_1(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if (argc == 5) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi_int **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::vector<casadi_int> **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< std::vector<casadi_int> **>(0));
          if (_v) {
            _v = casadi::to_ptr(argv[4], static_cast< bool **>(0));
            if (_v) {
              return _wrap_Sparsity_triplet__SWIG_0(resc,resv,argc,argv);
            }
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_triplet'."
    "  Possible prototypes are:\n"
    "    TRIPLET(int,int,[int],[int])\n"
    "    TRIPLET(int,int,[int],[int],bool)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_Sparsity_nonzeros(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 ;
  casadi_int arg2 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg3 = 0 ;
  bool arg4 = (bool) true ;
  std::vector< casadi_int > m3 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("Sparsity_nonzeros",argc,4,3,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "[" "int" "]" "'.");
  if (3<argc) {
    if (!casadi::to_val(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "bool" "'.");
  }
  {
    try {
      result = casadi::Sparsity::nonzeros(arg1,arg2,(std::vector< long long,std::allocator< long long > > const &)*arg3,arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_nonzeros'."
      "  Prototype:\n"
      "    NONZEROS(int,int,[int],bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_compressed(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< casadi_int,std::allocator< casadi_int > > *arg1 = 0 ;
  bool arg2 = (bool) false ;
  std::vector< casadi_int > m1 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("Sparsity_compressed",argc,2,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "[" "int" "]" "'.");
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "bool" "'.");
  }
  {
    try {
      result = casadi::Sparsity::compressed((std::vector< long long,std::allocator< long long > > const &)*arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_compressed'."
      "  Prototype:\n"
      "    COMPRESSED([int],bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_permutation(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< casadi_int,std::allocator< casadi_int > > *arg1 = 0 ;
  bool arg2 = (bool) false ;
  std::vector< casadi_int > m1 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("Sparsity_permutation",argc,2,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "[" "int" "]" "'.");
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "bool" "'.");
  }
  {
    try {
      result = casadi::Sparsity::permutation((std::vector< long long,std::allocator< long long > > const &)*arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_permutation'."
      "  Prototype:\n"
      "    PERMUTATION([int],bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_permutation_vector(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  bool arg2 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi_int,std::allocator< casadi_int > > result;
  
  if (!SWIG_check_num_args("Sparsity_permutation_vector",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_permutation_vector" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Sparsity const *)arg1)->permutation_vector(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[" "int" "]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_permutation_vector'."
      "  Prototype:\n"
      "    PERMUTATION_VECTOR(self,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_get_diag(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< casadi_int > m2 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  arg2 = &m2;
  if (!SWIG_check_num_args("Sparsity_get_diag",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_get_diag" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Sparsity const *)arg1)->get_diag(*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_get_diag'."
      "  Prototype:\n"
      "    GET_DIAG(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_compress(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi_int,std::allocator< casadi_int > > result;
  
  if (!SWIG_check_num_args("Sparsity_compress",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_compress" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Sparsity const *)arg1)->compress();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[" "int" "]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_compress'."
      "  Prototype:\n"
      "    COMPRESS(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_is_equal__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  casadi::Sparsity *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Sparsity m2 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("Sparsity_is_equal",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_is_equal" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "Sparsity" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Sparsity const *)arg1)->is_equal((casadi::Sparsity const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_is_equal'."
      "  Prototype:\n"
      "    IS_EQUAL(self,Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_is_equal__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  casadi_int arg2 ;
  casadi_int arg3 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg4 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg5 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< casadi_int > m4 ;
  std::vector< casadi_int > m5 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("Sparsity_is_equal",argc,5,5,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_is_equal" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "[" "int" "]" "'.");
  arg5 = &m5;
  if (!casadi::to_ptr(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "[" "int" "]" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Sparsity const *)arg1)->is_equal(arg2,arg3,(std::vector< casadi_int,std::allocator< casadi_int > > const &)*arg4,(std::vector< casadi_int,std::allocator< casadi_int > > const &)*arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_is_equal'."
      "  Prototype:\n"
      "    IS_EQUAL(self,int,int,[int],[int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_is_equal(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Sparsity, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Sparsity **>(0));
      if (_v) {
        return _wrap_Sparsity_is_equal__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 5) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Sparsity, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< std::vector<casadi_int> **>(0));
          if (_v) {
            _v = casadi::to_ptr(argv[4], static_cast< std::vector<casadi_int> **>(0));
            if (_v) {
              return _wrap_Sparsity_is_equal__SWIG_1(resc,resv,argc,argv);
            }
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_is_equal'."
    "  Possible prototypes are:\n"
    "    IS_EQUAL(self,Sparsity)\n"
    "    IS_EQUAL(self,int,int,[int],[int])\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_Sparsity_eq(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  casadi::Sparsity *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Sparsity m2 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("Sparsity_eq",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_eq" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "Sparsity" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Sparsity const *)arg1)->operator ==((casadi::Sparsity const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_eq'."
      "  Prototype:\n"
      "    EQ(self,Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_ne(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  casadi::Sparsity *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Sparsity m2 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("Sparsity_ne",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_ne" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "Sparsity" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Sparsity const *)arg1)->operator !=((casadi::Sparsity const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_ne'."
      "  Prototype:\n"
      "    NE(self,Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_is_stacked(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  casadi::Sparsity *arg2 = 0 ;
  casadi_int arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Sparsity m2 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("Sparsity_is_stacked",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_is_stacked" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "Sparsity" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Sparsity const *)arg1)->is_stacked((casadi::Sparsity const &)*arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_is_stacked'."
      "  Prototype:\n"
      "    IS_STACKED(self,Sparsity,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_size1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("Sparsity_size1",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_size1" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::Sparsity const *)arg1)->size1();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_size1'."
      "  Prototype:\n"
      "    SIZE1(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_rows(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("Sparsity_rows",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_rows" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::Sparsity const *)arg1)->rows();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_rows'."
      "  Prototype:\n"
      "    ROWS(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_size2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("Sparsity_size2",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_size2" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::Sparsity const *)arg1)->size2();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_size2'."
      "  Prototype:\n"
      "    SIZE2(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_columns(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("Sparsity_columns",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_columns" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::Sparsity const *)arg1)->columns();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_columns'."
      "  Prototype:\n"
      "    COLUMNS(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_numel(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("Sparsity_numel",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_numel" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::Sparsity const *)arg1)->numel();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_numel'."
      "  Prototype:\n"
      "    NUMEL(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_density(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  double result;
  
  if (!SWIG_check_num_args("Sparsity_density",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_density" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (double)((casadi::Sparsity const *)arg1)->density();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "double" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_density'."
      "  Prototype:\n"
      "    DENSITY(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_is_empty(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  bool arg2 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("Sparsity_is_empty",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_is_empty" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Sparsity const *)arg1)->is_empty(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_is_empty'."
      "  Prototype:\n"
      "    IS_EMPTY(self,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_nnz(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("Sparsity_nnz",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_nnz" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::Sparsity const *)arg1)->nnz();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_nnz'."
      "  Prototype:\n"
      "    NNZ(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_nnz_upper(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  bool arg2 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("Sparsity_nnz_upper",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_nnz_upper" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::Sparsity const *)arg1)->nnz_upper(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_nnz_upper'."
      "  Prototype:\n"
      "    NNZ_UPPER(self,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_nnz_lower(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  bool arg2 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("Sparsity_nnz_lower",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_nnz_lower" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::Sparsity const *)arg1)->nnz_lower(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_nnz_lower'."
      "  Prototype:\n"
      "    NNZ_LOWER(self,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_nnz_diag(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("Sparsity_nnz_diag",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_nnz_diag" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::Sparsity const *)arg1)->nnz_diag();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_nnz_diag'."
      "  Prototype:\n"
      "    NNZ_DIAG(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_bw_upper(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("Sparsity_bw_upper",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_bw_upper" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::Sparsity const *)arg1)->bw_upper();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_bw_upper'."
      "  Prototype:\n"
      "    BW_UPPER(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_bw_lower(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("Sparsity_bw_lower",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_bw_lower" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::Sparsity const *)arg1)->bw_lower();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_bw_lower'."
      "  Prototype:\n"
      "    BW_LOWER(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_size__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::pair< casadi_int,casadi_int > result;
  
  if (!SWIG_check_num_args("Sparsity_size",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_size" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Sparsity const *)arg1)->size();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[int,int]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_size'."
      "  Prototype:\n"
      "    SIZE(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_size__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  casadi_int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("Sparsity_size",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_size" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::Sparsity const *)arg1)->size(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_size'."
      "  Prototype:\n"
      "    SIZE(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_size(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Sparsity, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_Sparsity_size__SWIG_0(resc,resv,argc,argv);
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Sparsity, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_Sparsity_size__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_size'."
    "  Possible prototypes are:\n"
    "    SIZE(self)\n"
    "    SIZE(self,int)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_Sparsity_info(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Dict result;
  
  if (!SWIG_check_num_args("Sparsity_info",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_info" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Sparsity const *)arg1)->info();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "struct" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_info'."
      "  Prototype:\n"
      "    INFO(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_to_file(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  std::string *arg2 = 0 ;
  std::string const &arg3_defvalue = "" ;
  std::string *arg3 = (std::string *) &arg3_defvalue ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  std::string m3 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("Sparsity_to_file",argc,3,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_to_file" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  if (2<argc) {
    arg3 = &m3;
    if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "char" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Sparsity const *)arg1)->to_file((std::string const &)*arg2,(std::string const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_to_file'."
      "  Prototype:\n"
      "    TO_FILE(self,char,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_from_file(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string const &arg2_defvalue = "" ;
  std::string *arg2 = (std::string *) &arg2_defvalue ;
  std::string m1 ;
  std::string m2 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("Sparsity_from_file",argc,2,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  if (1<argc) {
    arg2 = &m2;
    if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  }
  {
    try {
      result = casadi::Sparsity::from_file((std::string const &)*arg1,(std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_from_file'."
      "  Prototype:\n"
      "    FROM_FILE(char,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_serialize__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("Sparsity_serialize",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_serialize" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Sparsity const *)arg1)->serialize();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_serialize'."
      "  Prototype:\n"
      "    SERIALIZE(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_deserialize__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::istream *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("Sparsity_deserialize",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_std__istream,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_deserialize" "', argument " "1"" of type '" "std::istream &""'"); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Sparsity_deserialize" "', argument " "1"" of type '" "std::istream &""'"); 
  }
  arg1 = reinterpret_cast< std::istream * >(argp1);
  {
    try {
      result = casadi::Sparsity::deserialize(*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_deserialize'."
      "  Prototype:\n"
      "    DESERIALIZE(std::istream &)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_deserialize__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string m1 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("Sparsity_deserialize",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  {
    try {
      result = casadi::Sparsity::deserialize((std::string const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_deserialize'."
      "  Prototype:\n"
      "    DESERIALIZE(char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_serialize__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  casadi::SerializingStream *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("Sparsity_serialize",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_serialize" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  res2 = SWIG_ConvertPtr(argv[1], &argp2, SWIGTYPE_p_casadi__SerializingStream,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Sparsity_serialize" "', argument " "2"" of type '" "casadi::SerializingStream &""'"); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Sparsity_serialize" "', argument " "2"" of type '" "casadi::SerializingStream &""'"); 
  }
  arg2 = reinterpret_cast< casadi::SerializingStream * >(argp2);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Sparsity const *)arg1)->serialize(*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_serialize'."
      "  Prototype:\n"
      "    SERIALIZE(self,casadi::SerializingStream &)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_serialize(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Sparsity, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_Sparsity_serialize__SWIG_0(resc,resv,argc,argv);
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Sparsity, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_casadi__SerializingStream, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap_Sparsity_serialize__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_serialize'."
    "  Possible prototypes are:\n"
    "    SERIALIZE(self)\n"
    "    SERIALIZE(self,casadi::SerializingStream &)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_Sparsity_deserialize__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DeserializingStream *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("Sparsity_deserialize",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_casadi__DeserializingStream,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_deserialize" "', argument " "1"" of type '" "casadi::DeserializingStream &""'"); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Sparsity_deserialize" "', argument " "1"" of type '" "casadi::DeserializingStream &""'"); 
  }
  arg1 = reinterpret_cast< casadi::DeserializingStream * >(argp1);
  {
    try {
      result = casadi::Sparsity::deserialize(*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_deserialize'."
      "  Prototype:\n"
      "    DESERIALIZE(casadi::DeserializingStream &)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_deserialize(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_std__istream, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_Sparsity_deserialize__SWIG_0(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__DeserializingStream, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_Sparsity_deserialize__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::string **>(0));
    if (_v) {
      return _wrap_Sparsity_deserialize__SWIG_1(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_deserialize'."
    "  Possible prototypes are:\n"
    "    DESERIALIZE(std::istream &)\n"
    "    DESERIALIZE(casadi::DeserializingStream &)\n"
    "    DESERIALIZE(char)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_Sparsity_row__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi_int,std::allocator< casadi_int > > result;
  
  if (!SWIG_check_num_args("Sparsity_row",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_row" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Sparsity const *)arg1)->get_row();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[" "int" "]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_row'."
      "  Prototype:\n"
      "    ROW(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_colind__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi_int,std::allocator< casadi_int > > result;
  
  if (!SWIG_check_num_args("Sparsity_colind",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_colind" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Sparsity const *)arg1)->get_colind();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[" "int" "]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_colind'."
      "  Prototype:\n"
      "    COLIND(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_colind__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  casadi_int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("Sparsity_colind",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_colind" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::Sparsity const *)arg1)->colind(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_colind'."
      "  Prototype:\n"
      "    COLIND(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_colind(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Sparsity, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_Sparsity_colind__SWIG_0(resc,resv,argc,argv);
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Sparsity, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_Sparsity_colind__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_colind'."
    "  Possible prototypes are:\n"
    "    COLIND(self)\n"
    "    COLIND(self,int)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_Sparsity_row__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  casadi_int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("Sparsity_row",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_row" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::Sparsity const *)arg1)->row(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_row'."
      "  Prototype:\n"
      "    ROW(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_row(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Sparsity, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_Sparsity_row__SWIG_0(resc,resv,argc,argv);
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Sparsity, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_Sparsity_row__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_row'."
    "  Possible prototypes are:\n"
    "    ROW(self)\n"
    "    ROW(self,int)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_Sparsity_get_col(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi_int,std::allocator< casadi_int > > result;
  
  if (!SWIG_check_num_args("Sparsity_get_col",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_get_col" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Sparsity const *)arg1)->get_col();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[" "int" "]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_get_col'."
      "  Prototype:\n"
      "    GET_COL(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_resize(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  casadi_int arg2 ;
  casadi_int arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("Sparsity_resize",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_resize" "', argument " "1"" of type '" "casadi::Sparsity *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->resize(arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_resize'."
      "  Prototype:\n"
      "    RESIZE(self,int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_add_nz(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  casadi_int arg2 ;
  casadi_int arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("Sparsity_add_nz",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_add_nz" "', argument " "1"" of type '" "casadi::Sparsity *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)(arg1)->add_nz(arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_add_nz'."
      "  Prototype:\n"
      "    ADD_NZ(self,int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_get_nz__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  casadi_int arg2 ;
  casadi_int arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("Sparsity_get_nz",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_get_nz" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::Sparsity const *)arg1)->get_nz(arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_get_nz'."
      "  Prototype:\n"
      "    GET_NZ(self,int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_has_nz(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  casadi_int arg2 ;
  casadi_int arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("Sparsity_has_nz",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_has_nz" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Sparsity const *)arg1)->has_nz(arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_has_nz'."
      "  Prototype:\n"
      "    HAS_NZ(self,int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_get_nz__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg2 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< casadi_int > m2 ;
  std::vector< casadi_int > m3 ;
  mxArray * _out;
  std::vector< casadi_int,std::allocator< casadi_int > > result;
  
  if (!SWIG_check_num_args("Sparsity_get_nz",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_get_nz" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "[" "int" "]" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "[" "int" "]" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Sparsity const *)arg1)->get_nz((std::vector< casadi_int,std::allocator< casadi_int > > const &)*arg2,(std::vector< casadi_int,std::allocator< casadi_int > > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[" "int" "]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_get_nz'."
      "  Prototype:\n"
      "    GET_NZ(self,[int],[int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_get_nz__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< casadi_int > m2 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("Sparsity_get_nz",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_get_nz" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input to type '" "[" "int" "]" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Sparsity const *)arg1)->get_nz(*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_get_nz'."
      "  Prototype:\n"
      "    GET_NZ(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_get_nz(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Sparsity, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<casadi_int> **>(0));
      if (_v) {
        return _wrap_Sparsity_get_nz__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Sparsity, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          return _wrap_Sparsity_get_nz__SWIG_0(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Sparsity, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<casadi_int> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::vector<casadi_int> **>(0));
        if (_v) {
          return _wrap_Sparsity_get_nz__SWIG_1(resc,resv,argc,argv);
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_get_nz'."
    "  Possible prototypes are:\n"
    "    GET_NZ(self)\n"
    "    GET_NZ(self,int,int)\n"
    "    GET_NZ(self,[int],[int])\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_Sparsity_get_lower(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi_int,std::allocator< casadi_int > > result;
  
  if (!SWIG_check_num_args("Sparsity_get_lower",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_get_lower" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Sparsity const *)arg1)->get_lower();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[" "int" "]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_get_lower'."
      "  Prototype:\n"
      "    GET_LOWER(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_get_upper(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi_int,std::allocator< casadi_int > > result;
  
  if (!SWIG_check_num_args("Sparsity_get_upper",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_get_upper" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Sparsity const *)arg1)->get_upper();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[" "int" "]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_get_upper'."
      "  Prototype:\n"
      "    GET_UPPER(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_get_ccs(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg2 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< casadi_int > m2 ;
  std::vector< casadi_int > m3 ;
  mxArray * _out;
  
  arg2 = &m2;
  arg3 = &m3;
  if (!SWIG_check_num_args("Sparsity_get_ccs",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_get_ccs" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Sparsity const *)arg1)->get_ccs(*arg2,*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg3);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_get_ccs'."
      "  Prototype:\n"
      "    GET_CCS(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_get_crs(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg2 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< casadi_int > m2 ;
  std::vector< casadi_int > m3 ;
  mxArray * _out;
  
  arg2 = &m2;
  arg3 = &m3;
  if (!SWIG_check_num_args("Sparsity_get_crs",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_get_crs" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Sparsity const *)arg1)->get_crs(*arg2,*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg3);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_get_crs'."
      "  Prototype:\n"
      "    GET_CRS(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_get_triplet(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg2 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< casadi_int > m2 ;
  std::vector< casadi_int > m3 ;
  mxArray * _out;
  
  arg2 = &m2;
  arg3 = &m3;
  if (!SWIG_check_num_args("Sparsity_get_triplet",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_get_triplet" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Sparsity const *)arg1)->get_triplet(*arg2,*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg3);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_get_triplet'."
      "  Prototype:\n"
      "    GET_TRIPLET(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_sub__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg2 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg3 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg4 = 0 ;
  bool arg5 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< casadi_int > m2 ;
  std::vector< casadi_int > m3 ;
  std::vector< casadi_int > m4 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  arg4 = &m4;
  if (!SWIG_check_num_args("Sparsity_sub",argc,4,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_sub" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "[" "int" "]" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "[" "int" "]" "'.");
  if (3<argc) {
    if (!casadi::to_val(argv[3], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Sparsity const *)arg1)->sub((std::vector< casadi_int,std::allocator< casadi_int > > const &)*arg2,(std::vector< casadi_int,std::allocator< casadi_int > > const &)*arg3,*arg4,arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg4);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_sub'."
      "  Prototype:\n"
      "    SUB(self,[int],[int],bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_sub__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg2 = 0 ;
  casadi::Sparsity *arg3 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg4 = 0 ;
  bool arg5 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< casadi_int > m2 ;
  casadi::Sparsity m3 ;
  std::vector< casadi_int > m4 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  arg4 = &m4;
  if (!SWIG_check_num_args("Sparsity_sub",argc,4,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_sub" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "[" "int" "]" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "Sparsity" "'.");
  if (3<argc) {
    if (!casadi::to_val(argv[3], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Sparsity const *)arg1)->sub((std::vector< casadi_int,std::allocator< casadi_int > > const &)*arg2,(casadi::Sparsity const &)*arg3,*arg4,arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg4);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_sub'."
      "  Prototype:\n"
      "    SUB(self,[int],Sparsity,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_sub(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 3) && (argc <= 4)) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Sparsity, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<casadi_int> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Sparsity **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_Sparsity_sub__SWIG_1(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< bool **>(0));
          if (_v) {
            return _wrap_Sparsity_sub__SWIG_1(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if ((argc >= 3) && (argc <= 4)) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Sparsity, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<casadi_int> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::vector<casadi_int> **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_Sparsity_sub__SWIG_0(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< bool **>(0));
          if (_v) {
            return _wrap_Sparsity_sub__SWIG_0(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_sub'."
    "  Possible prototypes are:\n"
    "    SUB(self,[int],Sparsity,bool)\n"
    "    SUB(self,[int],[int],bool)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_Sparsity_T(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("Sparsity_T",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_T" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Sparsity const *)arg1)->T();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_T'."
      "  Prototype:\n"
      "    T(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_transpose(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg2 = 0 ;
  bool arg3 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< casadi_int > m2 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  arg2 = &m2;
  if (!SWIG_check_num_args("Sparsity_transpose",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_transpose" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Sparsity const *)arg1)->transpose(*arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_transpose'."
      "  Prototype:\n"
      "    TRANSPOSE(self,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_is_transpose(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  casadi::Sparsity *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Sparsity m2 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("Sparsity_is_transpose",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_is_transpose" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "Sparsity" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Sparsity const *)arg1)->is_transpose((casadi::Sparsity const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_is_transpose'."
      "  Prototype:\n"
      "    IS_TRANSPOSE(self,Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_is_reshape(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  casadi::Sparsity *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Sparsity m2 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("Sparsity_is_reshape",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_is_reshape" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "Sparsity" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Sparsity const *)arg1)->is_reshape((casadi::Sparsity const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_is_reshape'."
      "  Prototype:\n"
      "    IS_RESHAPE(self,Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_combine(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  casadi::Sparsity *arg2 = 0 ;
  bool arg3 ;
  bool arg4 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Sparsity m2 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("Sparsity_combine",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_combine" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "Sparsity" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  if (!casadi::to_val(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "bool" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Sparsity const *)arg1)->combine((casadi::Sparsity const &)*arg2,arg3,arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_combine'."
      "  Prototype:\n"
      "    COMBINE(self,Sparsity,bool,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_unite(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  casadi::Sparsity *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Sparsity m2 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("Sparsity_unite",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_unite" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "Sparsity" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Sparsity const *)arg1)->unite((casadi::Sparsity const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_unite'."
      "  Prototype:\n"
      "    UNITE(self,Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_plus(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  casadi::Sparsity *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Sparsity m2 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("Sparsity_plus",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_plus" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "Sparsity" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Sparsity const *)arg1)->operator +((casadi::Sparsity const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_plus'."
      "  Prototype:\n"
      "    PLUS(self,Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_intersect(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  casadi::Sparsity *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Sparsity m2 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("Sparsity_intersect",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_intersect" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "Sparsity" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Sparsity const *)arg1)->intersect((casadi::Sparsity const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_intersect'."
      "  Prototype:\n"
      "    INTERSECT(self,Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_mtimes(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  casadi::Sparsity *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Sparsity m2 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("Sparsity_mtimes",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_mtimes" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "Sparsity" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Sparsity const *)arg1)->operator *((casadi::Sparsity const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_mtimes'."
      "  Prototype:\n"
      "    MTIMES(self,Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_is_subset(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  casadi::Sparsity *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Sparsity m2 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("Sparsity_is_subset",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_is_subset" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "Sparsity" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Sparsity const *)arg1)->is_subset((casadi::Sparsity const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_is_subset'."
      "  Prototype:\n"
      "    IS_SUBSET(self,Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_sparsity_cast_mod(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  casadi::Sparsity *arg2 = 0 ;
  casadi::Sparsity *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Sparsity m2 ;
  casadi::Sparsity m3 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("Sparsity_sparsity_cast_mod",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_sparsity_cast_mod" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "Sparsity" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "Sparsity" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Sparsity const *)arg1)->sparsity_cast_mod((casadi::Sparsity const &)*arg2,(casadi::Sparsity const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_sparsity_cast_mod'."
      "  Prototype:\n"
      "    SPARSITY_CAST_MOD(self,Sparsity,Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_pattern_inverse(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("Sparsity_pattern_inverse",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_pattern_inverse" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Sparsity const *)arg1)->pattern_inverse();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_pattern_inverse'."
      "  Prototype:\n"
      "    PATTERN_INVERSE(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_enlarge(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  casadi_int arg2 ;
  casadi_int arg3 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg4 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg5 = 0 ;
  bool arg6 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< casadi_int > m4 ;
  std::vector< casadi_int > m5 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("Sparsity_enlarge",argc,6,5,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_enlarge" "', argument " "1"" of type '" "casadi::Sparsity *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "[" "int" "]" "'.");
  arg5 = &m5;
  if (!casadi::to_ptr(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "[" "int" "]" "'.");
  if (5<argc) {
    if (!casadi::to_val(argv[5], &arg6)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 6 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->enlarge(arg2,arg3,(std::vector< casadi_int,std::allocator< casadi_int > > const &)*arg4,(std::vector< casadi_int,std::allocator< casadi_int > > const &)*arg5,arg6);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_enlarge'."
      "  Prototype:\n"
      "    ENLARGE(self,int,int,[int],[int],bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_enlargeRows(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  casadi_int arg2 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg3 = 0 ;
  bool arg4 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< casadi_int > m3 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("Sparsity_enlargeRows",argc,4,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_enlargeRows" "', argument " "1"" of type '" "casadi::Sparsity *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "[" "int" "]" "'.");
  if (3<argc) {
    if (!casadi::to_val(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->enlargeRows(arg2,(std::vector< casadi_int,std::allocator< casadi_int > > const &)*arg3,arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_enlargeRows'."
      "  Prototype:\n"
      "    ENLARGEROWS(self,int,[int],bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_enlargeColumns(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  casadi_int arg2 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg3 = 0 ;
  bool arg4 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< casadi_int > m3 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("Sparsity_enlargeColumns",argc,4,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_enlargeColumns" "', argument " "1"" of type '" "casadi::Sparsity *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "[" "int" "]" "'.");
  if (3<argc) {
    if (!casadi::to_val(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->enlargeColumns(arg2,(std::vector< casadi_int,std::allocator< casadi_int > > const &)*arg3,arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_enlargeColumns'."
      "  Prototype:\n"
      "    ENLARGECOLUMNS(self,int,[int],bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_makeDense(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< casadi_int > m2 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  arg2 = &m2;
  if (!SWIG_check_num_args("Sparsity_makeDense",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_makeDense" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Sparsity const *)arg1)->makeDense(*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_makeDense'."
      "  Prototype:\n"
      "    MAKEDENSE(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_erase__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg2 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg3 = 0 ;
  bool arg4 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< casadi_int > m2 ;
  std::vector< casadi_int > m3 ;
  mxArray * _out;
  std::vector< casadi_int,std::allocator< casadi_int > > result;
  
  if (!SWIG_check_num_args("Sparsity_erase",argc,4,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_erase" "', argument " "1"" of type '" "casadi::Sparsity *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "[" "int" "]" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "[" "int" "]" "'.");
  if (3<argc) {
    if (!casadi::to_val(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->erase((std::vector< casadi_int,std::allocator< casadi_int > > const &)*arg2,(std::vector< casadi_int,std::allocator< casadi_int > > const &)*arg3,arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[" "int" "]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_erase'."
      "  Prototype:\n"
      "    ERASE(self,[int],[int],bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_erase__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg2 = 0 ;
  bool arg3 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< casadi_int > m2 ;
  mxArray * _out;
  std::vector< casadi_int,std::allocator< casadi_int > > result;
  
  if (!SWIG_check_num_args("Sparsity_erase",argc,3,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_erase" "', argument " "1"" of type '" "casadi::Sparsity *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "[" "int" "]" "'.");
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->erase((std::vector< casadi_int,std::allocator< casadi_int > > const &)*arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[" "int" "]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_erase'."
      "  Prototype:\n"
      "    ERASE(self,[int],bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_erase(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 2) && (argc <= 3)) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Sparsity, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<casadi_int> **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_Sparsity_erase__SWIG_1(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< bool **>(0));
        if (_v) {
          return _wrap_Sparsity_erase__SWIG_1(resc,resv,argc,argv);
        }
      }
    }
  }
  if ((argc >= 3) && (argc <= 4)) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Sparsity, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<casadi_int> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::vector<casadi_int> **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_Sparsity_erase__SWIG_0(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< bool **>(0));
          if (_v) {
            return _wrap_Sparsity_erase__SWIG_0(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_erase'."
    "  Possible prototypes are:\n"
    "    ERASE(self,[int],bool)\n"
    "    ERASE(self,[int],[int],bool)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_Sparsity_append(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  casadi::Sparsity *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Sparsity m2 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("Sparsity_append",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_append" "', argument " "1"" of type '" "casadi::Sparsity *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "Sparsity" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->append((casadi::Sparsity const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_append'."
      "  Prototype:\n"
      "    APPEND(self,Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_appendColumns(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  casadi::Sparsity *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Sparsity m2 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("Sparsity_appendColumns",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_appendColumns" "', argument " "1"" of type '" "casadi::Sparsity *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "Sparsity" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->appendColumns((casadi::Sparsity const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_appendColumns'."
      "  Prototype:\n"
      "    APPENDCOLUMNS(self,Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_is_scalar(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  bool arg2 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("Sparsity_is_scalar",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_is_scalar" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Sparsity const *)arg1)->is_scalar(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_is_scalar'."
      "  Prototype:\n"
      "    IS_SCALAR(self,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_is_dense(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("Sparsity_is_dense",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_is_dense" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Sparsity const *)arg1)->is_dense();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_is_dense'."
      "  Prototype:\n"
      "    IS_DENSE(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_is_row(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("Sparsity_is_row",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_is_row" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Sparsity const *)arg1)->is_row();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_is_row'."
      "  Prototype:\n"
      "    IS_ROW(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_is_column(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("Sparsity_is_column",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_is_column" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Sparsity const *)arg1)->is_column();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_is_column'."
      "  Prototype:\n"
      "    IS_COLUMN(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_is_vector(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("Sparsity_is_vector",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_is_vector" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Sparsity const *)arg1)->is_vector();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_is_vector'."
      "  Prototype:\n"
      "    IS_VECTOR(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_is_diag(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("Sparsity_is_diag",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_is_diag" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Sparsity const *)arg1)->is_diag();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_is_diag'."
      "  Prototype:\n"
      "    IS_DIAG(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_is_square(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("Sparsity_is_square",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_is_square" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Sparsity const *)arg1)->is_square();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_is_square'."
      "  Prototype:\n"
      "    IS_SQUARE(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_is_symmetric(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("Sparsity_is_symmetric",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_is_symmetric" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Sparsity const *)arg1)->is_symmetric();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_is_symmetric'."
      "  Prototype:\n"
      "    IS_SYMMETRIC(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_is_triu(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  bool arg2 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("Sparsity_is_triu",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_is_triu" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Sparsity const *)arg1)->is_triu(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_is_triu'."
      "  Prototype:\n"
      "    IS_TRIU(self,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_is_tril(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  bool arg2 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("Sparsity_is_tril",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_is_tril" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Sparsity const *)arg1)->is_tril(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_is_tril'."
      "  Prototype:\n"
      "    IS_TRIL(self,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_is_singular(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("Sparsity_is_singular",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_is_singular" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Sparsity const *)arg1)->is_singular();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_is_singular'."
      "  Prototype:\n"
      "    IS_SINGULAR(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_is_permutation(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("Sparsity_is_permutation",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_is_permutation" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Sparsity const *)arg1)->is_permutation();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_is_permutation'."
      "  Prototype:\n"
      "    IS_PERMUTATION(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_is_selection(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  bool arg2 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("Sparsity_is_selection",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_is_selection" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Sparsity const *)arg1)->is_selection(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_is_selection'."
      "  Prototype:\n"
      "    IS_SELECTION(self,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_is_orthonormal(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  bool arg2 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("Sparsity_is_orthonormal",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_is_orthonormal" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Sparsity const *)arg1)->is_orthonormal(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_is_orthonormal'."
      "  Prototype:\n"
      "    IS_ORTHONORMAL(self,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_is_orthonormal_rows(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  bool arg2 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("Sparsity_is_orthonormal_rows",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_is_orthonormal_rows" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Sparsity const *)arg1)->is_orthonormal_rows(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_is_orthonormal_rows'."
      "  Prototype:\n"
      "    IS_ORTHONORMAL_ROWS(self,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_is_orthonormal_columns(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  bool arg2 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("Sparsity_is_orthonormal_columns",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_is_orthonormal_columns" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Sparsity const *)arg1)->is_orthonormal_columns(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_is_orthonormal_columns'."
      "  Prototype:\n"
      "    IS_ORTHONORMAL_COLUMNS(self,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_rowsSequential(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  bool arg2 = (bool) true ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("Sparsity_rowsSequential",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_rowsSequential" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Sparsity const *)arg1)->rowsSequential(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_rowsSequential'."
      "  Prototype:\n"
      "    ROWSSEQUENTIAL(self,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_removeDuplicates(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< casadi_int > m2 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("Sparsity_removeDuplicates",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_removeDuplicates" "', argument " "1"" of type '" "casadi::Sparsity *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input to type '" "[" "int" "]" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->removeDuplicates(*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_removeDuplicates'."
      "  Prototype:\n"
      "    REMOVEDUPLICATES(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_etree(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  bool arg2 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi_int,std::allocator< casadi_int > > result;
  
  if (!SWIG_check_num_args("Sparsity_etree",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_etree" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Sparsity const *)arg1)->etree(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[" "int" "]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_etree'."
      "  Prototype:\n"
      "    ETREE(self,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_ldl(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg2 = 0 ;
  bool arg3 = (bool) true ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< casadi_int > m2 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  arg2 = &m2;
  if (!SWIG_check_num_args("Sparsity_ldl",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_ldl" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Sparsity const *)arg1)->ldl(*arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_ldl'."
      "  Prototype:\n"
      "    LDL(self,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_qr_sparse(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  casadi::Sparsity *arg2 = 0 ;
  casadi::Sparsity *arg3 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg4 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg5 = 0 ;
  bool arg6 = (bool) true ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Sparsity m2 ;
  casadi::Sparsity m3 ;
  std::vector< casadi_int > m4 ;
  std::vector< casadi_int > m5 ;
  mxArray * _out;
  
  arg2 = &m2;
  arg3 = &m3;
  arg4 = &m4;
  arg5 = &m5;
  if (!SWIG_check_num_args("Sparsity_qr_sparse",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_qr_sparse" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg6)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 6 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Sparsity const *)arg1)->qr_sparse(*arg2,*arg3,*arg4,*arg5,arg6);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg3);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg4);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg5);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_qr_sparse'."
      "  Prototype:\n"
      "    QR_SPARSE(self,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_dfs(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  casadi_int arg2 ;
  casadi_int arg3 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg4 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg5 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg6 = 0 ;
  std::vector< bool,std::allocator< bool > > *arg7 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< casadi_int > m4 ;
  std::vector< casadi_int > m5 ;
  std::vector< casadi_int > m6 ;
  std::vector< bool > m7 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("Sparsity_dfs",argc,7,7,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_dfs" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input to type '" "[" "int" "]" "'.");
  arg5 = &m5;
  if (!casadi::to_ptr(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input to type '" "[" "int" "]" "'.");
  arg6 = &m6;
  if (!casadi::to_ptr(argv[5], &arg6)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 6 to type '" "[" "int" "]" "'.");
  arg7 = &m7;
  if (!casadi::to_ptr(argv[6], &arg7)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input to type '" "[" "bool" "]" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::Sparsity const *)arg1)->dfs(arg2,arg3,*arg4,*arg5,(std::vector< casadi_int,std::allocator< casadi_int > > const &)*arg6,*arg7);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg4);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg5);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg7);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_dfs'."
      "  Prototype:\n"
      "    DFS(self,int,int,[int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_scc(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg2 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< casadi_int > m2 ;
  std::vector< casadi_int > m3 ;
  mxArray * _out;
  casadi_int result;
  
  arg2 = &m2;
  arg3 = &m3;
  if (!SWIG_check_num_args("Sparsity_scc",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_scc" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::Sparsity const *)arg1)->scc(*arg2,*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg3);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_scc'."
      "  Prototype:\n"
      "    SCC(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_btf(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg2 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg3 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg4 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg5 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg6 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg7 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< casadi_int > m2 ;
  std::vector< casadi_int > m3 ;
  std::vector< casadi_int > m4 ;
  std::vector< casadi_int > m5 ;
  std::vector< casadi_int > m6 ;
  std::vector< casadi_int > m7 ;
  mxArray * _out;
  casadi_int result;
  
  arg2 = &m2;
  arg3 = &m3;
  arg4 = &m4;
  arg5 = &m5;
  arg6 = &m6;
  arg7 = &m7;
  if (!SWIG_check_num_args("Sparsity_btf",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_btf" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::Sparsity const *)arg1)->btf(*arg2,*arg3,*arg4,*arg5,*arg6,*arg7);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg3);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg4);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg5);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg6);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg7);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_btf'."
      "  Prototype:\n"
      "    BTF(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_amd(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi_int,std::allocator< casadi_int > > result;
  
  if (!SWIG_check_num_args("Sparsity_amd",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_amd" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Sparsity const *)arg1)->amd();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[" "int" "]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_amd'."
      "  Prototype:\n"
      "    AMD(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_find(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  bool arg2 = (bool) true ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi_int,std::allocator< casadi_int > > result;
  
  if (!SWIG_check_num_args("Sparsity_find",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_find" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Sparsity const *)arg1)->find(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[" "int" "]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_find'."
      "  Prototype:\n"
      "    FIND(self,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_uni_coloring(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  casadi::Sparsity const &arg2_defvalue = casadi::Sparsity() ;
  casadi::Sparsity *arg2 = (casadi::Sparsity *) &arg2_defvalue ;
  casadi_int arg3 = (casadi_int) std::numeric_limits< casadi_int >::max() ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Sparsity m2 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("Sparsity_uni_coloring",argc,3,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_uni_coloring" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  if (1<argc) {
    arg2 = &m2;
    if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "Sparsity" "'.");
  }
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Sparsity const *)arg1)->uni_coloring((casadi::Sparsity const &)*arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_uni_coloring'."
      "  Prototype:\n"
      "    UNI_COLORING(self,Sparsity,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_star_coloring(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  casadi_int arg2 = (casadi_int) 1 ;
  casadi_int arg3 = (casadi_int) std::numeric_limits< casadi_int >::max() ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("Sparsity_star_coloring",argc,3,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_star_coloring" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  }
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Sparsity const *)arg1)->star_coloring(arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_star_coloring'."
      "  Prototype:\n"
      "    STAR_COLORING(self,int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_star_coloring2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  casadi_int arg2 = (casadi_int) 1 ;
  casadi_int arg3 = (casadi_int) std::numeric_limits< casadi_int >::max() ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("Sparsity_star_coloring2",argc,3,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_star_coloring2" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  }
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Sparsity const *)arg1)->star_coloring2(arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_star_coloring2'."
      "  Prototype:\n"
      "    STAR_COLORING2(self,int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_largest_first(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi_int,std::allocator< casadi_int > > result;
  
  if (!SWIG_check_num_args("Sparsity_largest_first",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_largest_first" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Sparsity const *)arg1)->largest_first();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[" "int" "]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_largest_first'."
      "  Prototype:\n"
      "    LARGEST_FIRST(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_pmult(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg2 = 0 ;
  bool arg3 = (bool) true ;
  bool arg4 = (bool) true ;
  bool arg5 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< casadi_int > m2 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("Sparsity_pmult",argc,5,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_pmult" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "[" "int" "]" "'.");
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  }
  if (3<argc) {
    if (!casadi::to_val(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "bool" "'.");
  }
  if (4<argc) {
    if (!casadi::to_val(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Sparsity const *)arg1)->pmult((std::vector< casadi_int,std::allocator< casadi_int > > const &)*arg2,arg3,arg4,arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_pmult'."
      "  Prototype:\n"
      "    PMULT(self,[int],bool,bool,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_dim(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  bool arg2 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("Sparsity_dim",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_dim" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Sparsity const *)arg1)->dim(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_dim'."
      "  Prototype:\n"
      "    DIM(self,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_postfix_dim(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("Sparsity_postfix_dim",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_postfix_dim" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Sparsity const *)arg1)->postfix_dim();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_postfix_dim'."
      "  Prototype:\n"
      "    POSTFIX_DIM(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_repr_el(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  casadi_int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("Sparsity_repr_el",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_repr_el" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Sparsity const *)arg1)->repr_el(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_repr_el'."
      "  Prototype:\n"
      "    REPR_EL(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_spy(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  std::ostream &arg2_defvalue = casadi::uout() ;
  std::ostream *arg2 = (std::ostream *) &arg2_defvalue ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  arg2 = &casadi::uout();
  if (!SWIG_check_num_args("Sparsity_spy",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_spy" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Sparsity const *)arg1)->spy(*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  *arg2 << "\n" << std::flush;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_spy'."
      "  Prototype:\n"
      "    SPY(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_spy_matlab(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("Sparsity_spy_matlab",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_spy_matlab" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Sparsity const *)arg1)->spy_matlab((std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_spy_matlab'."
      "  Prototype:\n"
      "    SPY_MATLAB(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_export_code(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  std::string *arg2 = 0 ;
  std::ostream &arg3_defvalue = casadi::uout() ;
  std::ostream *arg3 = (std::ostream *) &arg3_defvalue ;
  casadi::Dict const &arg4_defvalue = casadi::Dict() ;
  casadi::Dict *arg4 = (casadi::Dict *) &arg4_defvalue ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  std::map< std::string,casadi::GenericType > m4 ;
  mxArray * _out;
  
  arg3 = &casadi::uout();
  if (!SWIG_check_num_args("Sparsity_export_code",argc,3,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_export_code" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  if (2<argc) {
    arg4 = &m4;
    if (!casadi::to_ptr(argv[2], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "struct" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Sparsity const *)arg1)->export_code((std::string const &)*arg2,*arg3,(casadi::Dict const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  *arg3 << "\n" << std::flush;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_export_code'."
      "  Prototype:\n"
      "    EXPORT_CODE(self,char,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_type_name(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("Sparsity_type_name",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      result = casadi::Sparsity::type_name();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_type_name'."
      "  Prototype:\n"
      "    TYPE_NAME()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_hash(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::size_t result;
  
  if (!SWIG_check_num_args("Sparsity_hash",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_hash" "', argument " "1"" of type '" "casadi::Sparsity const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Sparsity const *)arg1)->hash();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_From_size_t(static_cast< size_t >(result));
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_hash'."
      "  Prototype:\n"
      "    HASH(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_test_cast(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::SharedObjectInternal *arg1 = (casadi::SharedObjectInternal *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("Sparsity_test_cast",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__SharedObjectInternal, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sparsity_test_cast" "', argument " "1"" of type '" "casadi::SharedObjectInternal const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::SharedObjectInternal * >(argp1);
  {
    try {
      result = (bool)casadi::Sparsity::test_cast((casadi::SharedObjectInternal const *)arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_test_cast'."
      "  Prototype:\n"
      "    TEST_CAST(casadi::SharedObjectInternal const *)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Sparsity_kkt(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = 0 ;
  casadi::Sparsity *arg2 = 0 ;
  bool arg3 = (bool) true ;
  bool arg4 = (bool) true ;
  casadi::Sparsity m1 ;
  casadi::Sparsity m2 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("Sparsity_kkt",argc,4,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Sparsity" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "Sparsity" "'.");
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  }
  if (3<argc) {
    if (!casadi::to_val(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "bool" "'.");
  }
  {
    try {
      result = casadi::Sparsity::kkt((casadi::Sparsity const &)*arg1,(casadi::Sparsity const &)*arg2,arg3,arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Sparsity_kkt'."
      "  Prototype:\n"
      "    KKT(Sparsity,Sparsity,bool,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_Sparsity__SWIG_4(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = 0 ;
  casadi::Sparsity m1 ;
  mxArray * _out;
  casadi::Sparsity *result = 0 ;
  
  if (!SWIG_check_num_args("new_Sparsity",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Sparsity" "'.");
  {
    result = (casadi::Sparsity *)new casadi::Sparsity((casadi::Sparsity const &)*arg1);
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__Sparsity, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_Sparsity'."
      "  Prototype:\n"
      "    SPARSITY(Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_Sparsity(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 0) && (argc <= 1)) {
    int _v;
    if (argc <= 0) {
      return _wrap_new_Sparsity__SWIG_0(resc,resv,argc,argv);
    }
    _v = casadi::to_ptr(argv[0], static_cast< casadi_int **>(0));
    if (_v) {
      return _wrap_new_Sparsity__SWIG_0(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::pair<casadi_int,casadi_int> **>(0));
    if (_v) {
      return _wrap_new_Sparsity__SWIG_3(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Sparsity **>(0));
    if (_v) {
      return _wrap_new_Sparsity__SWIG_4(resc,resv,argc,argv);
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi_int **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_new_Sparsity__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if ((argc >= 4) && (argc <= 5)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi_int **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::vector<casadi_int> **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< std::vector<casadi_int> **>(0));
          if (_v) {
            if (argc <= 4) {
              return _wrap_new_Sparsity__SWIG_2(resc,resv,argc,argv);
            }
            _v = casadi::to_ptr(argv[4], static_cast< bool **>(0));
            if (_v) {
              return _wrap_new_Sparsity__SWIG_2(resc,resv,argc,argv);
            }
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_Sparsity'."
    "  Possible prototypes are:\n"
    "    SPARSITY(int)\n"
    "    SPARSITY([int,int])\n"
    "    SPARSITY(Sparsity)\n"
    "    SPARSITY(int,int)\n"
    "    SPARSITY(int,int,[int],[int],bool)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_delete_Sparsity(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = (casadi::Sparsity *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  int is_owned;
  if (!SWIG_check_num_args("delete_Sparsity",argc,1,1,0)) {
    SWIG_fail;
  }
  is_owned = SWIG_Matlab_isOwned(argv[0]);
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Sparsity, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Sparsity" "', argument " "1"" of type '" "casadi::Sparsity *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Sparsity * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  if (is_owned) {
    {
      delete arg1;
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'delete_Sparsity'."
      "  Prototype:\n"
      "    SPARSITY(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_hash_sparsity__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 ;
  casadi_int arg2 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg3 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg4 = 0 ;
  std::vector< casadi_int > m3 ;
  std::vector< casadi_int > m4 ;
  mxArray * _out;
  std::size_t result;
  
  if (!SWIG_check_num_args("hash_sparsity",argc,4,4,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "[" "int" "]" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "[" "int" "]" "'.");
  {
    try {
      result = casadi::hash_sparsity(arg1,arg2,(std::vector< long long,std::allocator< long long > > const &)*arg3,(std::vector< long long,std::allocator< long long > > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_From_size_t(static_cast< size_t >(result));
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'hash_sparsity'."
      "  Prototype:\n"
      "    HASH_SPARSITY(int,int,[int],[int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_hash_sparsity__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 ;
  casadi_int arg2 ;
  casadi_int *arg3 = (casadi_int *) 0 ;
  casadi_int *arg4 = (casadi_int *) 0 ;
  void *argp3 = 0 ;
  int res3 = 0 ;
  void *argp4 = 0 ;
  int res4 = 0 ;
  mxArray * _out;
  std::size_t result;
  
  if (!SWIG_check_num_args("hash_sparsity",argc,4,4,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  res3 = SWIG_ConvertPtr(argv[2], &argp3,SWIGTYPE_p_long_long, 0 |  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "hash_sparsity" "', argument " "3"" of type '" "casadi_int const *""'"); 
  }
  arg3 = reinterpret_cast< casadi_int * >(argp3);
  res4 = SWIG_ConvertPtr(argv[3], &argp4,SWIGTYPE_p_long_long, 0 |  0 );
  if (!SWIG_IsOK(res4)) {
    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "hash_sparsity" "', argument " "4"" of type '" "casadi_int const *""'"); 
  }
  arg4 = reinterpret_cast< casadi_int * >(argp4);
  {
    try {
      result = casadi::hash_sparsity(arg1,arg2,(long long const *)arg3,(long long const *)arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_From_size_t(static_cast< size_t >(result));
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'hash_sparsity'."
      "  Prototype:\n"
      "    HASH_SPARSITY(int,int,casadi_int const *,casadi_int const *)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_hash_sparsity(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 4) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi_int **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        void *vptr = 0;
        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_long_long, 0);
        _v = SWIG_CheckState(res);
        if (_v) {
          void *vptr = 0;
          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_long_long, 0);
          _v = SWIG_CheckState(res);
          if (_v) {
            return _wrap_hash_sparsity__SWIG_1(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi_int **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::vector<casadi_int> **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< std::vector<casadi_int> **>(0));
          if (_v) {
            return _wrap_hash_sparsity__SWIG_0(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'hash_sparsity'."
    "  Possible prototypes are:\n"
    "    HASH_SPARSITY(int,int,casadi_int const *,casadi_int const *)\n"
    "    HASH_SPARSITY(int,int,[int],[int])\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_Slice_start_get(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Slice *arg1 = (casadi::Slice *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("Slice_start_get",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Slice, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Slice_start_get" "', argument " "1"" of type '" "casadi::Slice *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Slice * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  result = (casadi_int) ((arg1)->start);
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Slice_start_get'."
      "  Prototype:\n"
      "    SLICE_START_GET(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Slice_stop_get(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Slice *arg1 = (casadi::Slice *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("Slice_stop_get",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Slice, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Slice_stop_get" "', argument " "1"" of type '" "casadi::Slice *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Slice * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  result = (casadi_int) ((arg1)->stop);
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Slice_stop_get'."
      "  Prototype:\n"
      "    SLICE_STOP_GET(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Slice_step_get(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Slice *arg1 = (casadi::Slice *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("Slice_step_get",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Slice, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Slice_step_get" "', argument " "1"" of type '" "casadi::Slice *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Slice * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  result = (casadi_int) ((arg1)->step);
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Slice_step_get'."
      "  Prototype:\n"
      "    SLICE_STEP_GET(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_Slice__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  casadi::Slice *result = 0 ;
  
  if (!SWIG_check_num_args("new_Slice",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      result = (casadi::Slice *)new casadi::Slice();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__Slice, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_Slice'."
      "  Prototype:\n"
      "    SLICE()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_Slice__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 ;
  bool arg2 = (bool) false ;
  mxArray * _out;
  casadi::Slice *result = 0 ;
  
  if (!SWIG_check_num_args("new_Slice",argc,2,1,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "bool" "'.");
  }
  {
    try {
      result = (casadi::Slice *)new casadi::Slice(arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__Slice, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_Slice'."
      "  Prototype:\n"
      "    SLICE(int,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_Slice__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 ;
  casadi_int arg2 ;
  casadi_int arg3 = (casadi_int) 1 ;
  mxArray * _out;
  casadi::Slice *result = 0 ;
  
  if (!SWIG_check_num_args("new_Slice",argc,3,2,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  }
  {
    try {
      result = (casadi::Slice *)new casadi::Slice(arg1,arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__Slice, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_Slice'."
      "  Prototype:\n"
      "    SLICE(int,int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_Slice__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  int arg1 ;
  int arg2 ;
  int arg3 = (int) 1 ;
  int val1 ;
  int ecode1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  mxArray * _out;
  casadi::Slice *result = 0 ;
  
  if (!SWIG_check_num_args("new_Slice",argc,3,2,0)) {
    SWIG_fail;
  }
  ecode1 = SWIG_AsVal_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_Slice" "', argument " "1"" of type '" "int""'");
  } 
  arg1 = static_cast< int >(val1);
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_Slice" "', argument " "2"" of type '" "int""'");
  } 
  arg2 = static_cast< int >(val2);
  if (2<argc) {
    ecode3 = SWIG_AsVal_int(argv[2], &val3);
    if (!SWIG_IsOK(ecode3)) {
      SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_Slice" "', argument " "3"" of type '" "int""'");
    } 
    arg3 = static_cast< int >(val3);
  }
  {
    try {
      result = (casadi::Slice *)new casadi::Slice(arg1,arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__Slice, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_Slice'."
      "  Prototype:\n"
      "    SLICE(int,int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_Slice__SWIG_4(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  int arg1 ;
  casadi_int arg2 ;
  int arg3 = (int) 1 ;
  int val1 ;
  int ecode1 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  mxArray * _out;
  casadi::Slice *result = 0 ;
  
  if (!SWIG_check_num_args("new_Slice",argc,3,2,0)) {
    SWIG_fail;
  }
  ecode1 = SWIG_AsVal_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_Slice" "', argument " "1"" of type '" "int""'");
  } 
  arg1 = static_cast< int >(val1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  if (2<argc) {
    ecode3 = SWIG_AsVal_int(argv[2], &val3);
    if (!SWIG_IsOK(ecode3)) {
      SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_Slice" "', argument " "3"" of type '" "int""'");
    } 
    arg3 = static_cast< int >(val3);
  }
  {
    try {
      result = (casadi::Slice *)new casadi::Slice(arg1,arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__Slice, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_Slice'."
      "  Prototype:\n"
      "    SLICE(int,int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_Slice__SWIG_5(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 ;
  int arg2 ;
  int arg3 = (int) 1 ;
  int val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  mxArray * _out;
  casadi::Slice *result = 0 ;
  
  if (!SWIG_check_num_args("new_Slice",argc,3,2,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_Slice" "', argument " "2"" of type '" "int""'");
  } 
  arg2 = static_cast< int >(val2);
  if (2<argc) {
    ecode3 = SWIG_AsVal_int(argv[2], &val3);
    if (!SWIG_IsOK(ecode3)) {
      SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_Slice" "', argument " "3"" of type '" "int""'");
    } 
    arg3 = static_cast< int >(val3);
  }
  {
    try {
      result = (casadi::Slice *)new casadi::Slice(arg1,arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__Slice, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_Slice'."
      "  Prototype:\n"
      "    SLICE(int,int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Slice_all__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Slice *arg1 = (casadi::Slice *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi_int,std::allocator< casadi_int > > result;
  
  if (!SWIG_check_num_args("Slice_all",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Slice, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Slice_all" "', argument " "1"" of type '" "casadi::Slice const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Slice * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Slice const *)arg1)->all();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[" "int" "]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Slice_all'."
      "  Prototype:\n"
      "    ALL(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Slice_all__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Slice *arg1 = (casadi::Slice *) 0 ;
  casadi_int arg2 ;
  bool arg3 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi_int,std::allocator< casadi_int > > result;
  
  if (!SWIG_check_num_args("Slice_all",argc,3,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Slice, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Slice_all" "', argument " "1"" of type '" "casadi::Slice const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Slice * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Slice const *)arg1)->all(arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[" "int" "]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Slice_all'."
      "  Prototype:\n"
      "    ALL(self,int,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Slice_all__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Slice *arg1 = (casadi::Slice *) 0 ;
  casadi::Slice *arg2 = 0 ;
  casadi_int arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Slice m2 ;
  mxArray * _out;
  std::vector< casadi_int,std::allocator< casadi_int > > result;
  
  if (!SWIG_check_num_args("Slice_all",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Slice, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Slice_all" "', argument " "1"" of type '" "casadi::Slice const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Slice * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "Slice" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Slice const *)arg1)->all((casadi::Slice const &)*arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[" "int" "]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Slice_all'."
      "  Prototype:\n"
      "    ALL(self,Slice,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Slice_all(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Slice, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_Slice_all__SWIG_0(resc,resv,argc,argv);
    }
  }
  if ((argc >= 2) && (argc <= 3)) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Slice, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_Slice_all__SWIG_1(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< bool **>(0));
        if (_v) {
          return _wrap_Slice_all__SWIG_1(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Slice, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Slice **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          return _wrap_Slice_all__SWIG_2(resc,resv,argc,argv);
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Slice_all'."
    "  Possible prototypes are:\n"
    "    ALL(self)\n"
    "    ALL(self,int,bool)\n"
    "    ALL(self,Slice,int)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_Slice_size(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Slice *arg1 = (casadi::Slice *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  size_t result;
  
  if (!SWIG_check_num_args("Slice_size",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Slice, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Slice_size" "', argument " "1"" of type '" "casadi::Slice const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Slice * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Slice const *)arg1)->size();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_From_size_t(static_cast< size_t >(result));
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Slice_size'."
      "  Prototype:\n"
      "    SIZE(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Slice_is_empty(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Slice *arg1 = (casadi::Slice *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("Slice_is_empty",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Slice, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Slice_is_empty" "', argument " "1"" of type '" "casadi::Slice const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Slice * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Slice const *)arg1)->is_empty();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Slice_is_empty'."
      "  Prototype:\n"
      "    IS_EMPTY(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Slice_is_scalar(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Slice *arg1 = (casadi::Slice *) 0 ;
  casadi_int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("Slice_is_scalar",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Slice, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Slice_is_scalar" "', argument " "1"" of type '" "casadi::Slice const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Slice * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Slice const *)arg1)->is_scalar(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Slice_is_scalar'."
      "  Prototype:\n"
      "    IS_SCALAR(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Slice_scalar(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Slice *arg1 = (casadi::Slice *) 0 ;
  casadi_int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("Slice_scalar",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Slice, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Slice_scalar" "', argument " "1"" of type '" "casadi::Slice const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Slice * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::Slice const *)arg1)->scalar(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Slice_scalar'."
      "  Prototype:\n"
      "    SCALAR(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Slice_eq(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Slice *arg1 = (casadi::Slice *) 0 ;
  casadi::Slice *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Slice m2 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("Slice_eq",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Slice, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Slice_eq" "', argument " "1"" of type '" "casadi::Slice const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Slice * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "Slice" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Slice const *)arg1)->operator ==((casadi::Slice const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Slice_eq'."
      "  Prototype:\n"
      "    EQ(self,Slice)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Slice_ne(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Slice *arg1 = (casadi::Slice *) 0 ;
  casadi::Slice *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Slice m2 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("Slice_ne",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Slice, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Slice_ne" "', argument " "1"" of type '" "casadi::Slice const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Slice * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "Slice" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Slice const *)arg1)->operator !=((casadi::Slice const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Slice_ne'."
      "  Prototype:\n"
      "    NE(self,Slice)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Slice_apply(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Slice *arg1 = (casadi::Slice *) 0 ;
  casadi_int arg2 ;
  bool arg3 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Slice result;
  
  if (!SWIG_check_num_args("Slice_apply",argc,3,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Slice, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Slice_apply" "', argument " "1"" of type '" "casadi::Slice const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Slice * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Slice const *)arg1)->apply(arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Slice" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Slice_apply'."
      "  Prototype:\n"
      "    APPLY(self,int,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Slice_minus(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Slice *arg1 = (casadi::Slice *) 0 ;
  casadi_int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Slice result;
  
  if (!SWIG_check_num_args("Slice_minus",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Slice, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Slice_minus" "', argument " "1"" of type '" "casadi::Slice const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Slice * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Slice const *)arg1)->operator -(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Slice" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Slice_minus'."
      "  Prototype:\n"
      "    MINUS(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Slice_mtimes(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Slice *arg1 = (casadi::Slice *) 0 ;
  casadi_int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Slice result;
  
  if (!SWIG_check_num_args("Slice_mtimes",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Slice, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Slice_mtimes" "', argument " "1"" of type '" "casadi::Slice const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Slice * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Slice const *)arg1)->operator *(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Slice" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Slice_mtimes'."
      "  Prototype:\n"
      "    MTIMES(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Slice_type_name(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Slice *arg1 = (casadi::Slice *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("Slice_type_name",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Slice, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Slice_type_name" "', argument " "1"" of type '" "casadi::Slice const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Slice * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Slice const *)arg1)->type_name();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Slice_type_name'."
      "  Prototype:\n"
      "    TYPE_NAME(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Slice_disp(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Slice *arg1 = (casadi::Slice *) 0 ;
  std::ostream *arg2 = 0 ;
  bool arg3 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  arg2 = &casadi::uout();
  if (!SWIG_check_num_args("Slice_disp",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Slice, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Slice_disp" "', argument " "1"" of type '" "casadi::Slice const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Slice * >(argp1);
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Slice const *)arg1)->disp(*arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  *arg2 << "\n" << std::flush;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Slice_disp'."
      "  Prototype:\n"
      "    DISP(self,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Slice_str(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Slice *arg1 = (casadi::Slice *) 0 ;
  bool arg2 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("Slice_str",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Slice, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Slice_str" "', argument " "1"" of type '" "casadi::Slice const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Slice * >(argp1);
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Slice const *)arg1)->get_str(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Slice_str'."
      "  Prototype:\n"
      "    STR(self,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Slice_info(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Slice *arg1 = (casadi::Slice *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Dict result;
  
  if (!SWIG_check_num_args("Slice_info",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Slice, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Slice_info" "', argument " "1"" of type '" "casadi::Slice const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Slice * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Slice const *)arg1)->info();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "struct" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Slice_info'."
      "  Prototype:\n"
      "    INFO(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Slice_serialize(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Slice *arg1 = (casadi::Slice *) 0 ;
  casadi::SerializingStream *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("Slice_serialize",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Slice, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Slice_serialize" "', argument " "1"" of type '" "casadi::Slice const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Slice * >(argp1);
  res2 = SWIG_ConvertPtr(argv[1], &argp2, SWIGTYPE_p_casadi__SerializingStream,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Slice_serialize" "', argument " "2"" of type '" "casadi::SerializingStream &""'"); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Slice_serialize" "', argument " "2"" of type '" "casadi::SerializingStream &""'"); 
  }
  arg2 = reinterpret_cast< casadi::SerializingStream * >(argp2);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Slice const *)arg1)->serialize(*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Slice_serialize'."
      "  Prototype:\n"
      "    SERIALIZE(self,casadi::SerializingStream &)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Slice_deserialize(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DeserializingStream *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Slice result;
  
  if (!SWIG_check_num_args("Slice_deserialize",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_casadi__DeserializingStream,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Slice_deserialize" "', argument " "1"" of type '" "casadi::DeserializingStream &""'"); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Slice_deserialize" "', argument " "1"" of type '" "casadi::DeserializingStream &""'"); 
  }
  arg1 = reinterpret_cast< casadi::DeserializingStream * >(argp1);
  {
    try {
      result = casadi::Slice::deserialize(*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Slice" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Slice_deserialize'."
      "  Prototype:\n"
      "    DESERIALIZE(casadi::DeserializingStream &)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_Slice__SWIG_6(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Slice *arg1 = 0 ;
  casadi::Slice m1 ;
  mxArray * _out;
  casadi::Slice *result = 0 ;
  
  if (!SWIG_check_num_args("new_Slice",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Slice" "'.");
  {
    result = (casadi::Slice *)new casadi::Slice((casadi::Slice const &)*arg1);
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__Slice, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_Slice'."
      "  Prototype:\n"
      "    SLICE(Slice)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_Slice(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 0) {
    return _wrap_new_Slice__SWIG_0(resc,resv,argc,argv);
  }
  if ((argc >= 1) && (argc <= 2)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi_int **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_new_Slice__SWIG_1(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< bool **>(0));
      if (_v) {
        return _wrap_new_Slice__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Slice **>(0));
    if (_v) {
      return _wrap_new_Slice__SWIG_6(resc,resv,argc,argv);
    }
  }
  if ((argc >= 2) && (argc <= 3)) {
    int _v;
    {
      int res = SWIG_AsVal_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      {
        int res = SWIG_AsVal_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        if (argc <= 2) {
          return _wrap_new_Slice__SWIG_3(resc,resv,argc,argv);
        }
        {
          int res = SWIG_AsVal_int(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_new_Slice__SWIG_3(resc,resv,argc,argv);
        }
      }
    }
  }
  if ((argc >= 2) && (argc <= 3)) {
    int _v;
    {
      int res = SWIG_AsVal_int(argv[0], NULL);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_new_Slice__SWIG_4(resc,resv,argc,argv);
        }
        {
          int res = SWIG_AsVal_int(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_new_Slice__SWIG_4(resc,resv,argc,argv);
        }
      }
    }
  }
  if ((argc >= 2) && (argc <= 3)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi_int **>(0));
    if (_v) {
      {
        int res = SWIG_AsVal_int(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        if (argc <= 2) {
          return _wrap_new_Slice__SWIG_5(resc,resv,argc,argv);
        }
        {
          int res = SWIG_AsVal_int(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_new_Slice__SWIG_5(resc,resv,argc,argv);
        }
      }
    }
  }
  if ((argc >= 2) && (argc <= 3)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi_int **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_new_Slice__SWIG_2(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          return _wrap_new_Slice__SWIG_2(resc,resv,argc,argv);
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_Slice'."
    "  Possible prototypes are:\n"
    "    SLICE()\n"
    "    SLICE(int,bool)\n"
    "    SLICE(Slice)\n"
    "    SLICE(int,int,int)\n"
    "    SLICE(int,int,int)\n"
    "    SLICE(int,int,int)\n"
    "    SLICE(int,int,int)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_delete_Slice(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Slice *arg1 = (casadi::Slice *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  int is_owned;
  if (!SWIG_check_num_args("delete_Slice",argc,1,1,0)) {
    SWIG_fail;
  }
  is_owned = SWIG_Matlab_isOwned(argv[0]);
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Slice, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Slice" "', argument " "1"" of type '" "casadi::Slice *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Slice * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  if (is_owned) {
    {
      delete arg1;
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'delete_Slice'."
      "  Prototype:\n"
      "    SLICE(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_to_slice(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< casadi_int,std::allocator< casadi_int > > *arg1 = 0 ;
  bool arg2 = (bool) false ;
  std::vector< casadi_int > m1 ;
  mxArray * _out;
  casadi::Slice result;
  
  if (!SWIG_check_num_args("to_slice",argc,2,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "[" "int" "]" "'.");
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "bool" "'.");
  }
  {
    try {
      result = casadi::to_slice((std::vector< long long,std::allocator< long long > > const &)*arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Slice" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'to_slice'."
      "  Prototype:\n"
      "    TO_SLICE([int],bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_to_slice2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< casadi_int,std::allocator< casadi_int > > *arg1 = 0 ;
  std::vector< casadi_int > m1 ;
  mxArray * _out;
  SwigValueWrapper< std::pair< casadi::Slice,casadi::Slice > > result;
  
  if (!SWIG_check_num_args("to_slice2",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "[" "int" "]" "'.");
  {
    try {
      result = casadi::to_slice2((std::vector< long long,std::allocator< long long > > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj((new std::pair< casadi::Slice,casadi::Slice >(static_cast< const std::pair< casadi::Slice,casadi::Slice >& >(result))), SWIGTYPE_p_std__pairT_casadi__Slice_casadi__Slice_t, SWIG_POINTER_OWN |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'to_slice2'."
      "  Prototype:\n"
      "    TO_SLICE2([int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_is_slice(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< casadi_int,std::allocator< casadi_int > > *arg1 = 0 ;
  bool arg2 = (bool) false ;
  std::vector< casadi_int > m1 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("is_slice",argc,2,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "[" "int" "]" "'.");
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "bool" "'.");
  }
  {
    try {
      result = (bool)casadi::is_slice((std::vector< long long,std::allocator< long long > > const &)*arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'is_slice'."
      "  Prototype:\n"
      "    IS_SLICE([int],bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_is_slice2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< casadi_int,std::allocator< casadi_int > > *arg1 = 0 ;
  std::vector< casadi_int > m1 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("is_slice2",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "[" "int" "]" "'.");
  {
    try {
      result = (bool)casadi::is_slice2((std::vector< long long,std::allocator< long long > > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'is_slice2'."
      "  Prototype:\n"
      "    IS_SLICE2([int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_mpower__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_mpower",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_mpower__SWIG_0((casadi::MX const &)*arg1,(casadi::MX const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_mpower'."
      "  Prototype:\n"
      "    MPOWER(MX,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_mrdivide__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_mrdivide",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_mrdivide__SWIG_0((casadi::MX const &)*arg1,(casadi::MX const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_mrdivide'."
      "  Prototype:\n"
      "    MRDIVIDE(MX,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_mldivide__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_mldivide",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_mldivide__SWIG_0((casadi::MX const &)*arg1,(casadi::MX const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_mldivide'."
      "  Prototype:\n"
      "    MLDIVIDE(MX,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_symvar__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX m1 ;
  mxArray * _out;
  std::vector< casadi::MX,std::allocator< casadi::MX > > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_symvar",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_symvar__SWIG_0((casadi::MX const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "MX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_symvar'."
      "  Prototype:\n"
      "    SYMVAR(MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_bilin__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::MX *arg3 = 0 ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  casadi::MX m3 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_bilin",argc,3,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_bilin__SWIG_0((casadi::MX const &)*arg1,(casadi::MX const &)*arg2,(casadi::MX const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_bilin'."
      "  Prototype:\n"
      "    BILIN(MX,MX,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_bilin__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_bilin",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_bilin__SWIG_1((casadi::MX const &)*arg1,(casadi::MX const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_bilin'."
      "  Prototype:\n"
      "    BILIN(MX,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_rank1__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::MX *arg3 = 0 ;
  casadi::MX *arg4 = 0 ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  casadi::MX m3 ;
  casadi::MX m4 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_rank1",argc,4,4,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "MX" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_rank1__SWIG_0((casadi::MX const &)*arg1,(casadi::MX const &)*arg2,(casadi::MX const &)*arg3,(casadi::MX const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_rank1'."
      "  Prototype:\n"
      "    RANK1(MX,MX,MX,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_sumsqr__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_sumsqr",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_sumsqr__SWIG_0((casadi::MX const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_sumsqr'."
      "  Prototype:\n"
      "    SUMSQR(MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_linspace__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  casadi_int arg3 ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_linspace",argc,3,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_linspace__SWIG_0((casadi::MX const &)*arg1,(casadi::MX const &)*arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_linspace'."
      "  Prototype:\n"
      "    LINSPACE(MX,MX,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_logsumexp__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_logsumexp",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_logsumexp__SWIG_0((casadi::MX const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_logsumexp'."
      "  Prototype:\n"
      "    LOGSUMEXP(MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_logsumexp__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_logsumexp",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_logsumexp__SWIG_1((casadi::MX const &)*arg1,(casadi::MX const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_logsumexp'."
      "  Prototype:\n"
      "    LOGSUMEXP(MX,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_interp1d__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< double,std::allocator< double > > *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  std::vector< double,std::allocator< double > > *arg3 = 0 ;
  std::string const &arg4_defvalue = "linear" ;
  std::string *arg4 = (std::string *) &arg4_defvalue ;
  bool arg5 = (bool) false ;
  std::vector< double > m1 ;
  casadi::MX m2 ;
  std::vector< double > m3 ;
  std::string m4 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_interp1d",argc,5,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "[" "double" "]" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "[" "double" "]" "'.");
  if (3<argc) {
    arg4 = &m4;
    if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "char" "'.");
  }
  if (4<argc) {
    if (!casadi::to_val(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "bool" "'.");
  }
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_interp1d__SWIG_0((std::vector< double,std::allocator< double > > const &)*arg1,(casadi::MX const &)*arg2,(std::vector< double,std::allocator< double > > const &)*arg3,(std::string const &)*arg4,arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_interp1d'."
      "  Prototype:\n"
      "    INTERP1D([double],MX,[double],char,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_soc__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_soc",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_soc__SWIG_0((casadi::MX const &)*arg1,(casadi::MX const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_soc'."
      "  Prototype:\n"
      "    SOC(MX,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_cross__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  casadi_int arg3 = (casadi_int) -1 ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_cross",argc,3,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  }
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_cross__SWIG_0((casadi::MX const &)*arg1,(casadi::MX const &)*arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_cross'."
      "  Prototype:\n"
      "    CROSS(MX,MX,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_skew__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_skew",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_skew__SWIG_0((casadi::MX const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_skew'."
      "  Prototype:\n"
      "    SKEW(MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_inv_skew__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_inv_skew",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_inv_skew__SWIG_0((casadi::MX const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_inv_skew'."
      "  Prototype:\n"
      "    INV_SKEW(MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_det__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_det",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_det__SWIG_0((casadi::MX const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_det'."
      "  Prototype:\n"
      "    DET(MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_inv_minor__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_inv_minor",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_inv_minor__SWIG_0((casadi::MX const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_inv_minor'."
      "  Prototype:\n"
      "    INV_MINOR(MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_inv__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_inv",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_inv__SWIG_0((casadi::MX const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_inv'."
      "  Prototype:\n"
      "    INV(MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_inv__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  std::string *arg2 = 0 ;
  casadi::Dict const &arg3_defvalue = casadi::Dict() ;
  casadi::Dict *arg3 = (casadi::Dict *) &arg3_defvalue ;
  casadi::MX m1 ;
  std::string m2 ;
  std::map< std::string,casadi::GenericType > m3 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_inv",argc,3,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  if (2<argc) {
    arg3 = &m3;
    if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_inv__SWIG_1((casadi::MX const &)*arg1,(std::string const &)*arg2,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_inv'."
      "  Prototype:\n"
      "    INV(MX,char,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_trace__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_trace",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_trace__SWIG_0((casadi::MX const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_trace'."
      "  Prototype:\n"
      "    TRACE(MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_tril2symm__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_tril2symm",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_tril2symm__SWIG_0((casadi::MX const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_tril2symm'."
      "  Prototype:\n"
      "    TRIL2SYMM(MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_triu2symm__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_triu2symm",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_triu2symm__SWIG_0((casadi::MX const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_triu2symm'."
      "  Prototype:\n"
      "    TRIU2SYMM(MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_norm_fro__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_norm_fro",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_norm_fro__SWIG_0((casadi::MX const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_norm_fro'."
      "  Prototype:\n"
      "    NORM_FRO(MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_norm_2__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_norm_2",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_norm_2__SWIG_0((casadi::MX const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_norm_2'."
      "  Prototype:\n"
      "    NORM_2(MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_norm_1__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_norm_1",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_norm_1__SWIG_0((casadi::MX const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_norm_1'."
      "  Prototype:\n"
      "    NORM_1(MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_norm_inf__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_norm_inf",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_norm_inf__SWIG_0((casadi::MX const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_norm_inf'."
      "  Prototype:\n"
      "    NORM_INF(MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_dot__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_dot",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_dot__SWIG_0((casadi::MX const &)*arg1,(casadi::MX const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_dot'."
      "  Prototype:\n"
      "    DOT(MX,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_nullspace__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_nullspace",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_nullspace__SWIG_0((casadi::MX const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_nullspace'."
      "  Prototype:\n"
      "    NULLSPACE(MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_polyval__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_polyval",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_polyval__SWIG_0((casadi::MX const &)*arg1,(casadi::MX const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_polyval'."
      "  Prototype:\n"
      "    POLYVAL(MX,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_diag__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_diag",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_diag__SWIG_0((casadi::MX const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_diag'."
      "  Prototype:\n"
      "    DIAG(MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_unite__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_unite",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_unite__SWIG_0((casadi::MX const &)*arg1,(casadi::MX const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_unite'."
      "  Prototype:\n"
      "    UNITE(MX,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_densify__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_densify",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_densify__SWIG_0((casadi::MX const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_densify'."
      "  Prototype:\n"
      "    DENSIFY(MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_project__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::Sparsity *arg2 = 0 ;
  bool arg3 = (bool) false ;
  casadi::MX m1 ;
  casadi::Sparsity m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_project",argc,3,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "Sparsity" "'.");
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  }
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_project__SWIG_0((casadi::MX const &)*arg1,(casadi::Sparsity const &)*arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_project'."
      "  Prototype:\n"
      "    PROJECT(MX,Sparsity,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_if_else__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::MX *arg3 = 0 ;
  bool arg4 = (bool) false ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  casadi::MX m3 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_if_else",argc,4,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "MX" "'.");
  if (3<argc) {
    if (!casadi::to_val(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "bool" "'.");
  }
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_if_else__SWIG_0((casadi::MX const &)*arg1,(casadi::MX const &)*arg2,(casadi::MX const &)*arg3,arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_if_else'."
      "  Prototype:\n"
      "    IF_ELSE(MX,MX,MX,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_conditional__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  std::vector< casadi::MX,std::allocator< casadi::MX > > *arg2 = 0 ;
  casadi::MX *arg3 = 0 ;
  bool arg4 = (bool) false ;
  casadi::MX m1 ;
  std::vector< casadi::MX > m2 ;
  casadi::MX m3 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_conditional",argc,4,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "MX" "}" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "MX" "'.");
  if (3<argc) {
    if (!casadi::to_val(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "bool" "'.");
  }
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_conditional__SWIG_0((casadi::MX const &)*arg1,(std::vector< casadi::MX,std::allocator< casadi::MX > > const &)*arg2,(casadi::MX const &)*arg3,arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_conditional'."
      "  Prototype:\n"
      "    CONDITIONAL(MX,{MX},MX,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_depends_on__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_depends_on",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  {
    try {
      result = (bool)casadi_GenericMatrixCommon_casadi_depends_on__SWIG_0((casadi::MX const &)*arg1,(casadi::MX const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_depends_on'."
      "  Prototype:\n"
      "    DEPENDS_ON(MX,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_solve__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_solve",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_solve__SWIG_0((casadi::MX const &)*arg1,(casadi::MX const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_solve'."
      "  Prototype:\n"
      "    SOLVE(MX,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_solve__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  std::string *arg3 = 0 ;
  casadi::Dict const &arg4_defvalue = casadi::Dict() ;
  casadi::Dict *arg4 = (casadi::Dict *) &arg4_defvalue ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  std::string m3 ;
  std::map< std::string,casadi::GenericType > m4 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_solve",argc,4,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "char" "'.");
  if (3<argc) {
    arg4 = &m4;
    if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_solve__SWIG_1((casadi::MX const &)*arg1,(casadi::MX const &)*arg2,(std::string const &)*arg3,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_solve'."
      "  Prototype:\n"
      "    SOLVE(MX,MX,char,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_pinv__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_pinv",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_pinv__SWIG_0((casadi::MX const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_pinv'."
      "  Prototype:\n"
      "    PINV(MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_pinv__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  std::string *arg2 = 0 ;
  casadi::Dict const &arg3_defvalue = casadi::Dict() ;
  casadi::Dict *arg3 = (casadi::Dict *) &arg3_defvalue ;
  casadi::MX m1 ;
  std::string m2 ;
  std::map< std::string,casadi::GenericType > m3 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_pinv",argc,3,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  if (2<argc) {
    arg3 = &m3;
    if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_pinv__SWIG_1((casadi::MX const &)*arg1,(std::string const &)*arg2,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_pinv'."
      "  Prototype:\n"
      "    PINV(MX,char,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_expm_const__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_expm_const",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_expm_const__SWIG_0((casadi::MX const &)*arg1,(casadi::MX const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_expm_const'."
      "  Prototype:\n"
      "    EXPM_CONST(MX,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_expm__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_expm",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_expm__SWIG_0((casadi::MX const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_expm'."
      "  Prototype:\n"
      "    EXPM(MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_jacobian__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::Dict const &arg3_defvalue = casadi::Dict() ;
  casadi::Dict *arg3 = (casadi::Dict *) &arg3_defvalue ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  std::map< std::string,casadi::GenericType > m3 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_jacobian",argc,3,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  if (2<argc) {
    arg3 = &m3;
    if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_jacobian__SWIG_0((casadi::MX const &)*arg1,(casadi::MX const &)*arg2,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_jacobian'."
      "  Prototype:\n"
      "    JACOBIAN(MX,MX,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_jtimes__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::MX *arg3 = 0 ;
  bool arg4 = (bool) false ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  casadi::MX m3 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_jtimes",argc,4,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "MX" "'.");
  if (3<argc) {
    if (!casadi::to_val(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "bool" "'.");
  }
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_jtimes__SWIG_0((casadi::MX const &)*arg1,(casadi::MX const &)*arg2,(casadi::MX const &)*arg3,arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_jtimes'."
      "  Prototype:\n"
      "    JTIMES(MX,MX,MX,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_linearize__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::MX *arg3 = 0 ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  casadi::MX m3 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_linearize",argc,3,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_linearize__SWIG_0((casadi::MX const &)*arg1,(casadi::MX const &)*arg2,(casadi::MX const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_linearize'."
      "  Prototype:\n"
      "    LINEARIZE(MX,MX,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_which_depends__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  casadi_int arg3 = (casadi_int) 1 ;
  bool arg4 = (bool) false ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  mxArray * _out;
  std::vector< bool,std::allocator< bool > > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_which_depends",argc,4,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  }
  if (3<argc) {
    if (!casadi::to_val(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "bool" "'.");
  }
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_which_depends__SWIG_0((casadi::MX const &)*arg1,(casadi::MX const &)*arg2,arg3,arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[" "bool" "]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_which_depends'."
      "  Prototype:\n"
      "    WHICH_DEPENDS(MX,MX,int,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_jacobian_sparsity__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_jacobian_sparsity",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_jacobian_sparsity__SWIG_0((casadi::MX const &)*arg1,(casadi::MX const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_jacobian_sparsity'."
      "  Prototype:\n"
      "    JACOBIAN_SPARSITY(MX,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_is_linear__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_is_linear",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  {
    try {
      result = (bool)casadi_GenericMatrixCommon_casadi_is_linear__SWIG_0((casadi::MX const &)*arg1,(casadi::MX const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_is_linear'."
      "  Prototype:\n"
      "    IS_LINEAR(MX,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_is_quadratic__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_is_quadratic",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  {
    try {
      result = (bool)casadi_GenericMatrixCommon_casadi_is_quadratic__SWIG_0((casadi::MX const &)*arg1,(casadi::MX const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_is_quadratic'."
      "  Prototype:\n"
      "    IS_QUADRATIC(MX,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_gradient__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_gradient",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_gradient__SWIG_0((casadi::MX const &)*arg1,(casadi::MX const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_gradient'."
      "  Prototype:\n"
      "    GRADIENT(MX,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_tangent__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_tangent",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_tangent__SWIG_0((casadi::MX const &)*arg1,(casadi::MX const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_tangent'."
      "  Prototype:\n"
      "    TANGENT(MX,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_hessian__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::MX *arg3 = 0 ;
  casadi::Dict const &arg4_defvalue = casadi::Dict() ;
  casadi::Dict *arg4 = (casadi::Dict *) &arg4_defvalue ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  casadi::MX m3 ;
  std::map< std::string,casadi::GenericType > m4 ;
  mxArray * _out;
  casadi::MX result;
  
  arg3 = &m3;
  if (!SWIG_check_num_args("GenericMatrixCommon_hessian",argc,3,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  if (2<argc) {
    arg4 = &m4;
    if (!casadi::to_ptr(argv[2], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_hessian__SWIG_0((casadi::MX const &)*arg1,(casadi::MX const &)*arg2,*arg3,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg3);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_hessian'."
      "  Prototype:\n"
      "    HESSIAN(MX,MX,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_quadratic_coeff__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::MX *arg3 = 0 ;
  casadi::MX *arg4 = 0 ;
  casadi::MX *arg5 = 0 ;
  bool arg6 = (bool) true ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  casadi::MX m3 ;
  casadi::MX m4 ;
  casadi::MX m5 ;
  mxArray * _out;
  
  arg3 = &m3;
  arg4 = &m4;
  arg5 = &m5;
  if (!SWIG_check_num_args("GenericMatrixCommon_quadratic_coeff",argc,3,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg6)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 6 to type '" "bool" "'.");
  }
  {
    try {
      casadi_GenericMatrixCommon_casadi_quadratic_coeff__SWIG_0((casadi::MX const &)*arg1,(casadi::MX const &)*arg2,*arg3,*arg4,*arg5,arg6);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg3);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg4);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg5);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_quadratic_coeff'."
      "  Prototype:\n"
      "    QUADRATIC_COEFF(MX,MX,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_linear_coeff__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::MX *arg3 = 0 ;
  casadi::MX *arg4 = 0 ;
  bool arg5 = (bool) true ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  casadi::MX m3 ;
  casadi::MX m4 ;
  mxArray * _out;
  
  arg3 = &m3;
  arg4 = &m4;
  if (!SWIG_check_num_args("GenericMatrixCommon_linear_coeff",argc,3,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "bool" "'.");
  }
  {
    try {
      casadi_GenericMatrixCommon_casadi_linear_coeff__SWIG_0((casadi::MX const &)*arg1,(casadi::MX const &)*arg2,*arg3,*arg4,arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg3);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg4);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_linear_coeff'."
      "  Prototype:\n"
      "    LINEAR_COEFF(MX,MX,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_n_nodes__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_n_nodes",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  {
    try {
      result = (casadi_int)casadi_GenericMatrixCommon_casadi_n_nodes__SWIG_0((casadi::MX const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_n_nodes'."
      "  Prototype:\n"
      "    N_NODES(MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_print_operator__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg2 = 0 ;
  casadi::MX m1 ;
  std::vector< std::string > m2 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_print_operator",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "char" "}" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_print_operator__SWIG_0((casadi::MX const &)*arg1,(std::vector< std::string,std::allocator< std::string > > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_print_operator'."
      "  Prototype:\n"
      "    PRINT_OPERATOR(MX,{char})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_repsum__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi_int arg2 ;
  casadi_int arg3 = (casadi_int) 1 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_repsum",argc,3,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  }
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_repsum__SWIG_0((casadi::MX const &)*arg1,arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_repsum'."
      "  Prototype:\n"
      "    REPSUM(MX,int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_diff__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi_int arg2 = (casadi_int) 1 ;
  casadi_index arg3 = (casadi_index) -1 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_diff",argc,3,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  }
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type ' index '.");
    if (arg3==0) SWIG_exception_fail(SWIG_TypeError,"Index starts at 1, got index '0'.");
    if (arg3>=1) arg3--;
  }
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_diff__SWIG_0((casadi::MX const &)*arg1,arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_diff'."
      "  Prototype:\n"
      "    DIFF(MX,int,index)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_cumsum__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi_index arg2 = (casadi_index) -1 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_cumsum",argc,2,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type ' index '.");
    if (arg2==0) SWIG_exception_fail(SWIG_TypeError,"Index starts at 1, got index '0'.");
    if (arg2>=1) arg2--;
  }
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_cumsum__SWIG_0((casadi::MX const &)*arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_cumsum'."
      "  Prototype:\n"
      "    CUMSUM(MX,index)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_einstein__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::MX *arg3 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg4 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg5 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg6 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg7 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg8 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg9 = 0 ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  casadi::MX m3 ;
  std::vector< casadi_int > m4 ;
  std::vector< casadi_int > m5 ;
  std::vector< casadi_int > m6 ;
  std::vector< casadi_int > m7 ;
  std::vector< casadi_int > m8 ;
  std::vector< casadi_int > m9 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_einstein",argc,9,9,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "MX" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "[" "int" "]" "'.");
  arg5 = &m5;
  if (!casadi::to_ptr(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "[" "int" "]" "'.");
  arg6 = &m6;
  if (!casadi::to_ptr(argv[5], &arg6)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 6 to type '" "[" "int" "]" "'.");
  arg7 = &m7;
  if (!casadi::to_ptr(argv[6], &arg7)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 7 to type '" "[" "int" "]" "'.");
  arg8 = &m8;
  if (!casadi::to_ptr(argv[7], &arg8)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 8 to type '" "[" "int" "]" "'.");
  arg9 = &m9;
  if (!casadi::to_ptr(argv[8], &arg9)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 9 to type '" "[" "int" "]" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_einstein__SWIG_0((casadi::MX const &)*arg1,(casadi::MX const &)*arg2,(casadi::MX const &)*arg3,(std::vector< long long,std::allocator< long long > > const &)*arg4,(std::vector< long long,std::allocator< long long > > const &)*arg5,(std::vector< long long,std::allocator< long long > > const &)*arg6,(std::vector< long long,std::allocator< long long > > const &)*arg7,(std::vector< long long,std::allocator< long long > > const &)*arg8,(std::vector< long long,std::allocator< long long > > const &)*arg9);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_einstein'."
      "  Prototype:\n"
      "    EINSTEIN(MX,MX,MX,[int],[int],[int],[int],[int],[int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_einstein__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg3 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg4 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg5 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg6 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg7 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg8 = 0 ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  std::vector< casadi_int > m3 ;
  std::vector< casadi_int > m4 ;
  std::vector< casadi_int > m5 ;
  std::vector< casadi_int > m6 ;
  std::vector< casadi_int > m7 ;
  std::vector< casadi_int > m8 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_einstein",argc,8,8,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "[" "int" "]" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "[" "int" "]" "'.");
  arg5 = &m5;
  if (!casadi::to_ptr(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "[" "int" "]" "'.");
  arg6 = &m6;
  if (!casadi::to_ptr(argv[5], &arg6)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 6 to type '" "[" "int" "]" "'.");
  arg7 = &m7;
  if (!casadi::to_ptr(argv[6], &arg7)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 7 to type '" "[" "int" "]" "'.");
  arg8 = &m8;
  if (!casadi::to_ptr(argv[7], &arg8)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 8 to type '" "[" "int" "]" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_einstein__SWIG_1((casadi::MX const &)*arg1,(casadi::MX const &)*arg2,(std::vector< long long,std::allocator< long long > > const &)*arg3,(std::vector< long long,std::allocator< long long > > const &)*arg4,(std::vector< long long,std::allocator< long long > > const &)*arg5,(std::vector< long long,std::allocator< long long > > const &)*arg6,(std::vector< long long,std::allocator< long long > > const &)*arg7,(std::vector< long long,std::allocator< long long > > const &)*arg8);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_einstein'."
      "  Prototype:\n"
      "    EINSTEIN(MX,MX,[int],[int],[int],[int],[int],[int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_mmin__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_mmin",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_mmin__SWIG_0((casadi::MX const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_mmin'."
      "  Prototype:\n"
      "    MMIN(MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_mmax__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_mmax",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_mmax__SWIG_0((casadi::MX const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_mmax'."
      "  Prototype:\n"
      "    MMAX(MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_evalf__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::DM result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_evalf",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_evalf__SWIG_0((casadi::MX const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_evalf'."
      "  Prototype:\n"
      "    EVALF(MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_cse__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< casadi::MX,std::allocator< casadi::MX > > *arg1 = 0 ;
  std::vector< casadi::MX > m1 ;
  mxArray * _out;
  std::vector< casadi::MX,std::allocator< casadi::MX > > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_cse",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "{" "MX" "}" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_cse__SWIG_0((std::vector< casadi::MX,std::allocator< casadi::MX > > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "MX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_cse'."
      "  Prototype:\n"
      "    CSE({MX})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_cse__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_cse",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_cse__SWIG_1((casadi::MX const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_cse'."
      "  Prototype:\n"
      "    CSE(MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_mpower__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_mpower",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_mpower__SWIG_1((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_mpower'."
      "  Prototype:\n"
      "    MPOWER(DM,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_mrdivide__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_mrdivide",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_mrdivide__SWIG_1((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_mrdivide'."
      "  Prototype:\n"
      "    MRDIVIDE(DM,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_mldivide__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_mldivide",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_mldivide__SWIG_1((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_mldivide'."
      "  Prototype:\n"
      "    MLDIVIDE(DM,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_symvar__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_symvar",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_symvar__SWIG_1((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "DM" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_symvar'."
      "  Prototype:\n"
      "    SYMVAR(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_bilin__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > *arg3 = 0 ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  casadi::Matrix< double > m3 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_bilin",argc,3,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_bilin__SWIG_2((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2,(casadi::Matrix< double > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_bilin'."
      "  Prototype:\n"
      "    BILIN(DM,DM,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_bilin__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_bilin",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_bilin__SWIG_3((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_bilin'."
      "  Prototype:\n"
      "    BILIN(DM,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_rank1__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > *arg3 = 0 ;
  casadi::Matrix< double > *arg4 = 0 ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  casadi::Matrix< double > m3 ;
  casadi::Matrix< double > m4 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_rank1",argc,4,4,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "DM" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_rank1__SWIG_1((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2,(casadi::Matrix< double > const &)*arg3,(casadi::Matrix< double > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_rank1'."
      "  Prototype:\n"
      "    RANK1(DM,DM,DM,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_sumsqr__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_sumsqr",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_sumsqr__SWIG_1((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_sumsqr'."
      "  Prototype:\n"
      "    SUMSQR(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_linspace__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi_int arg3 ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_linspace",argc,3,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_linspace__SWIG_1((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_linspace'."
      "  Prototype:\n"
      "    LINSPACE(DM,DM,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_logsumexp__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_logsumexp",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_logsumexp__SWIG_2((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_logsumexp'."
      "  Prototype:\n"
      "    LOGSUMEXP(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_logsumexp__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_logsumexp",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_logsumexp__SWIG_3((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_logsumexp'."
      "  Prototype:\n"
      "    LOGSUMEXP(DM,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_interp1d__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< double,std::allocator< double > > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  std::vector< double,std::allocator< double > > *arg3 = 0 ;
  std::string const &arg4_defvalue = "linear" ;
  std::string *arg4 = (std::string *) &arg4_defvalue ;
  bool arg5 = (bool) false ;
  std::vector< double > m1 ;
  casadi::Matrix< double > m2 ;
  std::vector< double > m3 ;
  std::string m4 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_interp1d",argc,5,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "[" "double" "]" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "[" "double" "]" "'.");
  if (3<argc) {
    arg4 = &m4;
    if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "char" "'.");
  }
  if (4<argc) {
    if (!casadi::to_val(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "bool" "'.");
  }
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_interp1d__SWIG_1((std::vector< double,std::allocator< double > > const &)*arg1,(casadi::Matrix< double > const &)*arg2,(std::vector< double,std::allocator< double > > const &)*arg3,(std::string const &)*arg4,arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_interp1d'."
      "  Prototype:\n"
      "    INTERP1D([double],DM,[double],char,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_soc__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_soc",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_soc__SWIG_1((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_soc'."
      "  Prototype:\n"
      "    SOC(DM,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_cross__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi_int arg3 = (casadi_int) -1 ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_cross",argc,3,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  }
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_cross__SWIG_1((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_cross'."
      "  Prototype:\n"
      "    CROSS(DM,DM,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_skew__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_skew",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_skew__SWIG_1((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_skew'."
      "  Prototype:\n"
      "    SKEW(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_inv_skew__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_inv_skew",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_inv_skew__SWIG_1((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_inv_skew'."
      "  Prototype:\n"
      "    INV_SKEW(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_det__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_det",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_det__SWIG_1((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_det'."
      "  Prototype:\n"
      "    DET(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_inv_minor__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_inv_minor",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_inv_minor__SWIG_1((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_inv_minor'."
      "  Prototype:\n"
      "    INV_MINOR(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_inv__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_inv",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_inv__SWIG_2((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_inv'."
      "  Prototype:\n"
      "    INV(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_inv__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  std::string *arg2 = 0 ;
  casadi::Dict const &arg3_defvalue = casadi::Dict() ;
  casadi::Dict *arg3 = (casadi::Dict *) &arg3_defvalue ;
  casadi::Matrix< double > m1 ;
  std::string m2 ;
  std::map< std::string,casadi::GenericType > m3 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_inv",argc,3,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  if (2<argc) {
    arg3 = &m3;
    if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_inv__SWIG_3((casadi::Matrix< double > const &)*arg1,(std::string const &)*arg2,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_inv'."
      "  Prototype:\n"
      "    INV(DM,char,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_trace__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_trace",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_trace__SWIG_1((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_trace'."
      "  Prototype:\n"
      "    TRACE(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_tril2symm__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_tril2symm",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_tril2symm__SWIG_1((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_tril2symm'."
      "  Prototype:\n"
      "    TRIL2SYMM(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_triu2symm__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_triu2symm",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_triu2symm__SWIG_1((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_triu2symm'."
      "  Prototype:\n"
      "    TRIU2SYMM(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_norm_fro__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_norm_fro",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_norm_fro__SWIG_1((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_norm_fro'."
      "  Prototype:\n"
      "    NORM_FRO(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_norm_2__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_norm_2",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_norm_2__SWIG_1((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_norm_2'."
      "  Prototype:\n"
      "    NORM_2(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_norm_1__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_norm_1",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_norm_1__SWIG_1((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_norm_1'."
      "  Prototype:\n"
      "    NORM_1(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_norm_inf__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_norm_inf",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_norm_inf__SWIG_1((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_norm_inf'."
      "  Prototype:\n"
      "    NORM_INF(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_dot__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_dot",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_dot__SWIG_1((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_dot'."
      "  Prototype:\n"
      "    DOT(DM,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_nullspace__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_nullspace",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_nullspace__SWIG_1((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_nullspace'."
      "  Prototype:\n"
      "    NULLSPACE(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_polyval__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_polyval",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_polyval__SWIG_1((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_polyval'."
      "  Prototype:\n"
      "    POLYVAL(DM,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_diag__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_diag",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_diag__SWIG_1((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_diag'."
      "  Prototype:\n"
      "    DIAG(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_unite__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_unite",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_unite__SWIG_1((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_unite'."
      "  Prototype:\n"
      "    UNITE(DM,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_densify__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_densify",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_densify__SWIG_1((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_densify'."
      "  Prototype:\n"
      "    DENSIFY(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_project__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Sparsity *arg2 = 0 ;
  bool arg3 = (bool) false ;
  casadi::Matrix< double > m1 ;
  casadi::Sparsity m2 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_project",argc,3,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "Sparsity" "'.");
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  }
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_project__SWIG_1((casadi::Matrix< double > const &)*arg1,(casadi::Sparsity const &)*arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_project'."
      "  Prototype:\n"
      "    PROJECT(DM,Sparsity,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_if_else__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > *arg3 = 0 ;
  bool arg4 = (bool) false ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  casadi::Matrix< double > m3 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_if_else",argc,4,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "DM" "'.");
  if (3<argc) {
    if (!casadi::to_val(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "bool" "'.");
  }
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_if_else__SWIG_1((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2,(casadi::Matrix< double > const &)*arg3,arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_if_else'."
      "  Prototype:\n"
      "    IF_ELSE(DM,DM,DM,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_conditional__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > *arg2 = 0 ;
  casadi::Matrix< double > *arg3 = 0 ;
  bool arg4 = (bool) false ;
  casadi::Matrix< double > m1 ;
  std::vector< casadi::Matrix< double > > m2 ;
  casadi::Matrix< double > m3 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_conditional",argc,4,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "DM" "}" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "DM" "'.");
  if (3<argc) {
    if (!casadi::to_val(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "bool" "'.");
  }
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_conditional__SWIG_1((casadi::Matrix< double > const &)*arg1,(std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > const &)*arg2,(casadi::Matrix< double > const &)*arg3,arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_conditional'."
      "  Prototype:\n"
      "    CONDITIONAL(DM,{DM},DM,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_depends_on__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_depends_on",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  {
    try {
      result = (bool)casadi_GenericMatrixCommon_casadi_depends_on__SWIG_1((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_depends_on'."
      "  Prototype:\n"
      "    DEPENDS_ON(DM,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_solve__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_solve",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_solve__SWIG_2((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_solve'."
      "  Prototype:\n"
      "    SOLVE(DM,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_solve__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  std::string *arg3 = 0 ;
  casadi::Dict const &arg4_defvalue = casadi::Dict() ;
  casadi::Dict *arg4 = (casadi::Dict *) &arg4_defvalue ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  std::string m3 ;
  std::map< std::string,casadi::GenericType > m4 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_solve",argc,4,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "char" "'.");
  if (3<argc) {
    arg4 = &m4;
    if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_solve__SWIG_3((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2,(std::string const &)*arg3,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_solve'."
      "  Prototype:\n"
      "    SOLVE(DM,DM,char,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_pinv__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_pinv",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_pinv__SWIG_2((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_pinv'."
      "  Prototype:\n"
      "    PINV(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_pinv__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  std::string *arg2 = 0 ;
  casadi::Dict const &arg3_defvalue = casadi::Dict() ;
  casadi::Dict *arg3 = (casadi::Dict *) &arg3_defvalue ;
  casadi::Matrix< double > m1 ;
  std::string m2 ;
  std::map< std::string,casadi::GenericType > m3 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_pinv",argc,3,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  if (2<argc) {
    arg3 = &m3;
    if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_pinv__SWIG_3((casadi::Matrix< double > const &)*arg1,(std::string const &)*arg2,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_pinv'."
      "  Prototype:\n"
      "    PINV(DM,char,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_expm_const__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_expm_const",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_expm_const__SWIG_1((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_expm_const'."
      "  Prototype:\n"
      "    EXPM_CONST(DM,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_expm__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_expm",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_expm__SWIG_1((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_expm'."
      "  Prototype:\n"
      "    EXPM(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_jacobian__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Dict const &arg3_defvalue = casadi::Dict() ;
  casadi::Dict *arg3 = (casadi::Dict *) &arg3_defvalue ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  std::map< std::string,casadi::GenericType > m3 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_jacobian",argc,3,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  if (2<argc) {
    arg3 = &m3;
    if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_jacobian__SWIG_1((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_jacobian'."
      "  Prototype:\n"
      "    JACOBIAN(DM,DM,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_jtimes__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > *arg3 = 0 ;
  bool arg4 = (bool) false ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  casadi::Matrix< double > m3 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_jtimes",argc,4,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "DM" "'.");
  if (3<argc) {
    if (!casadi::to_val(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "bool" "'.");
  }
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_jtimes__SWIG_1((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2,(casadi::Matrix< double > const &)*arg3,arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_jtimes'."
      "  Prototype:\n"
      "    JTIMES(DM,DM,DM,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_linearize__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > *arg3 = 0 ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  casadi::Matrix< double > m3 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_linearize",argc,3,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_linearize__SWIG_1((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2,(casadi::Matrix< double > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_linearize'."
      "  Prototype:\n"
      "    LINEARIZE(DM,DM,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_which_depends__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi_int arg3 = (casadi_int) 1 ;
  bool arg4 = (bool) false ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  mxArray * _out;
  std::vector< bool,std::allocator< bool > > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_which_depends",argc,4,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  }
  if (3<argc) {
    if (!casadi::to_val(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "bool" "'.");
  }
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_which_depends__SWIG_1((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2,arg3,arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[" "bool" "]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_which_depends'."
      "  Prototype:\n"
      "    WHICH_DEPENDS(DM,DM,int,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_jacobian_sparsity__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_jacobian_sparsity",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_jacobian_sparsity__SWIG_1((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_jacobian_sparsity'."
      "  Prototype:\n"
      "    JACOBIAN_SPARSITY(DM,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_is_linear__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_is_linear",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  {
    try {
      result = (bool)casadi_GenericMatrixCommon_casadi_is_linear__SWIG_1((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_is_linear'."
      "  Prototype:\n"
      "    IS_LINEAR(DM,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_is_quadratic__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_is_quadratic",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  {
    try {
      result = (bool)casadi_GenericMatrixCommon_casadi_is_quadratic__SWIG_1((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_is_quadratic'."
      "  Prototype:\n"
      "    IS_QUADRATIC(DM,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_gradient__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_gradient",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_gradient__SWIG_1((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_gradient'."
      "  Prototype:\n"
      "    GRADIENT(DM,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_tangent__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_tangent",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_tangent__SWIG_1((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_tangent'."
      "  Prototype:\n"
      "    TANGENT(DM,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_hessian__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > *arg3 = 0 ;
  casadi::Dict const &arg4_defvalue = casadi::Dict() ;
  casadi::Dict *arg4 = (casadi::Dict *) &arg4_defvalue ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  casadi::Matrix< double > m3 ;
  std::map< std::string,casadi::GenericType > m4 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  arg3 = &m3;
  if (!SWIG_check_num_args("GenericMatrixCommon_hessian",argc,3,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  if (2<argc) {
    arg4 = &m4;
    if (!casadi::to_ptr(argv[2], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_hessian__SWIG_1((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2,*arg3,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg3);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_hessian'."
      "  Prototype:\n"
      "    HESSIAN(DM,DM,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_quadratic_coeff__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > *arg3 = 0 ;
  casadi::Matrix< double > *arg4 = 0 ;
  casadi::Matrix< double > *arg5 = 0 ;
  bool arg6 = (bool) true ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  casadi::Matrix< double > m3 ;
  casadi::Matrix< double > m4 ;
  casadi::Matrix< double > m5 ;
  mxArray * _out;
  
  arg3 = &m3;
  arg4 = &m4;
  arg5 = &m5;
  if (!SWIG_check_num_args("GenericMatrixCommon_quadratic_coeff",argc,3,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg6)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 6 to type '" "bool" "'.");
  }
  {
    try {
      casadi_GenericMatrixCommon_casadi_quadratic_coeff__SWIG_1((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2,*arg3,*arg4,*arg5,arg6);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg3);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg4);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg5);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_quadratic_coeff'."
      "  Prototype:\n"
      "    QUADRATIC_COEFF(DM,DM,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_linear_coeff__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > *arg3 = 0 ;
  casadi::Matrix< double > *arg4 = 0 ;
  bool arg5 = (bool) true ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  casadi::Matrix< double > m3 ;
  casadi::Matrix< double > m4 ;
  mxArray * _out;
  
  arg3 = &m3;
  arg4 = &m4;
  if (!SWIG_check_num_args("GenericMatrixCommon_linear_coeff",argc,3,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "bool" "'.");
  }
  {
    try {
      casadi_GenericMatrixCommon_casadi_linear_coeff__SWIG_1((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2,*arg3,*arg4,arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg3);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg4);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_linear_coeff'."
      "  Prototype:\n"
      "    LINEAR_COEFF(DM,DM,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_n_nodes__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_n_nodes",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = (casadi_int)casadi_GenericMatrixCommon_casadi_n_nodes__SWIG_1((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_n_nodes'."
      "  Prototype:\n"
      "    N_NODES(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_print_operator__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg2 = 0 ;
  casadi::Matrix< double > m1 ;
  std::vector< std::string > m2 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_print_operator",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "char" "}" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_print_operator__SWIG_1((casadi::Matrix< double > const &)*arg1,(std::vector< std::string,std::allocator< std::string > > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_print_operator'."
      "  Prototype:\n"
      "    PRINT_OPERATOR(DM,{char})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_repsum__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi_int arg2 ;
  casadi_int arg3 = (casadi_int) 1 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_repsum",argc,3,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  }
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_repsum__SWIG_1((casadi::Matrix< double > const &)*arg1,arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_repsum'."
      "  Prototype:\n"
      "    REPSUM(DM,int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_diff__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi_int arg2 = (casadi_int) 1 ;
  casadi_index arg3 = (casadi_index) -1 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_diff",argc,3,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  }
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type ' index '.");
    if (arg3==0) SWIG_exception_fail(SWIG_TypeError,"Index starts at 1, got index '0'.");
    if (arg3>=1) arg3--;
  }
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_diff__SWIG_1((casadi::Matrix< double > const &)*arg1,arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_diff'."
      "  Prototype:\n"
      "    DIFF(DM,int,index)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_cumsum__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi_index arg2 = (casadi_index) -1 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_cumsum",argc,2,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type ' index '.");
    if (arg2==0) SWIG_exception_fail(SWIG_TypeError,"Index starts at 1, got index '0'.");
    if (arg2>=1) arg2--;
  }
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_cumsum__SWIG_1((casadi::Matrix< double > const &)*arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_cumsum'."
      "  Prototype:\n"
      "    CUMSUM(DM,index)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_einstein__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > *arg3 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg4 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg5 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg6 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg7 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg8 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg9 = 0 ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  casadi::Matrix< double > m3 ;
  std::vector< casadi_int > m4 ;
  std::vector< casadi_int > m5 ;
  std::vector< casadi_int > m6 ;
  std::vector< casadi_int > m7 ;
  std::vector< casadi_int > m8 ;
  std::vector< casadi_int > m9 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_einstein",argc,9,9,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "DM" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "[" "int" "]" "'.");
  arg5 = &m5;
  if (!casadi::to_ptr(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "[" "int" "]" "'.");
  arg6 = &m6;
  if (!casadi::to_ptr(argv[5], &arg6)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 6 to type '" "[" "int" "]" "'.");
  arg7 = &m7;
  if (!casadi::to_ptr(argv[6], &arg7)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 7 to type '" "[" "int" "]" "'.");
  arg8 = &m8;
  if (!casadi::to_ptr(argv[7], &arg8)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 8 to type '" "[" "int" "]" "'.");
  arg9 = &m9;
  if (!casadi::to_ptr(argv[8], &arg9)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 9 to type '" "[" "int" "]" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_einstein__SWIG_2((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2,(casadi::Matrix< double > const &)*arg3,(std::vector< long long,std::allocator< long long > > const &)*arg4,(std::vector< long long,std::allocator< long long > > const &)*arg5,(std::vector< long long,std::allocator< long long > > const &)*arg6,(std::vector< long long,std::allocator< long long > > const &)*arg7,(std::vector< long long,std::allocator< long long > > const &)*arg8,(std::vector< long long,std::allocator< long long > > const &)*arg9);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_einstein'."
      "  Prototype:\n"
      "    EINSTEIN(DM,DM,DM,[int],[int],[int],[int],[int],[int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_einstein__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg3 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg4 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg5 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg6 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg7 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg8 = 0 ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  std::vector< casadi_int > m3 ;
  std::vector< casadi_int > m4 ;
  std::vector< casadi_int > m5 ;
  std::vector< casadi_int > m6 ;
  std::vector< casadi_int > m7 ;
  std::vector< casadi_int > m8 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_einstein",argc,8,8,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "[" "int" "]" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "[" "int" "]" "'.");
  arg5 = &m5;
  if (!casadi::to_ptr(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "[" "int" "]" "'.");
  arg6 = &m6;
  if (!casadi::to_ptr(argv[5], &arg6)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 6 to type '" "[" "int" "]" "'.");
  arg7 = &m7;
  if (!casadi::to_ptr(argv[6], &arg7)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 7 to type '" "[" "int" "]" "'.");
  arg8 = &m8;
  if (!casadi::to_ptr(argv[7], &arg8)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 8 to type '" "[" "int" "]" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_einstein__SWIG_3((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2,(std::vector< long long,std::allocator< long long > > const &)*arg3,(std::vector< long long,std::allocator< long long > > const &)*arg4,(std::vector< long long,std::allocator< long long > > const &)*arg5,(std::vector< long long,std::allocator< long long > > const &)*arg6,(std::vector< long long,std::allocator< long long > > const &)*arg7,(std::vector< long long,std::allocator< long long > > const &)*arg8);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_einstein'."
      "  Prototype:\n"
      "    EINSTEIN(DM,DM,[int],[int],[int],[int],[int],[int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_mmin__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_mmin",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_mmin__SWIG_1((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_mmin'."
      "  Prototype:\n"
      "    MMIN(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_mmax__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_mmax",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_mmax__SWIG_1((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_mmax'."
      "  Prototype:\n"
      "    MMAX(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_evalf__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::DM result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_evalf",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_evalf__SWIG_1((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_evalf'."
      "  Prototype:\n"
      "    EVALF(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_cse__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > *arg1 = 0 ;
  std::vector< casadi::Matrix< double > > m1 ;
  mxArray * _out;
  std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_cse",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "{" "DM" "}" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_cse__SWIG_2((std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "DM" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_cse'."
      "  Prototype:\n"
      "    CSE({DM})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_cse__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_cse",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_cse__SWIG_3((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_cse'."
      "  Prototype:\n"
      "    CSE(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_mpower__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_mpower",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_mpower__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_mpower'."
      "  Prototype:\n"
      "    MPOWER(SX,SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_mpower(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        return _wrap_GenericMatrixCommon_mpower__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        return _wrap_GenericMatrixCommon_mpower__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        return _wrap_GenericMatrixCommon_mpower__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_mpower'."
    "  Possible prototypes are:\n"
    "    MPOWER(DM,DM)\n"
    "    MPOWER(SX,SX)\n"
    "    MPOWER(MX,MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericMatrixCommon_mrdivide__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_mrdivide",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_mrdivide__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_mrdivide'."
      "  Prototype:\n"
      "    MRDIVIDE(SX,SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_mrdivide(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        return _wrap_GenericMatrixCommon_mrdivide__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        return _wrap_GenericMatrixCommon_mrdivide__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        return _wrap_GenericMatrixCommon_mrdivide__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_mrdivide'."
    "  Possible prototypes are:\n"
    "    MRDIVIDE(DM,DM)\n"
    "    MRDIVIDE(SX,SX)\n"
    "    MRDIVIDE(MX,MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericMatrixCommon_mldivide__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_mldivide",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_mldivide__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_mldivide'."
      "  Prototype:\n"
      "    MLDIVIDE(SX,SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_mldivide(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        return _wrap_GenericMatrixCommon_mldivide__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        return _wrap_GenericMatrixCommon_mldivide__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        return _wrap_GenericMatrixCommon_mldivide__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_mldivide'."
    "  Possible prototypes are:\n"
    "    MLDIVIDE(DM,DM)\n"
    "    MLDIVIDE(SX,SX)\n"
    "    MLDIVIDE(MX,MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericMatrixCommon_symvar__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_symvar",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_symvar__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "SX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_symvar'."
      "  Prototype:\n"
      "    SYMVAR(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_symvar(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_symvar__SWIG_1(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_symvar__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_symvar__SWIG_0(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_symvar'."
    "  Possible prototypes are:\n"
    "    SYMVAR(DM)\n"
    "    SYMVAR(SX)\n"
    "    SYMVAR(MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericMatrixCommon_bilin__SWIG_4(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg3 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  casadi::Matrix< casadi::SXElem > m3 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_bilin",argc,3,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_bilin__SWIG_4((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2,(casadi::Matrix< casadi::SXElem > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_bilin'."
      "  Prototype:\n"
      "    BILIN(SX,SX,SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_bilin__SWIG_5(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_bilin",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_bilin__SWIG_5((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_bilin'."
      "  Prototype:\n"
      "    BILIN(SX,SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_bilin(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        return _wrap_GenericMatrixCommon_bilin__SWIG_3(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        return _wrap_GenericMatrixCommon_bilin__SWIG_5(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        return _wrap_GenericMatrixCommon_bilin__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 3) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<double> **>(0));
        if (_v) {
          return _wrap_GenericMatrixCommon_bilin__SWIG_2(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
        if (_v) {
          return _wrap_GenericMatrixCommon_bilin__SWIG_4(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::MX **>(0));
        if (_v) {
          return _wrap_GenericMatrixCommon_bilin__SWIG_0(resc,resv,argc,argv);
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_bilin'."
    "  Possible prototypes are:\n"
    "    BILIN(DM,DM)\n"
    "    BILIN(SX,SX)\n"
    "    BILIN(MX,MX)\n"
    "    BILIN(DM,DM,DM)\n"
    "    BILIN(SX,SX,SX)\n"
    "    BILIN(MX,MX,MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericMatrixCommon_rank1__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg3 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg4 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  casadi::Matrix< casadi::SXElem > m3 ;
  casadi::Matrix< casadi::SXElem > m4 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_rank1",argc,4,4,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "SX" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_rank1__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2,(casadi::Matrix< casadi::SXElem > const &)*arg3,(casadi::Matrix< casadi::SXElem > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_rank1'."
      "  Prototype:\n"
      "    RANK1(SX,SX,SX,SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_rank1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 4) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<double> **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::Matrix<double> **>(0));
          if (_v) {
            return _wrap_GenericMatrixCommon_rank1__SWIG_1(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
          if (_v) {
            return _wrap_GenericMatrixCommon_rank1__SWIG_2(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::MX **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::MX **>(0));
          if (_v) {
            return _wrap_GenericMatrixCommon_rank1__SWIG_0(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_rank1'."
    "  Possible prototypes are:\n"
    "    RANK1(DM,DM,DM,DM)\n"
    "    RANK1(SX,SX,SX,SX)\n"
    "    RANK1(MX,MX,MX,MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericMatrixCommon_sumsqr__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_sumsqr",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_sumsqr__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_sumsqr'."
      "  Prototype:\n"
      "    SUMSQR(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_sumsqr(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_sumsqr__SWIG_1(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_sumsqr__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_sumsqr__SWIG_0(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_sumsqr'."
    "  Possible prototypes are:\n"
    "    SUMSQR(DM)\n"
    "    SUMSQR(SX)\n"
    "    SUMSQR(MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericMatrixCommon_linspace__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi_int arg3 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_linspace",argc,3,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_linspace__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_linspace'."
      "  Prototype:\n"
      "    LINSPACE(SX,SX,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_linspace(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 3) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          return _wrap_GenericMatrixCommon_linspace__SWIG_1(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          return _wrap_GenericMatrixCommon_linspace__SWIG_2(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          return _wrap_GenericMatrixCommon_linspace__SWIG_0(resc,resv,argc,argv);
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_linspace'."
    "  Possible prototypes are:\n"
    "    LINSPACE(DM,DM,int)\n"
    "    LINSPACE(SX,SX,int)\n"
    "    LINSPACE(MX,MX,int)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericMatrixCommon_logsumexp__SWIG_4(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_logsumexp",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_logsumexp__SWIG_4((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_logsumexp'."
      "  Prototype:\n"
      "    LOGSUMEXP(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_logsumexp__SWIG_5(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_logsumexp",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_logsumexp__SWIG_5((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_logsumexp'."
      "  Prototype:\n"
      "    LOGSUMEXP(SX,SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_logsumexp(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_logsumexp__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_logsumexp__SWIG_4(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_logsumexp__SWIG_0(resc,resv,argc,argv);
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        return _wrap_GenericMatrixCommon_logsumexp__SWIG_3(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        return _wrap_GenericMatrixCommon_logsumexp__SWIG_5(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        return _wrap_GenericMatrixCommon_logsumexp__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_logsumexp'."
    "  Possible prototypes are:\n"
    "    LOGSUMEXP(DM)\n"
    "    LOGSUMEXP(SX)\n"
    "    LOGSUMEXP(MX)\n"
    "    LOGSUMEXP(DM,DM)\n"
    "    LOGSUMEXP(SX,SX)\n"
    "    LOGSUMEXP(MX,MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericMatrixCommon_interp1d__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< double,std::allocator< double > > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  std::vector< double,std::allocator< double > > *arg3 = 0 ;
  std::string const &arg4_defvalue = "linear" ;
  std::string *arg4 = (std::string *) &arg4_defvalue ;
  bool arg5 = (bool) false ;
  std::vector< double > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  std::vector< double > m3 ;
  std::string m4 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_interp1d",argc,5,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "[" "double" "]" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "[" "double" "]" "'.");
  if (3<argc) {
    arg4 = &m4;
    if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "char" "'.");
  }
  if (4<argc) {
    if (!casadi::to_val(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "bool" "'.");
  }
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_interp1d__SWIG_2((std::vector< double,std::allocator< double > > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2,(std::vector< double,std::allocator< double > > const &)*arg3,(std::string const &)*arg4,arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_interp1d'."
      "  Prototype:\n"
      "    INTERP1D([double],SX,[double],char,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_interp1d(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 3) && (argc <= 5)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::vector<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::vector<double> **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_GenericMatrixCommon_interp1d__SWIG_1(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< std::string **>(0));
          if (_v) {
            if (argc <= 4) {
              return _wrap_GenericMatrixCommon_interp1d__SWIG_1(resc,resv,argc,argv);
            }
            _v = casadi::to_ptr(argv[4], static_cast< bool **>(0));
            if (_v) {
              return _wrap_GenericMatrixCommon_interp1d__SWIG_1(resc,resv,argc,argv);
            }
          }
        }
      }
    }
  }
  if ((argc >= 3) && (argc <= 5)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::vector<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::vector<double> **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_GenericMatrixCommon_interp1d__SWIG_2(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< std::string **>(0));
          if (_v) {
            if (argc <= 4) {
              return _wrap_GenericMatrixCommon_interp1d__SWIG_2(resc,resv,argc,argv);
            }
            _v = casadi::to_ptr(argv[4], static_cast< bool **>(0));
            if (_v) {
              return _wrap_GenericMatrixCommon_interp1d__SWIG_2(resc,resv,argc,argv);
            }
          }
        }
      }
    }
  }
  if ((argc >= 3) && (argc <= 5)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::vector<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::vector<double> **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_GenericMatrixCommon_interp1d__SWIG_0(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< std::string **>(0));
          if (_v) {
            if (argc <= 4) {
              return _wrap_GenericMatrixCommon_interp1d__SWIG_0(resc,resv,argc,argv);
            }
            _v = casadi::to_ptr(argv[4], static_cast< bool **>(0));
            if (_v) {
              return _wrap_GenericMatrixCommon_interp1d__SWIG_0(resc,resv,argc,argv);
            }
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_interp1d'."
    "  Possible prototypes are:\n"
    "    INTERP1D([double],DM,[double],char,bool)\n"
    "    INTERP1D([double],SX,[double],char,bool)\n"
    "    INTERP1D([double],MX,[double],char,bool)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericMatrixCommon_soc__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_soc",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_soc__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_soc'."
      "  Prototype:\n"
      "    SOC(SX,SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_soc(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        return _wrap_GenericMatrixCommon_soc__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        return _wrap_GenericMatrixCommon_soc__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        return _wrap_GenericMatrixCommon_soc__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_soc'."
    "  Possible prototypes are:\n"
    "    SOC(DM,DM)\n"
    "    SOC(SX,SX)\n"
    "    SOC(MX,MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericMatrixCommon_cross__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi_int arg3 = (casadi_int) -1 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_cross",argc,3,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  }
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_cross__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_cross'."
      "  Prototype:\n"
      "    CROSS(SX,SX,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_cross(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 2) && (argc <= 3)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_GenericMatrixCommon_cross__SWIG_1(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          return _wrap_GenericMatrixCommon_cross__SWIG_1(resc,resv,argc,argv);
        }
      }
    }
  }
  if ((argc >= 2) && (argc <= 3)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_GenericMatrixCommon_cross__SWIG_2(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          return _wrap_GenericMatrixCommon_cross__SWIG_2(resc,resv,argc,argv);
        }
      }
    }
  }
  if ((argc >= 2) && (argc <= 3)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_GenericMatrixCommon_cross__SWIG_0(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          return _wrap_GenericMatrixCommon_cross__SWIG_0(resc,resv,argc,argv);
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_cross'."
    "  Possible prototypes are:\n"
    "    CROSS(DM,DM,int)\n"
    "    CROSS(SX,SX,int)\n"
    "    CROSS(MX,MX,int)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericMatrixCommon_skew__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_skew",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_skew__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_skew'."
      "  Prototype:\n"
      "    SKEW(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_skew(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_skew__SWIG_1(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_skew__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_skew__SWIG_0(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_skew'."
    "  Possible prototypes are:\n"
    "    SKEW(DM)\n"
    "    SKEW(SX)\n"
    "    SKEW(MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericMatrixCommon_inv_skew__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_inv_skew",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_inv_skew__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_inv_skew'."
      "  Prototype:\n"
      "    INV_SKEW(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_inv_skew(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_inv_skew__SWIG_1(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_inv_skew__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_inv_skew__SWIG_0(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_inv_skew'."
    "  Possible prototypes are:\n"
    "    INV_SKEW(DM)\n"
    "    INV_SKEW(SX)\n"
    "    INV_SKEW(MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericMatrixCommon_det__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_det",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_det__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_det'."
      "  Prototype:\n"
      "    DET(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_det(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_det__SWIG_1(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_det__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_det__SWIG_0(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_det'."
    "  Possible prototypes are:\n"
    "    DET(DM)\n"
    "    DET(SX)\n"
    "    DET(MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericMatrixCommon_inv_minor__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_inv_minor",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_inv_minor__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_inv_minor'."
      "  Prototype:\n"
      "    INV_MINOR(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_inv_minor(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_inv_minor__SWIG_1(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_inv_minor__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_inv_minor__SWIG_0(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_inv_minor'."
    "  Possible prototypes are:\n"
    "    INV_MINOR(DM)\n"
    "    INV_MINOR(SX)\n"
    "    INV_MINOR(MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericMatrixCommon_inv__SWIG_4(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_inv",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_inv__SWIG_4((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_inv'."
      "  Prototype:\n"
      "    INV(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_inv__SWIG_5(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  std::string *arg2 = 0 ;
  casadi::Dict const &arg3_defvalue = casadi::Dict() ;
  casadi::Dict *arg3 = (casadi::Dict *) &arg3_defvalue ;
  casadi::Matrix< casadi::SXElem > m1 ;
  std::string m2 ;
  std::map< std::string,casadi::GenericType > m3 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_inv",argc,3,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  if (2<argc) {
    arg3 = &m3;
    if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_inv__SWIG_5((casadi::Matrix< casadi::SXElem > const &)*arg1,(std::string const &)*arg2,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_inv'."
      "  Prototype:\n"
      "    INV(SX,char,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_inv(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_inv__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_inv__SWIG_4(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_inv__SWIG_0(resc,resv,argc,argv);
    }
  }
  if ((argc >= 2) && (argc <= 3)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_GenericMatrixCommon_inv__SWIG_3(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< std::map<std::string,casadi::GenericType> **>(0));
        if (_v) {
          return _wrap_GenericMatrixCommon_inv__SWIG_3(resc,resv,argc,argv);
        }
      }
    }
  }
  if ((argc >= 2) && (argc <= 3)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_GenericMatrixCommon_inv__SWIG_5(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< std::map<std::string,casadi::GenericType> **>(0));
        if (_v) {
          return _wrap_GenericMatrixCommon_inv__SWIG_5(resc,resv,argc,argv);
        }
      }
    }
  }
  if ((argc >= 2) && (argc <= 3)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_GenericMatrixCommon_inv__SWIG_1(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< std::map<std::string,casadi::GenericType> **>(0));
        if (_v) {
          return _wrap_GenericMatrixCommon_inv__SWIG_1(resc,resv,argc,argv);
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_inv'."
    "  Possible prototypes are:\n"
    "    INV(DM)\n"
    "    INV(SX)\n"
    "    INV(MX)\n"
    "    INV(DM,char,struct)\n"
    "    INV(SX,char,struct)\n"
    "    INV(MX,char,struct)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericMatrixCommon_trace__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_trace",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_trace__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_trace'."
      "  Prototype:\n"
      "    TRACE(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_trace(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_trace__SWIG_1(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_trace__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_trace__SWIG_0(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_trace'."
    "  Possible prototypes are:\n"
    "    TRACE(DM)\n"
    "    TRACE(SX)\n"
    "    TRACE(MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericMatrixCommon_tril2symm__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_tril2symm",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_tril2symm__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_tril2symm'."
      "  Prototype:\n"
      "    TRIL2SYMM(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_tril2symm(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_tril2symm__SWIG_1(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_tril2symm__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_tril2symm__SWIG_0(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_tril2symm'."
    "  Possible prototypes are:\n"
    "    TRIL2SYMM(DM)\n"
    "    TRIL2SYMM(SX)\n"
    "    TRIL2SYMM(MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericMatrixCommon_triu2symm__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_triu2symm",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_triu2symm__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_triu2symm'."
      "  Prototype:\n"
      "    TRIU2SYMM(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_triu2symm(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_triu2symm__SWIG_1(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_triu2symm__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_triu2symm__SWIG_0(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_triu2symm'."
    "  Possible prototypes are:\n"
    "    TRIU2SYMM(DM)\n"
    "    TRIU2SYMM(SX)\n"
    "    TRIU2SYMM(MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericMatrixCommon_norm_fro__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_norm_fro",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_norm_fro__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_norm_fro'."
      "  Prototype:\n"
      "    NORM_FRO(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_norm_fro(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_norm_fro__SWIG_1(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_norm_fro__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_norm_fro__SWIG_0(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_norm_fro'."
    "  Possible prototypes are:\n"
    "    NORM_FRO(DM)\n"
    "    NORM_FRO(SX)\n"
    "    NORM_FRO(MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericMatrixCommon_norm_2__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_norm_2",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_norm_2__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_norm_2'."
      "  Prototype:\n"
      "    NORM_2(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_norm_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_norm_2__SWIG_1(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_norm_2__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_norm_2__SWIG_0(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_norm_2'."
    "  Possible prototypes are:\n"
    "    NORM_2(DM)\n"
    "    NORM_2(SX)\n"
    "    NORM_2(MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericMatrixCommon_norm_1__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_norm_1",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_norm_1__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_norm_1'."
      "  Prototype:\n"
      "    NORM_1(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_norm_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_norm_1__SWIG_1(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_norm_1__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_norm_1__SWIG_0(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_norm_1'."
    "  Possible prototypes are:\n"
    "    NORM_1(DM)\n"
    "    NORM_1(SX)\n"
    "    NORM_1(MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericMatrixCommon_norm_inf__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_norm_inf",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_norm_inf__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_norm_inf'."
      "  Prototype:\n"
      "    NORM_INF(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_norm_inf(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_norm_inf__SWIG_1(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_norm_inf__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_norm_inf__SWIG_0(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_norm_inf'."
    "  Possible prototypes are:\n"
    "    NORM_INF(DM)\n"
    "    NORM_INF(SX)\n"
    "    NORM_INF(MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericMatrixCommon_dot__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_dot",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_dot__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_dot'."
      "  Prototype:\n"
      "    DOT(SX,SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_dot(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        return _wrap_GenericMatrixCommon_dot__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        return _wrap_GenericMatrixCommon_dot__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        return _wrap_GenericMatrixCommon_dot__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_dot'."
    "  Possible prototypes are:\n"
    "    DOT(DM,DM)\n"
    "    DOT(SX,SX)\n"
    "    DOT(MX,MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericMatrixCommon_nullspace__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_nullspace",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_nullspace__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_nullspace'."
      "  Prototype:\n"
      "    NULLSPACE(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_nullspace(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_nullspace__SWIG_1(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_nullspace__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_nullspace__SWIG_0(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_nullspace'."
    "  Possible prototypes are:\n"
    "    NULLSPACE(DM)\n"
    "    NULLSPACE(SX)\n"
    "    NULLSPACE(MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericMatrixCommon_polyval__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_polyval",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_polyval__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_polyval'."
      "  Prototype:\n"
      "    POLYVAL(SX,SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_polyval(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        return _wrap_GenericMatrixCommon_polyval__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        return _wrap_GenericMatrixCommon_polyval__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        return _wrap_GenericMatrixCommon_polyval__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_polyval'."
    "  Possible prototypes are:\n"
    "    POLYVAL(DM,DM)\n"
    "    POLYVAL(SX,SX)\n"
    "    POLYVAL(MX,MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericMatrixCommon_diag__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_diag",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_diag__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_diag'."
      "  Prototype:\n"
      "    DIAG(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_diag(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_diag__SWIG_1(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_diag__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_diag__SWIG_0(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_diag'."
    "  Possible prototypes are:\n"
    "    DIAG(DM)\n"
    "    DIAG(SX)\n"
    "    DIAG(MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericMatrixCommon_unite__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_unite",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_unite__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_unite'."
      "  Prototype:\n"
      "    UNITE(SX,SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_unite(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        return _wrap_GenericMatrixCommon_unite__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        return _wrap_GenericMatrixCommon_unite__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        return _wrap_GenericMatrixCommon_unite__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_unite'."
    "  Possible prototypes are:\n"
    "    UNITE(DM,DM)\n"
    "    UNITE(SX,SX)\n"
    "    UNITE(MX,MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericMatrixCommon_densify__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_densify",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_densify__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_densify'."
      "  Prototype:\n"
      "    DENSIFY(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_densify(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_densify__SWIG_1(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_densify__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_densify__SWIG_0(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_densify'."
    "  Possible prototypes are:\n"
    "    DENSIFY(DM)\n"
    "    DENSIFY(SX)\n"
    "    DENSIFY(MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericMatrixCommon_project__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Sparsity *arg2 = 0 ;
  bool arg3 = (bool) false ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Sparsity m2 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_project",argc,3,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "Sparsity" "'.");
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  }
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_project__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Sparsity const &)*arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_project'."
      "  Prototype:\n"
      "    PROJECT(SX,Sparsity,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_project(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 2) && (argc <= 3)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Sparsity **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_GenericMatrixCommon_project__SWIG_1(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< bool **>(0));
        if (_v) {
          return _wrap_GenericMatrixCommon_project__SWIG_1(resc,resv,argc,argv);
        }
      }
    }
  }
  if ((argc >= 2) && (argc <= 3)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Sparsity **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_GenericMatrixCommon_project__SWIG_2(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< bool **>(0));
        if (_v) {
          return _wrap_GenericMatrixCommon_project__SWIG_2(resc,resv,argc,argv);
        }
      }
    }
  }
  if ((argc >= 2) && (argc <= 3)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Sparsity **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_GenericMatrixCommon_project__SWIG_0(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< bool **>(0));
        if (_v) {
          return _wrap_GenericMatrixCommon_project__SWIG_0(resc,resv,argc,argv);
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_project'."
    "  Possible prototypes are:\n"
    "    PROJECT(DM,Sparsity,bool)\n"
    "    PROJECT(SX,Sparsity,bool)\n"
    "    PROJECT(MX,Sparsity,bool)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericMatrixCommon_if_else__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg3 = 0 ;
  bool arg4 = (bool) false ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  casadi::Matrix< casadi::SXElem > m3 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_if_else",argc,4,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "SX" "'.");
  if (3<argc) {
    if (!casadi::to_val(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "bool" "'.");
  }
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_if_else__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2,(casadi::Matrix< casadi::SXElem > const &)*arg3,arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_if_else'."
      "  Prototype:\n"
      "    IF_ELSE(SX,SX,SX,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_if_else(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 3) && (argc <= 4)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<double> **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_GenericMatrixCommon_if_else__SWIG_1(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< bool **>(0));
          if (_v) {
            return _wrap_GenericMatrixCommon_if_else__SWIG_1(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if ((argc >= 3) && (argc <= 4)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_GenericMatrixCommon_if_else__SWIG_2(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< bool **>(0));
          if (_v) {
            return _wrap_GenericMatrixCommon_if_else__SWIG_2(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if ((argc >= 3) && (argc <= 4)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::MX **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_GenericMatrixCommon_if_else__SWIG_0(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< bool **>(0));
          if (_v) {
            return _wrap_GenericMatrixCommon_if_else__SWIG_0(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_if_else'."
    "  Possible prototypes are:\n"
    "    IF_ELSE(DM,DM,DM,bool)\n"
    "    IF_ELSE(SX,SX,SX,bool)\n"
    "    IF_ELSE(MX,MX,MX,bool)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericMatrixCommon_conditional__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg3 = 0 ;
  bool arg4 = (bool) false ;
  casadi::Matrix< casadi::SXElem > m1 ;
  std::vector< casadi::Matrix< casadi::SXElem > > m2 ;
  casadi::Matrix< casadi::SXElem > m3 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_conditional",argc,4,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "SX" "}" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "SX" "'.");
  if (3<argc) {
    if (!casadi::to_val(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "bool" "'.");
  }
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_conditional__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1,(std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > const &)*arg2,(casadi::Matrix< casadi::SXElem > const &)*arg3,arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_conditional'."
      "  Prototype:\n"
      "    CONDITIONAL(SX,{SX},SX,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_conditional(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 3) && (argc <= 4)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector< casadi::Matrix<double> > **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<double> **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_GenericMatrixCommon_conditional__SWIG_1(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< bool **>(0));
          if (_v) {
            return _wrap_GenericMatrixCommon_conditional__SWIG_1(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if ((argc >= 3) && (argc <= 4)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector< casadi::Matrix<casadi::SXElem> > **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_GenericMatrixCommon_conditional__SWIG_2(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< bool **>(0));
          if (_v) {
            return _wrap_GenericMatrixCommon_conditional__SWIG_2(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if ((argc >= 3) && (argc <= 4)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<casadi::MX> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::MX **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_GenericMatrixCommon_conditional__SWIG_0(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< bool **>(0));
          if (_v) {
            return _wrap_GenericMatrixCommon_conditional__SWIG_0(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_conditional'."
    "  Possible prototypes are:\n"
    "    CONDITIONAL(DM,{DM},DM,bool)\n"
    "    CONDITIONAL(SX,{SX},SX,bool)\n"
    "    CONDITIONAL(MX,{MX},MX,bool)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericMatrixCommon_depends_on__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_depends_on",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  {
    try {
      result = (bool)casadi_GenericMatrixCommon_casadi_depends_on__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_depends_on'."
      "  Prototype:\n"
      "    DEPENDS_ON(SX,SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_depends_on(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        return _wrap_GenericMatrixCommon_depends_on__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        return _wrap_GenericMatrixCommon_depends_on__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        return _wrap_GenericMatrixCommon_depends_on__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_depends_on'."
    "  Possible prototypes are:\n"
    "    DEPENDS_ON(DM,DM)\n"
    "    DEPENDS_ON(SX,SX)\n"
    "    DEPENDS_ON(MX,MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericMatrixCommon_solve__SWIG_4(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_solve",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_solve__SWIG_4((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_solve'."
      "  Prototype:\n"
      "    SOLVE(SX,SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_solve__SWIG_5(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  std::string *arg3 = 0 ;
  casadi::Dict const &arg4_defvalue = casadi::Dict() ;
  casadi::Dict *arg4 = (casadi::Dict *) &arg4_defvalue ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  std::string m3 ;
  std::map< std::string,casadi::GenericType > m4 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_solve",argc,4,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "char" "'.");
  if (3<argc) {
    arg4 = &m4;
    if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_solve__SWIG_5((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2,(std::string const &)*arg3,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_solve'."
      "  Prototype:\n"
      "    SOLVE(SX,SX,char,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_solve(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        return _wrap_GenericMatrixCommon_solve__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        return _wrap_GenericMatrixCommon_solve__SWIG_4(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        return _wrap_GenericMatrixCommon_solve__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  if ((argc >= 3) && (argc <= 4)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::string **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_GenericMatrixCommon_solve__SWIG_3(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< std::map<std::string,casadi::GenericType> **>(0));
          if (_v) {
            return _wrap_GenericMatrixCommon_solve__SWIG_3(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if ((argc >= 3) && (argc <= 4)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::string **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_GenericMatrixCommon_solve__SWIG_5(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< std::map<std::string,casadi::GenericType> **>(0));
          if (_v) {
            return _wrap_GenericMatrixCommon_solve__SWIG_5(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if ((argc >= 3) && (argc <= 4)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::string **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_GenericMatrixCommon_solve__SWIG_1(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< std::map<std::string,casadi::GenericType> **>(0));
          if (_v) {
            return _wrap_GenericMatrixCommon_solve__SWIG_1(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_solve'."
    "  Possible prototypes are:\n"
    "    SOLVE(DM,DM)\n"
    "    SOLVE(SX,SX)\n"
    "    SOLVE(MX,MX)\n"
    "    SOLVE(DM,DM,char,struct)\n"
    "    SOLVE(SX,SX,char,struct)\n"
    "    SOLVE(MX,MX,char,struct)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericMatrixCommon_pinv__SWIG_4(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_pinv",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_pinv__SWIG_4((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_pinv'."
      "  Prototype:\n"
      "    PINV(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_pinv__SWIG_5(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  std::string *arg2 = 0 ;
  casadi::Dict const &arg3_defvalue = casadi::Dict() ;
  casadi::Dict *arg3 = (casadi::Dict *) &arg3_defvalue ;
  casadi::Matrix< casadi::SXElem > m1 ;
  std::string m2 ;
  std::map< std::string,casadi::GenericType > m3 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_pinv",argc,3,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  if (2<argc) {
    arg3 = &m3;
    if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_pinv__SWIG_5((casadi::Matrix< casadi::SXElem > const &)*arg1,(std::string const &)*arg2,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_pinv'."
      "  Prototype:\n"
      "    PINV(SX,char,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_pinv(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_pinv__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_pinv__SWIG_4(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_pinv__SWIG_0(resc,resv,argc,argv);
    }
  }
  if ((argc >= 2) && (argc <= 3)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_GenericMatrixCommon_pinv__SWIG_3(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< std::map<std::string,casadi::GenericType> **>(0));
        if (_v) {
          return _wrap_GenericMatrixCommon_pinv__SWIG_3(resc,resv,argc,argv);
        }
      }
    }
  }
  if ((argc >= 2) && (argc <= 3)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_GenericMatrixCommon_pinv__SWIG_5(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< std::map<std::string,casadi::GenericType> **>(0));
        if (_v) {
          return _wrap_GenericMatrixCommon_pinv__SWIG_5(resc,resv,argc,argv);
        }
      }
    }
  }
  if ((argc >= 2) && (argc <= 3)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_GenericMatrixCommon_pinv__SWIG_1(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< std::map<std::string,casadi::GenericType> **>(0));
        if (_v) {
          return _wrap_GenericMatrixCommon_pinv__SWIG_1(resc,resv,argc,argv);
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_pinv'."
    "  Possible prototypes are:\n"
    "    PINV(DM)\n"
    "    PINV(SX)\n"
    "    PINV(MX)\n"
    "    PINV(DM,char,struct)\n"
    "    PINV(SX,char,struct)\n"
    "    PINV(MX,char,struct)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericMatrixCommon_expm_const__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_expm_const",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_expm_const__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_expm_const'."
      "  Prototype:\n"
      "    EXPM_CONST(SX,SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_expm_const(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        return _wrap_GenericMatrixCommon_expm_const__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        return _wrap_GenericMatrixCommon_expm_const__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        return _wrap_GenericMatrixCommon_expm_const__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_expm_const'."
    "  Possible prototypes are:\n"
    "    EXPM_CONST(DM,DM)\n"
    "    EXPM_CONST(SX,SX)\n"
    "    EXPM_CONST(MX,MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericMatrixCommon_expm__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_expm",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_expm__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_expm'."
      "  Prototype:\n"
      "    EXPM(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_expm(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_expm__SWIG_1(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_expm__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_expm__SWIG_0(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_expm'."
    "  Possible prototypes are:\n"
    "    EXPM(DM)\n"
    "    EXPM(SX)\n"
    "    EXPM(MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericMatrixCommon_jacobian__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Dict const &arg3_defvalue = casadi::Dict() ;
  casadi::Dict *arg3 = (casadi::Dict *) &arg3_defvalue ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  std::map< std::string,casadi::GenericType > m3 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_jacobian",argc,3,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  if (2<argc) {
    arg3 = &m3;
    if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_jacobian__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_jacobian'."
      "  Prototype:\n"
      "    JACOBIAN(SX,SX,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_jacobian(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 2) && (argc <= 3)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_GenericMatrixCommon_jacobian__SWIG_1(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< std::map<std::string,casadi::GenericType> **>(0));
        if (_v) {
          return _wrap_GenericMatrixCommon_jacobian__SWIG_1(resc,resv,argc,argv);
        }
      }
    }
  }
  if ((argc >= 2) && (argc <= 3)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_GenericMatrixCommon_jacobian__SWIG_2(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< std::map<std::string,casadi::GenericType> **>(0));
        if (_v) {
          return _wrap_GenericMatrixCommon_jacobian__SWIG_2(resc,resv,argc,argv);
        }
      }
    }
  }
  if ((argc >= 2) && (argc <= 3)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_GenericMatrixCommon_jacobian__SWIG_0(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< std::map<std::string,casadi::GenericType> **>(0));
        if (_v) {
          return _wrap_GenericMatrixCommon_jacobian__SWIG_0(resc,resv,argc,argv);
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_jacobian'."
    "  Possible prototypes are:\n"
    "    JACOBIAN(DM,DM,struct)\n"
    "    JACOBIAN(SX,SX,struct)\n"
    "    JACOBIAN(MX,MX,struct)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericMatrixCommon_jtimes__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg3 = 0 ;
  bool arg4 = (bool) false ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  casadi::Matrix< casadi::SXElem > m3 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_jtimes",argc,4,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "SX" "'.");
  if (3<argc) {
    if (!casadi::to_val(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "bool" "'.");
  }
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_jtimes__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2,(casadi::Matrix< casadi::SXElem > const &)*arg3,arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_jtimes'."
      "  Prototype:\n"
      "    JTIMES(SX,SX,SX,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_jtimes(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 3) && (argc <= 4)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<double> **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_GenericMatrixCommon_jtimes__SWIG_1(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< bool **>(0));
          if (_v) {
            return _wrap_GenericMatrixCommon_jtimes__SWIG_1(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if ((argc >= 3) && (argc <= 4)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_GenericMatrixCommon_jtimes__SWIG_2(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< bool **>(0));
          if (_v) {
            return _wrap_GenericMatrixCommon_jtimes__SWIG_2(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if ((argc >= 3) && (argc <= 4)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::MX **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_GenericMatrixCommon_jtimes__SWIG_0(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< bool **>(0));
          if (_v) {
            return _wrap_GenericMatrixCommon_jtimes__SWIG_0(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_jtimes'."
    "  Possible prototypes are:\n"
    "    JTIMES(DM,DM,DM,bool)\n"
    "    JTIMES(SX,SX,SX,bool)\n"
    "    JTIMES(MX,MX,MX,bool)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericMatrixCommon_linearize__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg3 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  casadi::Matrix< casadi::SXElem > m3 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_linearize",argc,3,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_linearize__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2,(casadi::Matrix< casadi::SXElem > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_linearize'."
      "  Prototype:\n"
      "    LINEARIZE(SX,SX,SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_linearize(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 3) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<double> **>(0));
        if (_v) {
          return _wrap_GenericMatrixCommon_linearize__SWIG_1(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
        if (_v) {
          return _wrap_GenericMatrixCommon_linearize__SWIG_2(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::MX **>(0));
        if (_v) {
          return _wrap_GenericMatrixCommon_linearize__SWIG_0(resc,resv,argc,argv);
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_linearize'."
    "  Possible prototypes are:\n"
    "    LINEARIZE(DM,DM,DM)\n"
    "    LINEARIZE(SX,SX,SX)\n"
    "    LINEARIZE(MX,MX,MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericMatrixCommon_which_depends__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi_int arg3 = (casadi_int) 1 ;
  bool arg4 = (bool) false ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  mxArray * _out;
  std::vector< bool,std::allocator< bool > > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_which_depends",argc,4,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  }
  if (3<argc) {
    if (!casadi::to_val(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "bool" "'.");
  }
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_which_depends__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2,arg3,arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[" "bool" "]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_which_depends'."
      "  Prototype:\n"
      "    WHICH_DEPENDS(SX,SX,int,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_which_depends(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 2) && (argc <= 4)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_GenericMatrixCommon_which_depends__SWIG_1(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_GenericMatrixCommon_which_depends__SWIG_1(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< bool **>(0));
          if (_v) {
            return _wrap_GenericMatrixCommon_which_depends__SWIG_1(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if ((argc >= 2) && (argc <= 4)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_GenericMatrixCommon_which_depends__SWIG_2(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_GenericMatrixCommon_which_depends__SWIG_2(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< bool **>(0));
          if (_v) {
            return _wrap_GenericMatrixCommon_which_depends__SWIG_2(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if ((argc >= 2) && (argc <= 4)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_GenericMatrixCommon_which_depends__SWIG_0(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_GenericMatrixCommon_which_depends__SWIG_0(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< bool **>(0));
          if (_v) {
            return _wrap_GenericMatrixCommon_which_depends__SWIG_0(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_which_depends'."
    "  Possible prototypes are:\n"
    "    WHICH_DEPENDS(DM,DM,int,bool)\n"
    "    WHICH_DEPENDS(SX,SX,int,bool)\n"
    "    WHICH_DEPENDS(MX,MX,int,bool)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericMatrixCommon_jacobian_sparsity__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_jacobian_sparsity",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_jacobian_sparsity__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_jacobian_sparsity'."
      "  Prototype:\n"
      "    JACOBIAN_SPARSITY(SX,SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_jacobian_sparsity(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        return _wrap_GenericMatrixCommon_jacobian_sparsity__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        return _wrap_GenericMatrixCommon_jacobian_sparsity__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        return _wrap_GenericMatrixCommon_jacobian_sparsity__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_jacobian_sparsity'."
    "  Possible prototypes are:\n"
    "    JACOBIAN_SPARSITY(DM,DM)\n"
    "    JACOBIAN_SPARSITY(SX,SX)\n"
    "    JACOBIAN_SPARSITY(MX,MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericMatrixCommon_is_linear__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_is_linear",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  {
    try {
      result = (bool)casadi_GenericMatrixCommon_casadi_is_linear__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_is_linear'."
      "  Prototype:\n"
      "    IS_LINEAR(SX,SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_is_linear(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        return _wrap_GenericMatrixCommon_is_linear__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        return _wrap_GenericMatrixCommon_is_linear__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        return _wrap_GenericMatrixCommon_is_linear__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_is_linear'."
    "  Possible prototypes are:\n"
    "    IS_LINEAR(DM,DM)\n"
    "    IS_LINEAR(SX,SX)\n"
    "    IS_LINEAR(MX,MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericMatrixCommon_is_quadratic__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_is_quadratic",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  {
    try {
      result = (bool)casadi_GenericMatrixCommon_casadi_is_quadratic__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_is_quadratic'."
      "  Prototype:\n"
      "    IS_QUADRATIC(SX,SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_is_quadratic(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        return _wrap_GenericMatrixCommon_is_quadratic__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        return _wrap_GenericMatrixCommon_is_quadratic__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        return _wrap_GenericMatrixCommon_is_quadratic__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_is_quadratic'."
    "  Possible prototypes are:\n"
    "    IS_QUADRATIC(DM,DM)\n"
    "    IS_QUADRATIC(SX,SX)\n"
    "    IS_QUADRATIC(MX,MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericMatrixCommon_gradient__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_gradient",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_gradient__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_gradient'."
      "  Prototype:\n"
      "    GRADIENT(SX,SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_gradient(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        return _wrap_GenericMatrixCommon_gradient__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        return _wrap_GenericMatrixCommon_gradient__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        return _wrap_GenericMatrixCommon_gradient__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_gradient'."
    "  Possible prototypes are:\n"
    "    GRADIENT(DM,DM)\n"
    "    GRADIENT(SX,SX)\n"
    "    GRADIENT(MX,MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericMatrixCommon_tangent__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_tangent",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_tangent__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_tangent'."
      "  Prototype:\n"
      "    TANGENT(SX,SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_tangent(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        return _wrap_GenericMatrixCommon_tangent__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        return _wrap_GenericMatrixCommon_tangent__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        return _wrap_GenericMatrixCommon_tangent__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_tangent'."
    "  Possible prototypes are:\n"
    "    TANGENT(DM,DM)\n"
    "    TANGENT(SX,SX)\n"
    "    TANGENT(MX,MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericMatrixCommon_hessian__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg3 = 0 ;
  casadi::Dict const &arg4_defvalue = casadi::Dict() ;
  casadi::Dict *arg4 = (casadi::Dict *) &arg4_defvalue ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  casadi::Matrix< casadi::SXElem > m3 ;
  std::map< std::string,casadi::GenericType > m4 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  arg3 = &m3;
  if (!SWIG_check_num_args("GenericMatrixCommon_hessian",argc,3,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  if (2<argc) {
    arg4 = &m4;
    if (!casadi::to_ptr(argv[2], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_hessian__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2,*arg3,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg3);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_hessian'."
      "  Prototype:\n"
      "    HESSIAN(SX,SX,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_hessian(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 2) && (argc <= 3)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_GenericMatrixCommon_hessian__SWIG_1(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< std::map<std::string,casadi::GenericType> **>(0));
        if (_v) {
          return _wrap_GenericMatrixCommon_hessian__SWIG_1(resc,resv,argc,argv);
        }
      }
    }
  }
  if ((argc >= 2) && (argc <= 3)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_GenericMatrixCommon_hessian__SWIG_2(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< std::map<std::string,casadi::GenericType> **>(0));
        if (_v) {
          return _wrap_GenericMatrixCommon_hessian__SWIG_2(resc,resv,argc,argv);
        }
      }
    }
  }
  if ((argc >= 2) && (argc <= 3)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_GenericMatrixCommon_hessian__SWIG_0(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< std::map<std::string,casadi::GenericType> **>(0));
        if (_v) {
          return _wrap_GenericMatrixCommon_hessian__SWIG_0(resc,resv,argc,argv);
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_hessian'."
    "  Possible prototypes are:\n"
    "    HESSIAN(DM,DM,struct)\n"
    "    HESSIAN(SX,SX,struct)\n"
    "    HESSIAN(MX,MX,struct)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericMatrixCommon_quadratic_coeff__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg3 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg4 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg5 = 0 ;
  bool arg6 = (bool) true ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  casadi::Matrix< casadi::SXElem > m3 ;
  casadi::Matrix< casadi::SXElem > m4 ;
  casadi::Matrix< casadi::SXElem > m5 ;
  mxArray * _out;
  
  arg3 = &m3;
  arg4 = &m4;
  arg5 = &m5;
  if (!SWIG_check_num_args("GenericMatrixCommon_quadratic_coeff",argc,3,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg6)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 6 to type '" "bool" "'.");
  }
  {
    try {
      casadi_GenericMatrixCommon_casadi_quadratic_coeff__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2,*arg3,*arg4,*arg5,arg6);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg3);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg4);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg5);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_quadratic_coeff'."
      "  Prototype:\n"
      "    QUADRATIC_COEFF(SX,SX,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_quadratic_coeff(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 2) && (argc <= 3)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_GenericMatrixCommon_quadratic_coeff__SWIG_1(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< bool **>(0));
        if (_v) {
          return _wrap_GenericMatrixCommon_quadratic_coeff__SWIG_1(resc,resv,argc,argv);
        }
      }
    }
  }
  if ((argc >= 2) && (argc <= 3)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_GenericMatrixCommon_quadratic_coeff__SWIG_2(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< bool **>(0));
        if (_v) {
          return _wrap_GenericMatrixCommon_quadratic_coeff__SWIG_2(resc,resv,argc,argv);
        }
      }
    }
  }
  if ((argc >= 2) && (argc <= 3)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_GenericMatrixCommon_quadratic_coeff__SWIG_0(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< bool **>(0));
        if (_v) {
          return _wrap_GenericMatrixCommon_quadratic_coeff__SWIG_0(resc,resv,argc,argv);
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_quadratic_coeff'."
    "  Possible prototypes are:\n"
    "    QUADRATIC_COEFF(DM,DM,bool)\n"
    "    QUADRATIC_COEFF(SX,SX,bool)\n"
    "    QUADRATIC_COEFF(MX,MX,bool)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericMatrixCommon_linear_coeff__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg3 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg4 = 0 ;
  bool arg5 = (bool) true ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  casadi::Matrix< casadi::SXElem > m3 ;
  casadi::Matrix< casadi::SXElem > m4 ;
  mxArray * _out;
  
  arg3 = &m3;
  arg4 = &m4;
  if (!SWIG_check_num_args("GenericMatrixCommon_linear_coeff",argc,3,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "bool" "'.");
  }
  {
    try {
      casadi_GenericMatrixCommon_casadi_linear_coeff__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2,*arg3,*arg4,arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg3);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg4);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_linear_coeff'."
      "  Prototype:\n"
      "    LINEAR_COEFF(SX,SX,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_linear_coeff(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 2) && (argc <= 3)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_GenericMatrixCommon_linear_coeff__SWIG_1(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< bool **>(0));
        if (_v) {
          return _wrap_GenericMatrixCommon_linear_coeff__SWIG_1(resc,resv,argc,argv);
        }
      }
    }
  }
  if ((argc >= 2) && (argc <= 3)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_GenericMatrixCommon_linear_coeff__SWIG_2(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< bool **>(0));
        if (_v) {
          return _wrap_GenericMatrixCommon_linear_coeff__SWIG_2(resc,resv,argc,argv);
        }
      }
    }
  }
  if ((argc >= 2) && (argc <= 3)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_GenericMatrixCommon_linear_coeff__SWIG_0(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< bool **>(0));
        if (_v) {
          return _wrap_GenericMatrixCommon_linear_coeff__SWIG_0(resc,resv,argc,argv);
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_linear_coeff'."
    "  Possible prototypes are:\n"
    "    LINEAR_COEFF(DM,DM,bool)\n"
    "    LINEAR_COEFF(SX,SX,bool)\n"
    "    LINEAR_COEFF(MX,MX,bool)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericMatrixCommon_n_nodes__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_n_nodes",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = (casadi_int)casadi_GenericMatrixCommon_casadi_n_nodes__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_n_nodes'."
      "  Prototype:\n"
      "    N_NODES(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_n_nodes(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_n_nodes__SWIG_1(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_n_nodes__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_n_nodes__SWIG_0(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_n_nodes'."
    "  Possible prototypes are:\n"
    "    N_NODES(DM)\n"
    "    N_NODES(SX)\n"
    "    N_NODES(MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericMatrixCommon_print_operator__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  std::vector< std::string > m2 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_print_operator",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "char" "}" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_print_operator__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1,(std::vector< std::string,std::allocator< std::string > > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_print_operator'."
      "  Prototype:\n"
      "    PRINT_OPERATOR(SX,{char})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_print_operator(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<std::string> **>(0));
      if (_v) {
        return _wrap_GenericMatrixCommon_print_operator__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<std::string> **>(0));
      if (_v) {
        return _wrap_GenericMatrixCommon_print_operator__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<std::string> **>(0));
      if (_v) {
        return _wrap_GenericMatrixCommon_print_operator__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_print_operator'."
    "  Possible prototypes are:\n"
    "    PRINT_OPERATOR(DM,{char})\n"
    "    PRINT_OPERATOR(SX,{char})\n"
    "    PRINT_OPERATOR(MX,{char})\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericMatrixCommon_repsum__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi_int arg2 ;
  casadi_int arg3 = (casadi_int) 1 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_repsum",argc,3,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  }
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_repsum__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1,arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_repsum'."
      "  Prototype:\n"
      "    REPSUM(SX,int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_repsum(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 2) && (argc <= 3)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_GenericMatrixCommon_repsum__SWIG_1(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          return _wrap_GenericMatrixCommon_repsum__SWIG_1(resc,resv,argc,argv);
        }
      }
    }
  }
  if ((argc >= 2) && (argc <= 3)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_GenericMatrixCommon_repsum__SWIG_2(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          return _wrap_GenericMatrixCommon_repsum__SWIG_2(resc,resv,argc,argv);
        }
      }
    }
  }
  if ((argc >= 2) && (argc <= 3)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_GenericMatrixCommon_repsum__SWIG_0(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          return _wrap_GenericMatrixCommon_repsum__SWIG_0(resc,resv,argc,argv);
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_repsum'."
    "  Possible prototypes are:\n"
    "    REPSUM(DM,int,int)\n"
    "    REPSUM(SX,int,int)\n"
    "    REPSUM(MX,int,int)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericMatrixCommon_diff__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi_int arg2 = (casadi_int) 1 ;
  casadi_index arg3 = (casadi_index) -1 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_diff",argc,3,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  }
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type ' index '.");
    if (arg3==0) SWIG_exception_fail(SWIG_TypeError,"Index starts at 1, got index '0'.");
    if (arg3>=1) arg3--;
  }
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_diff__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1,arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_diff'."
      "  Prototype:\n"
      "    DIFF(SX,int,index)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_diff(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 1) && (argc <= 3)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_GenericMatrixCommon_diff__SWIG_1(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_GenericMatrixCommon_diff__SWIG_1(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          return _wrap_GenericMatrixCommon_diff__SWIG_1(resc,resv,argc,argv);
        }
      }
    }
  }
  if ((argc >= 1) && (argc <= 3)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_GenericMatrixCommon_diff__SWIG_2(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_GenericMatrixCommon_diff__SWIG_2(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          return _wrap_GenericMatrixCommon_diff__SWIG_2(resc,resv,argc,argv);
        }
      }
    }
  }
  if ((argc >= 1) && (argc <= 3)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_GenericMatrixCommon_diff__SWIG_0(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_GenericMatrixCommon_diff__SWIG_0(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          return _wrap_GenericMatrixCommon_diff__SWIG_0(resc,resv,argc,argv);
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_diff'."
    "  Possible prototypes are:\n"
    "    DIFF(DM,int,index)\n"
    "    DIFF(SX,int,index)\n"
    "    DIFF(MX,int,index)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericMatrixCommon_cumsum__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi_index arg2 = (casadi_index) -1 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_cumsum",argc,2,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type ' index '.");
    if (arg2==0) SWIG_exception_fail(SWIG_TypeError,"Index starts at 1, got index '0'.");
    if (arg2>=1) arg2--;
  }
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_cumsum__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_cumsum'."
      "  Prototype:\n"
      "    CUMSUM(SX,index)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_cumsum(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 1) && (argc <= 2)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_GenericMatrixCommon_cumsum__SWIG_1(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_GenericMatrixCommon_cumsum__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if ((argc >= 1) && (argc <= 2)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_GenericMatrixCommon_cumsum__SWIG_2(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_GenericMatrixCommon_cumsum__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if ((argc >= 1) && (argc <= 2)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_GenericMatrixCommon_cumsum__SWIG_0(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_GenericMatrixCommon_cumsum__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_cumsum'."
    "  Possible prototypes are:\n"
    "    CUMSUM(DM,index)\n"
    "    CUMSUM(SX,index)\n"
    "    CUMSUM(MX,index)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericMatrixCommon_einstein__SWIG_4(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg3 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg4 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg5 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg6 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg7 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg8 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg9 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  casadi::Matrix< casadi::SXElem > m3 ;
  std::vector< casadi_int > m4 ;
  std::vector< casadi_int > m5 ;
  std::vector< casadi_int > m6 ;
  std::vector< casadi_int > m7 ;
  std::vector< casadi_int > m8 ;
  std::vector< casadi_int > m9 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_einstein",argc,9,9,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "SX" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "[" "int" "]" "'.");
  arg5 = &m5;
  if (!casadi::to_ptr(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "[" "int" "]" "'.");
  arg6 = &m6;
  if (!casadi::to_ptr(argv[5], &arg6)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 6 to type '" "[" "int" "]" "'.");
  arg7 = &m7;
  if (!casadi::to_ptr(argv[6], &arg7)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 7 to type '" "[" "int" "]" "'.");
  arg8 = &m8;
  if (!casadi::to_ptr(argv[7], &arg8)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 8 to type '" "[" "int" "]" "'.");
  arg9 = &m9;
  if (!casadi::to_ptr(argv[8], &arg9)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 9 to type '" "[" "int" "]" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_einstein__SWIG_4((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2,(casadi::Matrix< casadi::SXElem > const &)*arg3,(std::vector< long long,std::allocator< long long > > const &)*arg4,(std::vector< long long,std::allocator< long long > > const &)*arg5,(std::vector< long long,std::allocator< long long > > const &)*arg6,(std::vector< long long,std::allocator< long long > > const &)*arg7,(std::vector< long long,std::allocator< long long > > const &)*arg8,(std::vector< long long,std::allocator< long long > > const &)*arg9);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_einstein'."
      "  Prototype:\n"
      "    EINSTEIN(SX,SX,SX,[int],[int],[int],[int],[int],[int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_einstein__SWIG_5(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg3 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg4 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg5 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg6 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg7 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg8 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  std::vector< casadi_int > m3 ;
  std::vector< casadi_int > m4 ;
  std::vector< casadi_int > m5 ;
  std::vector< casadi_int > m6 ;
  std::vector< casadi_int > m7 ;
  std::vector< casadi_int > m8 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_einstein",argc,8,8,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "[" "int" "]" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "[" "int" "]" "'.");
  arg5 = &m5;
  if (!casadi::to_ptr(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "[" "int" "]" "'.");
  arg6 = &m6;
  if (!casadi::to_ptr(argv[5], &arg6)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 6 to type '" "[" "int" "]" "'.");
  arg7 = &m7;
  if (!casadi::to_ptr(argv[6], &arg7)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 7 to type '" "[" "int" "]" "'.");
  arg8 = &m8;
  if (!casadi::to_ptr(argv[7], &arg8)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 8 to type '" "[" "int" "]" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_einstein__SWIG_5((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2,(std::vector< long long,std::allocator< long long > > const &)*arg3,(std::vector< long long,std::allocator< long long > > const &)*arg4,(std::vector< long long,std::allocator< long long > > const &)*arg5,(std::vector< long long,std::allocator< long long > > const &)*arg6,(std::vector< long long,std::allocator< long long > > const &)*arg7,(std::vector< long long,std::allocator< long long > > const &)*arg8);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_einstein'."
      "  Prototype:\n"
      "    EINSTEIN(SX,SX,[int],[int],[int],[int],[int],[int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_einstein(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 8) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::vector<casadi_int> **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< std::vector<casadi_int> **>(0));
          if (_v) {
            _v = casadi::to_ptr(argv[4], static_cast< std::vector<casadi_int> **>(0));
            if (_v) {
              _v = casadi::to_ptr(argv[5], static_cast< std::vector<casadi_int> **>(0));
              if (_v) {
                _v = casadi::to_ptr(argv[6], static_cast< std::vector<casadi_int> **>(0));
                if (_v) {
                  _v = casadi::to_ptr(argv[7], static_cast< std::vector<casadi_int> **>(0));
                  if (_v) {
                    return _wrap_GenericMatrixCommon_einstein__SWIG_3(resc,resv,argc,argv);
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  if (argc == 8) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::vector<casadi_int> **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< std::vector<casadi_int> **>(0));
          if (_v) {
            _v = casadi::to_ptr(argv[4], static_cast< std::vector<casadi_int> **>(0));
            if (_v) {
              _v = casadi::to_ptr(argv[5], static_cast< std::vector<casadi_int> **>(0));
              if (_v) {
                _v = casadi::to_ptr(argv[6], static_cast< std::vector<casadi_int> **>(0));
                if (_v) {
                  _v = casadi::to_ptr(argv[7], static_cast< std::vector<casadi_int> **>(0));
                  if (_v) {
                    return _wrap_GenericMatrixCommon_einstein__SWIG_5(resc,resv,argc,argv);
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  if (argc == 8) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::vector<casadi_int> **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< std::vector<casadi_int> **>(0));
          if (_v) {
            _v = casadi::to_ptr(argv[4], static_cast< std::vector<casadi_int> **>(0));
            if (_v) {
              _v = casadi::to_ptr(argv[5], static_cast< std::vector<casadi_int> **>(0));
              if (_v) {
                _v = casadi::to_ptr(argv[6], static_cast< std::vector<casadi_int> **>(0));
                if (_v) {
                  _v = casadi::to_ptr(argv[7], static_cast< std::vector<casadi_int> **>(0));
                  if (_v) {
                    return _wrap_GenericMatrixCommon_einstein__SWIG_1(resc,resv,argc,argv);
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  if (argc == 9) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<double> **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< std::vector<casadi_int> **>(0));
          if (_v) {
            _v = casadi::to_ptr(argv[4], static_cast< std::vector<casadi_int> **>(0));
            if (_v) {
              _v = casadi::to_ptr(argv[5], static_cast< std::vector<casadi_int> **>(0));
              if (_v) {
                _v = casadi::to_ptr(argv[6], static_cast< std::vector<casadi_int> **>(0));
                if (_v) {
                  _v = casadi::to_ptr(argv[7], static_cast< std::vector<casadi_int> **>(0));
                  if (_v) {
                    _v = casadi::to_ptr(argv[8], static_cast< std::vector<casadi_int> **>(0));
                    if (_v) {
                      return _wrap_GenericMatrixCommon_einstein__SWIG_2(resc,resv,argc,argv);
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  if (argc == 9) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< std::vector<casadi_int> **>(0));
          if (_v) {
            _v = casadi::to_ptr(argv[4], static_cast< std::vector<casadi_int> **>(0));
            if (_v) {
              _v = casadi::to_ptr(argv[5], static_cast< std::vector<casadi_int> **>(0));
              if (_v) {
                _v = casadi::to_ptr(argv[6], static_cast< std::vector<casadi_int> **>(0));
                if (_v) {
                  _v = casadi::to_ptr(argv[7], static_cast< std::vector<casadi_int> **>(0));
                  if (_v) {
                    _v = casadi::to_ptr(argv[8], static_cast< std::vector<casadi_int> **>(0));
                    if (_v) {
                      return _wrap_GenericMatrixCommon_einstein__SWIG_4(resc,resv,argc,argv);
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  if (argc == 9) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::MX **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< std::vector<casadi_int> **>(0));
          if (_v) {
            _v = casadi::to_ptr(argv[4], static_cast< std::vector<casadi_int> **>(0));
            if (_v) {
              _v = casadi::to_ptr(argv[5], static_cast< std::vector<casadi_int> **>(0));
              if (_v) {
                _v = casadi::to_ptr(argv[6], static_cast< std::vector<casadi_int> **>(0));
                if (_v) {
                  _v = casadi::to_ptr(argv[7], static_cast< std::vector<casadi_int> **>(0));
                  if (_v) {
                    _v = casadi::to_ptr(argv[8], static_cast< std::vector<casadi_int> **>(0));
                    if (_v) {
                      return _wrap_GenericMatrixCommon_einstein__SWIG_0(resc,resv,argc,argv);
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_einstein'."
    "  Possible prototypes are:\n"
    "    EINSTEIN(DM,DM,[int],[int],[int],[int],[int],[int])\n"
    "    EINSTEIN(SX,SX,[int],[int],[int],[int],[int],[int])\n"
    "    EINSTEIN(MX,MX,[int],[int],[int],[int],[int],[int])\n"
    "    EINSTEIN(DM,DM,DM,[int],[int],[int],[int],[int],[int])\n"
    "    EINSTEIN(SX,SX,SX,[int],[int],[int],[int],[int],[int])\n"
    "    EINSTEIN(MX,MX,MX,[int],[int],[int],[int],[int],[int])\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericMatrixCommon_mmin__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_mmin",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_mmin__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_mmin'."
      "  Prototype:\n"
      "    MMIN(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_mmin(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_mmin__SWIG_1(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_mmin__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_mmin__SWIG_0(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_mmin'."
    "  Possible prototypes are:\n"
    "    MMIN(DM)\n"
    "    MMIN(SX)\n"
    "    MMIN(MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericMatrixCommon_mmax__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_mmax",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_mmax__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_mmax'."
      "  Prototype:\n"
      "    MMAX(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_mmax(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_mmax__SWIG_1(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_mmax__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_mmax__SWIG_0(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_mmax'."
    "  Possible prototypes are:\n"
    "    MMAX(DM)\n"
    "    MMAX(SX)\n"
    "    MMAX(MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericMatrixCommon_evalf__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::DM result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_evalf",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_evalf__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_evalf'."
      "  Prototype:\n"
      "    EVALF(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_evalf(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_evalf__SWIG_1(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_evalf__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_evalf__SWIG_0(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_evalf'."
    "  Possible prototypes are:\n"
    "    EVALF(DM)\n"
    "    EVALF(SX)\n"
    "    EVALF(MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericMatrixCommon_cse__SWIG_4(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > *arg1 = 0 ;
  std::vector< casadi::Matrix< casadi::SXElem > > m1 ;
  mxArray * _out;
  std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_cse",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "{" "SX" "}" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_cse__SWIG_4((std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "SX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_cse'."
      "  Prototype:\n"
      "    CSE({SX})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_cse__SWIG_5(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericMatrixCommon_cse",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericMatrixCommon_casadi_cse__SWIG_5((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_cse'."
      "  Prototype:\n"
      "    CSE(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericMatrixCommon_cse(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_cse__SWIG_3(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::vector< casadi::Matrix<double> > **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_cse__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::vector< casadi::Matrix<casadi::SXElem> > **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_cse__SWIG_4(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_cse__SWIG_5(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_cse__SWIG_1(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::vector<casadi::MX> **>(0));
    if (_v) {
      return _wrap_GenericMatrixCommon_cse__SWIG_0(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericMatrixCommon_cse'."
    "  Possible prototypes are:\n"
    "    CSE(DM)\n"
    "    CSE({DM})\n"
    "    CSE({SX})\n"
    "    CSE(SX)\n"
    "    CSE(MX)\n"
    "    CSE({MX})\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_new_GenericMatrixCommon__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  casadi::GenericMatrixCommon *result = 0 ;
  
  if (!SWIG_check_num_args("new_GenericMatrixCommon",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    result = (casadi::GenericMatrixCommon *)new casadi::GenericMatrixCommon();
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__GenericMatrixCommon, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_GenericMatrixCommon'."
      "  Prototype:\n"
      "    GENERICMATRIXCOMMON()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_GenericMatrixCommon__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrixCommon *arg1 = 0 ;
  void *argp1 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::GenericMatrixCommon *result = 0 ;
  
  if (!SWIG_check_num_args("new_GenericMatrixCommon",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_casadi__GenericMatrixCommon,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_GenericMatrixCommon" "', argument " "1"" of type '" "casadi::GenericMatrixCommon const &""'"); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_GenericMatrixCommon" "', argument " "1"" of type '" "casadi::GenericMatrixCommon const &""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrixCommon * >(argp1);
  {
    result = (casadi::GenericMatrixCommon *)new casadi::GenericMatrixCommon((casadi::GenericMatrixCommon const &)*arg1);
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__GenericMatrixCommon, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_GenericMatrixCommon'."
      "  Prototype:\n"
      "    GENERICMATRIXCOMMON(GenericMatrixCommon)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_GenericMatrixCommon(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 0) {
    return _wrap_new_GenericMatrixCommon__SWIG_0(resc,resv,argc,argv);
  }
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__GenericMatrixCommon, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_new_GenericMatrixCommon__SWIG_1(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_GenericMatrixCommon'."
    "  Possible prototypes are:\n"
    "    GENERICMATRIXCOMMON()\n"
    "    GENERICMATRIXCOMMON(GenericMatrixCommon)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_delete_GenericMatrixCommon(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrixCommon *arg1 = (casadi::GenericMatrixCommon *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  int is_owned;
  if (!SWIG_check_num_args("delete_GenericMatrixCommon",argc,1,1,0)) {
    SWIG_fail;
  }
  is_owned = SWIG_Matlab_isOwned(argv[0]);
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixCommon, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GenericMatrixCommon" "', argument " "1"" of type '" "casadi::GenericMatrixCommon *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrixCommon * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  if (is_owned) {
    {
      delete arg1;
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'delete_GenericMatrixCommon'."
      "  Prototype:\n"
      "    GENERICMATRIXCOMMON(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_index_interp1d(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< double,std::allocator< double > > *arg1 = 0 ;
  double arg2 ;
  bool arg3 = (bool) false ;
  std::vector< double > m1 ;
  mxArray * _out;
  double result;
  
  if (!SWIG_check_num_args("index_interp1d",argc,3,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "[" "double" "]" "'.");
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "double" "'.");
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  }
  {
    try {
      result = (double)casadi::index_interp1d((std::vector< double,std::allocator< double > > const &)*arg1,arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "double" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'index_interp1d'."
      "  Prototype:\n"
      "    INDEX_INTERP1D([double],double,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenDM_nnz(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::Matrix< double > > *arg1 = (casadi::GenericMatrix< casadi::Matrix< double > > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("GenDM_nnz",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_double_t_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenDM_nnz" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::Matrix< double > > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::Matrix< double > > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::GenericMatrix< casadi::Matrix< double > > const *)arg1)->nnz();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenDM_nnz'."
      "  Prototype:\n"
      "    NNZ(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenDM_nnz_lower(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::Matrix< double > > *arg1 = (casadi::GenericMatrix< casadi::Matrix< double > > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("GenDM_nnz_lower",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_double_t_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenDM_nnz_lower" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::Matrix< double > > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::Matrix< double > > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::GenericMatrix< casadi::Matrix< double > > const *)arg1)->nnz_lower();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenDM_nnz_lower'."
      "  Prototype:\n"
      "    NNZ_LOWER(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenDM_nnz_upper(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::Matrix< double > > *arg1 = (casadi::GenericMatrix< casadi::Matrix< double > > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("GenDM_nnz_upper",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_double_t_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenDM_nnz_upper" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::Matrix< double > > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::Matrix< double > > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::GenericMatrix< casadi::Matrix< double > > const *)arg1)->nnz_upper();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenDM_nnz_upper'."
      "  Prototype:\n"
      "    NNZ_UPPER(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenDM_nnz_diag(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::Matrix< double > > *arg1 = (casadi::GenericMatrix< casadi::Matrix< double > > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("GenDM_nnz_diag",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_double_t_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenDM_nnz_diag" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::Matrix< double > > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::Matrix< double > > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::GenericMatrix< casadi::Matrix< double > > const *)arg1)->nnz_diag();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenDM_nnz_diag'."
      "  Prototype:\n"
      "    NNZ_DIAG(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenDM_numel(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::Matrix< double > > *arg1 = (casadi::GenericMatrix< casadi::Matrix< double > > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("GenDM_numel",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_double_t_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenDM_numel" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::Matrix< double > > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::Matrix< double > > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::GenericMatrix< casadi::Matrix< double > > const *)arg1)->numel();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenDM_numel'."
      "  Prototype:\n"
      "    NUMEL(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenDM_size1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::Matrix< double > > *arg1 = (casadi::GenericMatrix< casadi::Matrix< double > > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("GenDM_size1",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_double_t_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenDM_size1" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::Matrix< double > > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::Matrix< double > > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::GenericMatrix< casadi::Matrix< double > > const *)arg1)->size1();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenDM_size1'."
      "  Prototype:\n"
      "    SIZE1(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenDM_rows(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::Matrix< double > > *arg1 = (casadi::GenericMatrix< casadi::Matrix< double > > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("GenDM_rows",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_double_t_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenDM_rows" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::Matrix< double > > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::Matrix< double > > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::GenericMatrix< casadi::Matrix< double > > const *)arg1)->rows();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenDM_rows'."
      "  Prototype:\n"
      "    ROWS(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenDM_size2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::Matrix< double > > *arg1 = (casadi::GenericMatrix< casadi::Matrix< double > > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("GenDM_size2",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_double_t_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenDM_size2" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::Matrix< double > > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::Matrix< double > > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::GenericMatrix< casadi::Matrix< double > > const *)arg1)->size2();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenDM_size2'."
      "  Prototype:\n"
      "    SIZE2(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenDM_columns(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::Matrix< double > > *arg1 = (casadi::GenericMatrix< casadi::Matrix< double > > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("GenDM_columns",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_double_t_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenDM_columns" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::Matrix< double > > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::Matrix< double > > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::GenericMatrix< casadi::Matrix< double > > const *)arg1)->columns();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenDM_columns'."
      "  Prototype:\n"
      "    COLUMNS(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenDM_dim(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::Matrix< double > > *arg1 = (casadi::GenericMatrix< casadi::Matrix< double > > *) 0 ;
  bool arg2 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("GenDM_dim",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_double_t_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenDM_dim" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::Matrix< double > > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::Matrix< double > > * >(argp1);
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::GenericMatrix< casadi::Matrix< double > > const *)arg1)->dim(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenDM_dim'."
      "  Prototype:\n"
      "    DIM(self,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenDM_size__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::Matrix< double > > *arg1 = (casadi::GenericMatrix< casadi::Matrix< double > > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::pair< casadi_int,casadi_int > result;
  
  if (!SWIG_check_num_args("GenDM_size",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_double_t_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenDM_size" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::Matrix< double > > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::Matrix< double > > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::GenericMatrix< casadi::Matrix< double > > const *)arg1)->size();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[int,int]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenDM_size'."
      "  Prototype:\n"
      "    SIZE(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenDM_size__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::Matrix< double > > *arg1 = (casadi::GenericMatrix< casadi::Matrix< double > > *) 0 ;
  casadi_int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("GenDM_size",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_double_t_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenDM_size" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::Matrix< double > > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::Matrix< double > > * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::GenericMatrix< casadi::Matrix< double > > const *)arg1)->size(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenDM_size'."
      "  Prototype:\n"
      "    SIZE(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenDM_size(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_double_t_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_GenDM_size__SWIG_0(resc,resv,argc,argv);
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_double_t_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_GenDM_size__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenDM_size'."
    "  Possible prototypes are:\n"
    "    SIZE(self)\n"
    "    SIZE(self,int)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenDM_is_empty(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::Matrix< double > > *arg1 = (casadi::GenericMatrix< casadi::Matrix< double > > *) 0 ;
  bool arg2 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("GenDM_is_empty",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_double_t_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenDM_is_empty" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::Matrix< double > > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::Matrix< double > > * >(argp1);
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::GenericMatrix< casadi::Matrix< double > > const *)arg1)->is_empty(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenDM_is_empty'."
      "  Prototype:\n"
      "    IS_EMPTY(self,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenDM_is_dense(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::Matrix< double > > *arg1 = (casadi::GenericMatrix< casadi::Matrix< double > > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("GenDM_is_dense",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_double_t_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenDM_is_dense" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::Matrix< double > > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::Matrix< double > > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::GenericMatrix< casadi::Matrix< double > > const *)arg1)->is_dense();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenDM_is_dense'."
      "  Prototype:\n"
      "    IS_DENSE(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenDM_is_scalar(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::Matrix< double > > *arg1 = (casadi::GenericMatrix< casadi::Matrix< double > > *) 0 ;
  bool arg2 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("GenDM_is_scalar",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_double_t_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenDM_is_scalar" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::Matrix< double > > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::Matrix< double > > * >(argp1);
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::GenericMatrix< casadi::Matrix< double > > const *)arg1)->is_scalar(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenDM_is_scalar'."
      "  Prototype:\n"
      "    IS_SCALAR(self,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenDM_is_square(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::Matrix< double > > *arg1 = (casadi::GenericMatrix< casadi::Matrix< double > > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("GenDM_is_square",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_double_t_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenDM_is_square" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::Matrix< double > > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::Matrix< double > > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::GenericMatrix< casadi::Matrix< double > > const *)arg1)->is_square();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenDM_is_square'."
      "  Prototype:\n"
      "    IS_SQUARE(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenDM_is_vector(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::Matrix< double > > *arg1 = (casadi::GenericMatrix< casadi::Matrix< double > > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("GenDM_is_vector",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_double_t_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenDM_is_vector" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::Matrix< double > > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::Matrix< double > > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::GenericMatrix< casadi::Matrix< double > > const *)arg1)->is_vector();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenDM_is_vector'."
      "  Prototype:\n"
      "    IS_VECTOR(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenDM_is_row(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::Matrix< double > > *arg1 = (casadi::GenericMatrix< casadi::Matrix< double > > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("GenDM_is_row",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_double_t_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenDM_is_row" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::Matrix< double > > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::Matrix< double > > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::GenericMatrix< casadi::Matrix< double > > const *)arg1)->is_row();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenDM_is_row'."
      "  Prototype:\n"
      "    IS_ROW(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenDM_is_column(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::Matrix< double > > *arg1 = (casadi::GenericMatrix< casadi::Matrix< double > > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("GenDM_is_column",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_double_t_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenDM_is_column" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::Matrix< double > > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::Matrix< double > > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::GenericMatrix< casadi::Matrix< double > > const *)arg1)->is_column();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenDM_is_column'."
      "  Prototype:\n"
      "    IS_COLUMN(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenDM_is_triu(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::Matrix< double > > *arg1 = (casadi::GenericMatrix< casadi::Matrix< double > > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("GenDM_is_triu",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_double_t_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenDM_is_triu" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::Matrix< double > > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::Matrix< double > > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::GenericMatrix< casadi::Matrix< double > > const *)arg1)->is_triu();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenDM_is_triu'."
      "  Prototype:\n"
      "    IS_TRIU(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenDM_is_tril(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::Matrix< double > > *arg1 = (casadi::GenericMatrix< casadi::Matrix< double > > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("GenDM_is_tril",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_double_t_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenDM_is_tril" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::Matrix< double > > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::Matrix< double > > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::GenericMatrix< casadi::Matrix< double > > const *)arg1)->is_tril();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenDM_is_tril'."
      "  Prototype:\n"
      "    IS_TRIL(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenDM_row__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::Matrix< double > > *arg1 = (casadi::GenericMatrix< casadi::Matrix< double > > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi_int,std::allocator< casadi_int > > result;
  
  if (!SWIG_check_num_args("GenDM_row",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_double_t_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenDM_row" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::Matrix< double > > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::Matrix< double > > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::GenericMatrix< casadi::Matrix< double > > const *)arg1)->get_row();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[" "int" "]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenDM_row'."
      "  Prototype:\n"
      "    ROW(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenDM_colind__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::Matrix< double > > *arg1 = (casadi::GenericMatrix< casadi::Matrix< double > > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi_int,std::allocator< casadi_int > > result;
  
  if (!SWIG_check_num_args("GenDM_colind",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_double_t_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenDM_colind" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::Matrix< double > > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::Matrix< double > > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::GenericMatrix< casadi::Matrix< double > > const *)arg1)->get_colind();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[" "int" "]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenDM_colind'."
      "  Prototype:\n"
      "    COLIND(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenDM_row__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::Matrix< double > > *arg1 = (casadi::GenericMatrix< casadi::Matrix< double > > *) 0 ;
  casadi_int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("GenDM_row",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_double_t_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenDM_row" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::Matrix< double > > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::Matrix< double > > * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::GenericMatrix< casadi::Matrix< double > > const *)arg1)->row(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenDM_row'."
      "  Prototype:\n"
      "    ROW(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenDM_row(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_double_t_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_GenDM_row__SWIG_0(resc,resv,argc,argv);
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_double_t_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_GenDM_row__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenDM_row'."
    "  Possible prototypes are:\n"
    "    ROW(self)\n"
    "    ROW(self,int)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenDM_colind__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::Matrix< double > > *arg1 = (casadi::GenericMatrix< casadi::Matrix< double > > *) 0 ;
  casadi_int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("GenDM_colind",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_double_t_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenDM_colind" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::Matrix< double > > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::Matrix< double > > * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::GenericMatrix< casadi::Matrix< double > > const *)arg1)->colind(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenDM_colind'."
      "  Prototype:\n"
      "    COLIND(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenDM_colind(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_double_t_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_GenDM_colind__SWIG_0(resc,resv,argc,argv);
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_double_t_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_GenDM_colind__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenDM_colind'."
    "  Possible prototypes are:\n"
    "    COLIND(self)\n"
    "    COLIND(self,int)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenDM_sparsity(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::Matrix< double > > *arg1 = (casadi::GenericMatrix< casadi::Matrix< double > > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("GenDM_sparsity",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_double_t_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenDM_sparsity" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::Matrix< double > > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::Matrix< double > > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::GenericMatrix< casadi::Matrix< double > > const *)arg1)->sparsity();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenDM_sparsity'."
      "  Prototype:\n"
      "    SPARSITY(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenDM_sym__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  casadi_int arg2 = (casadi_int) 1 ;
  casadi_int arg3 = (casadi_int) 1 ;
  std::string m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenDM_sym",argc,3,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  }
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  }
  {
    try {
      result = casadi::GenericMatrix< casadi::Matrix< double > >::SWIGTEMPLATEDISAMBIGUATOR sym((std::string const &)*arg1,arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenDM_sym'."
      "  Prototype:\n"
      "    SYM(char,int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenDM_sym__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::pair< casadi_int,casadi_int > *arg2 = 0 ;
  std::string m1 ;
  std::pair< casadi_int,casadi_int > m2 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenDM_sym",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "[int,int]" "'.");
  {
    try {
      result = casadi::GenericMatrix< casadi::Matrix< double > >::SWIGTEMPLATEDISAMBIGUATOR sym((std::string const &)*arg1,(std::pair< long long,long long > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenDM_sym'."
      "  Prototype:\n"
      "    SYM(char,[int,int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenDM_sym__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  casadi::Sparsity *arg2 = 0 ;
  std::string m1 ;
  casadi::Sparsity m2 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenDM_sym",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "Sparsity" "'.");
  {
    try {
      result = casadi::GenericMatrix< casadi::Matrix< double > >::SWIGTEMPLATEDISAMBIGUATOR sym((std::string const &)*arg1,(casadi::Sparsity const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenDM_sym'."
      "  Prototype:\n"
      "    SYM(char,Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenDM_sym__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  casadi::Sparsity *arg2 = 0 ;
  casadi_int arg3 ;
  std::string m1 ;
  casadi::Sparsity m2 ;
  mxArray * _out;
  std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > result;
  
  if (!SWIG_check_num_args("GenDM_sym",argc,3,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "Sparsity" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  {
    try {
      result = casadi::GenericMatrix< casadi::Matrix< double > >::SWIGTEMPLATEDISAMBIGUATOR sym((std::string const &)*arg1,(casadi::Sparsity const &)*arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "DM" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenDM_sym'."
      "  Prototype:\n"
      "    SYM(char,Sparsity,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenDM_sym__SWIG_4(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  casadi_int arg2 ;
  casadi_int arg3 ;
  casadi_int arg4 ;
  std::string m1 ;
  mxArray * _out;
  std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > result;
  
  if (!SWIG_check_num_args("GenDM_sym",argc,4,4,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  if (!casadi::to_val(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "int" "'.");
  {
    try {
      result = casadi::GenericMatrix< casadi::Matrix< double > >::SWIGTEMPLATEDISAMBIGUATOR sym((std::string const &)*arg1,arg2,arg3,arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "DM" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenDM_sym'."
      "  Prototype:\n"
      "    SYM(char,int,int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenDM_sym__SWIG_5(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  casadi::Sparsity *arg2 = 0 ;
  casadi_int arg3 ;
  casadi_int arg4 ;
  std::string m1 ;
  casadi::Sparsity m2 ;
  mxArray * _out;
  std::vector< std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > >,std::allocator< std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > > > result;
  
  if (!SWIG_check_num_args("GenDM_sym",argc,4,4,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "Sparsity" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  if (!casadi::to_val(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "int" "'.");
  {
    try {
      result = casadi::GenericMatrix< casadi::Matrix< double > >::SWIGTEMPLATEDISAMBIGUATOR sym((std::string const &)*arg1,(casadi::Sparsity const &)*arg2,arg3,arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "{" "DM" "}" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenDM_sym'."
      "  Prototype:\n"
      "    SYM(char,Sparsity,int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenDM_sym__SWIG_6(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  casadi_int arg2 ;
  casadi_int arg3 ;
  casadi_int arg4 ;
  casadi_int arg5 ;
  std::string m1 ;
  mxArray * _out;
  std::vector< std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > >,std::allocator< std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > > > result;
  
  if (!SWIG_check_num_args("GenDM_sym",argc,5,5,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  if (!casadi::to_val(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "int" "'.");
  if (!casadi::to_val(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "int" "'.");
  {
    try {
      result = casadi::GenericMatrix< casadi::Matrix< double > >::SWIGTEMPLATEDISAMBIGUATOR sym((std::string const &)*arg1,arg2,arg3,arg4,arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "{" "DM" "}" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenDM_sym'."
      "  Prototype:\n"
      "    SYM(char,int,int,int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenDM_sym(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 1) && (argc <= 3)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::string **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_GenDM_sym__SWIG_0(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_GenDM_sym__SWIG_0(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          return _wrap_GenDM_sym__SWIG_0(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::string **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::pair<casadi_int,casadi_int> **>(0));
      if (_v) {
        return _wrap_GenDM_sym__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::string **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Sparsity **>(0));
      if (_v) {
        return _wrap_GenDM_sym__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 3) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::string **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Sparsity **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          return _wrap_GenDM_sym__SWIG_3(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::string **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi_int **>(0));
          if (_v) {
            return _wrap_GenDM_sym__SWIG_4(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::string **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Sparsity **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi_int **>(0));
          if (_v) {
            return _wrap_GenDM_sym__SWIG_5(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if (argc == 5) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::string **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi_int **>(0));
          if (_v) {
            _v = casadi::to_ptr(argv[4], static_cast< casadi_int **>(0));
            if (_v) {
              return _wrap_GenDM_sym__SWIG_6(resc,resv,argc,argv);
            }
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenDM_sym'."
    "  Possible prototypes are:\n"
    "    SYM(char,int,int)\n"
    "    SYM(char,[int,int])\n"
    "    SYM(char,Sparsity)\n"
    "    SYM(char,Sparsity,int)\n"
    "    SYM(char,int,int,int)\n"
    "    SYM(char,Sparsity,int,int)\n"
    "    SYM(char,int,int,int,int)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenDM_zeros__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 = (casadi_int) 1 ;
  casadi_int arg2 = (casadi_int) 1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenDM_zeros",argc,2,0,0)) {
    SWIG_fail;
  }
  if (0<argc) {
    if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  }
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  }
  {
    try {
      result = casadi::GenericMatrix< casadi::Matrix< double > >::SWIGTEMPLATEDISAMBIGUATOR zeros(arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenDM_zeros'."
      "  Prototype:\n"
      "    ZEROS(int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenDM_zeros__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = 0 ;
  casadi::Sparsity m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenDM_zeros",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Sparsity" "'.");
  {
    try {
      result = casadi::GenericMatrix< casadi::Matrix< double > >::SWIGTEMPLATEDISAMBIGUATOR zeros((casadi::Sparsity const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenDM_zeros'."
      "  Prototype:\n"
      "    ZEROS(Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenDM_zeros__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::pair< casadi_int,casadi_int > *arg1 = 0 ;
  std::pair< casadi_int,casadi_int > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenDM_zeros",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "[int,int]" "'.");
  {
    try {
      result = casadi::GenericMatrix< casadi::Matrix< double > >::SWIGTEMPLATEDISAMBIGUATOR zeros((std::pair< long long,long long > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenDM_zeros'."
      "  Prototype:\n"
      "    ZEROS([int,int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenDM_zeros(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 0) && (argc <= 2)) {
    int _v;
    if (argc <= 0) {
      return _wrap_GenDM_zeros__SWIG_0(resc,resv,argc,argv);
    }
    _v = casadi::to_ptr(argv[0], static_cast< casadi_int **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_GenDM_zeros__SWIG_0(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_GenDM_zeros__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::pair<casadi_int,casadi_int> **>(0));
    if (_v) {
      return _wrap_GenDM_zeros__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Sparsity **>(0));
    if (_v) {
      return _wrap_GenDM_zeros__SWIG_1(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenDM_zeros'."
    "  Possible prototypes are:\n"
    "    ZEROS(int,int)\n"
    "    ZEROS([int,int])\n"
    "    ZEROS(Sparsity)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenDM_ones__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 = (casadi_int) 1 ;
  casadi_int arg2 = (casadi_int) 1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenDM_ones",argc,2,0,0)) {
    SWIG_fail;
  }
  if (0<argc) {
    if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  }
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  }
  {
    try {
      result = casadi::GenericMatrix< casadi::Matrix< double > >::SWIGTEMPLATEDISAMBIGUATOR ones(arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenDM_ones'."
      "  Prototype:\n"
      "    ONES(int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenDM_ones__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = 0 ;
  casadi::Sparsity m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenDM_ones",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Sparsity" "'.");
  {
    try {
      result = casadi::GenericMatrix< casadi::Matrix< double > >::SWIGTEMPLATEDISAMBIGUATOR ones((casadi::Sparsity const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenDM_ones'."
      "  Prototype:\n"
      "    ONES(Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenDM_ones__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::pair< casadi_int,casadi_int > *arg1 = 0 ;
  std::pair< casadi_int,casadi_int > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenDM_ones",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "[int,int]" "'.");
  {
    try {
      result = casadi::GenericMatrix< casadi::Matrix< double > >::SWIGTEMPLATEDISAMBIGUATOR ones((std::pair< long long,long long > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenDM_ones'."
      "  Prototype:\n"
      "    ONES([int,int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenDM_ones(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 0) && (argc <= 2)) {
    int _v;
    if (argc <= 0) {
      return _wrap_GenDM_ones__SWIG_0(resc,resv,argc,argv);
    }
    _v = casadi::to_ptr(argv[0], static_cast< casadi_int **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_GenDM_ones__SWIG_0(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_GenDM_ones__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::pair<casadi_int,casadi_int> **>(0));
    if (_v) {
      return _wrap_GenDM_ones__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Sparsity **>(0));
    if (_v) {
      return _wrap_GenDM_ones__SWIG_1(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenDM_ones'."
    "  Possible prototypes are:\n"
    "    ONES(int,int)\n"
    "    ONES([int,int])\n"
    "    ONES(Sparsity)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_new_GenDM__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  casadi::GenericMatrix< casadi::Matrix< double > > *result = 0 ;
  
  if (!SWIG_check_num_args("new_GenDM",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    result = (casadi::GenericMatrix< casadi::Matrix< double > > *)new casadi::GenericMatrix< casadi::Matrix< double > >();
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_double_t_t, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_GenDM'."
      "  Prototype:\n"
      "    GENDM()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_GenDM__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::Matrix< double > > *arg1 = 0 ;
  void *argp1 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::GenericMatrix< casadi::Matrix< double > > *result = 0 ;
  
  if (!SWIG_check_num_args("new_GenDM",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_double_t_t,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_GenDM" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::Matrix< double > > const &""'"); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_GenDM" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::Matrix< double > > const &""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::Matrix< double > > * >(argp1);
  {
    result = (casadi::GenericMatrix< casadi::Matrix< double > > *)new casadi::GenericMatrix< casadi::Matrix< double > >((casadi::GenericMatrix< casadi::Matrix< double > > const &)*arg1);
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_double_t_t, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_GenDM'."
      "  Prototype:\n"
      "    GENDM(GenDM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_GenDM(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 0) {
    return _wrap_new_GenDM__SWIG_0(resc,resv,argc,argv);
  }
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_double_t_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_new_GenDM__SWIG_1(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_GenDM'."
    "  Possible prototypes are:\n"
    "    GENDM()\n"
    "    GENDM(GenDM)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_delete_GenDM(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::Matrix< double > > *arg1 = (casadi::GenericMatrix< casadi::Matrix< double > > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  int is_owned;
  if (!SWIG_check_num_args("delete_GenDM",argc,1,1,0)) {
    SWIG_fail;
  }
  is_owned = SWIG_Matlab_isOwned(argv[0]);
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_double_t_t, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GenDM" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::Matrix< double > > *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::Matrix< double > > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  if (is_owned) {
    {
      delete arg1;
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'delete_GenDM'."
      "  Prototype:\n"
      "    GENDM(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenSX_nnz(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > *arg1 = (casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("GenSX_nnz",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_casadi__SXElem_t_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenSX_nnz" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > const *)arg1)->nnz();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenSX_nnz'."
      "  Prototype:\n"
      "    NNZ(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenSX_nnz_lower(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > *arg1 = (casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("GenSX_nnz_lower",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_casadi__SXElem_t_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenSX_nnz_lower" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > const *)arg1)->nnz_lower();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenSX_nnz_lower'."
      "  Prototype:\n"
      "    NNZ_LOWER(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenSX_nnz_upper(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > *arg1 = (casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("GenSX_nnz_upper",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_casadi__SXElem_t_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenSX_nnz_upper" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > const *)arg1)->nnz_upper();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenSX_nnz_upper'."
      "  Prototype:\n"
      "    NNZ_UPPER(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenSX_nnz_diag(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > *arg1 = (casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("GenSX_nnz_diag",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_casadi__SXElem_t_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenSX_nnz_diag" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > const *)arg1)->nnz_diag();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenSX_nnz_diag'."
      "  Prototype:\n"
      "    NNZ_DIAG(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenSX_numel(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > *arg1 = (casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("GenSX_numel",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_casadi__SXElem_t_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenSX_numel" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > const *)arg1)->numel();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenSX_numel'."
      "  Prototype:\n"
      "    NUMEL(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenSX_size1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > *arg1 = (casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("GenSX_size1",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_casadi__SXElem_t_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenSX_size1" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > const *)arg1)->size1();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenSX_size1'."
      "  Prototype:\n"
      "    SIZE1(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenSX_rows(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > *arg1 = (casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("GenSX_rows",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_casadi__SXElem_t_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenSX_rows" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > const *)arg1)->rows();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenSX_rows'."
      "  Prototype:\n"
      "    ROWS(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenSX_size2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > *arg1 = (casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("GenSX_size2",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_casadi__SXElem_t_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenSX_size2" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > const *)arg1)->size2();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenSX_size2'."
      "  Prototype:\n"
      "    SIZE2(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenSX_columns(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > *arg1 = (casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("GenSX_columns",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_casadi__SXElem_t_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenSX_columns" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > const *)arg1)->columns();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenSX_columns'."
      "  Prototype:\n"
      "    COLUMNS(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenSX_dim(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > *arg1 = (casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > *) 0 ;
  bool arg2 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("GenSX_dim",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_casadi__SXElem_t_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenSX_dim" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > * >(argp1);
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > const *)arg1)->dim(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenSX_dim'."
      "  Prototype:\n"
      "    DIM(self,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenSX_size__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > *arg1 = (casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::pair< casadi_int,casadi_int > result;
  
  if (!SWIG_check_num_args("GenSX_size",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_casadi__SXElem_t_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenSX_size" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > const *)arg1)->size();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[int,int]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenSX_size'."
      "  Prototype:\n"
      "    SIZE(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenSX_size__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > *arg1 = (casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > *) 0 ;
  casadi_int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("GenSX_size",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_casadi__SXElem_t_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenSX_size" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > const *)arg1)->size(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenSX_size'."
      "  Prototype:\n"
      "    SIZE(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenSX_size(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_casadi__SXElem_t_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_GenSX_size__SWIG_0(resc,resv,argc,argv);
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_casadi__SXElem_t_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_GenSX_size__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenSX_size'."
    "  Possible prototypes are:\n"
    "    SIZE(self)\n"
    "    SIZE(self,int)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenSX_is_empty(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > *arg1 = (casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > *) 0 ;
  bool arg2 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("GenSX_is_empty",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_casadi__SXElem_t_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenSX_is_empty" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > * >(argp1);
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > const *)arg1)->is_empty(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenSX_is_empty'."
      "  Prototype:\n"
      "    IS_EMPTY(self,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenSX_is_dense(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > *arg1 = (casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("GenSX_is_dense",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_casadi__SXElem_t_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenSX_is_dense" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > const *)arg1)->is_dense();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenSX_is_dense'."
      "  Prototype:\n"
      "    IS_DENSE(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenSX_is_scalar(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > *arg1 = (casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > *) 0 ;
  bool arg2 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("GenSX_is_scalar",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_casadi__SXElem_t_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenSX_is_scalar" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > * >(argp1);
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > const *)arg1)->is_scalar(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenSX_is_scalar'."
      "  Prototype:\n"
      "    IS_SCALAR(self,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenSX_is_square(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > *arg1 = (casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("GenSX_is_square",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_casadi__SXElem_t_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenSX_is_square" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > const *)arg1)->is_square();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenSX_is_square'."
      "  Prototype:\n"
      "    IS_SQUARE(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenSX_is_vector(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > *arg1 = (casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("GenSX_is_vector",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_casadi__SXElem_t_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenSX_is_vector" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > const *)arg1)->is_vector();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenSX_is_vector'."
      "  Prototype:\n"
      "    IS_VECTOR(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenSX_is_row(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > *arg1 = (casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("GenSX_is_row",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_casadi__SXElem_t_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenSX_is_row" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > const *)arg1)->is_row();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenSX_is_row'."
      "  Prototype:\n"
      "    IS_ROW(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenSX_is_column(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > *arg1 = (casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("GenSX_is_column",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_casadi__SXElem_t_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenSX_is_column" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > const *)arg1)->is_column();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenSX_is_column'."
      "  Prototype:\n"
      "    IS_COLUMN(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenSX_is_triu(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > *arg1 = (casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("GenSX_is_triu",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_casadi__SXElem_t_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenSX_is_triu" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > const *)arg1)->is_triu();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenSX_is_triu'."
      "  Prototype:\n"
      "    IS_TRIU(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenSX_is_tril(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > *arg1 = (casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("GenSX_is_tril",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_casadi__SXElem_t_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenSX_is_tril" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > const *)arg1)->is_tril();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenSX_is_tril'."
      "  Prototype:\n"
      "    IS_TRIL(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenSX_row__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > *arg1 = (casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi_int,std::allocator< casadi_int > > result;
  
  if (!SWIG_check_num_args("GenSX_row",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_casadi__SXElem_t_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenSX_row" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > const *)arg1)->get_row();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[" "int" "]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenSX_row'."
      "  Prototype:\n"
      "    ROW(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenSX_colind__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > *arg1 = (casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi_int,std::allocator< casadi_int > > result;
  
  if (!SWIG_check_num_args("GenSX_colind",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_casadi__SXElem_t_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenSX_colind" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > const *)arg1)->get_colind();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[" "int" "]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenSX_colind'."
      "  Prototype:\n"
      "    COLIND(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenSX_row__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > *arg1 = (casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > *) 0 ;
  casadi_int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("GenSX_row",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_casadi__SXElem_t_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenSX_row" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > const *)arg1)->row(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenSX_row'."
      "  Prototype:\n"
      "    ROW(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenSX_row(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_casadi__SXElem_t_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_GenSX_row__SWIG_0(resc,resv,argc,argv);
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_casadi__SXElem_t_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_GenSX_row__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenSX_row'."
    "  Possible prototypes are:\n"
    "    ROW(self)\n"
    "    ROW(self,int)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenSX_colind__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > *arg1 = (casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > *) 0 ;
  casadi_int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("GenSX_colind",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_casadi__SXElem_t_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenSX_colind" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > const *)arg1)->colind(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenSX_colind'."
      "  Prototype:\n"
      "    COLIND(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenSX_colind(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_casadi__SXElem_t_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_GenSX_colind__SWIG_0(resc,resv,argc,argv);
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_casadi__SXElem_t_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_GenSX_colind__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenSX_colind'."
    "  Possible prototypes are:\n"
    "    COLIND(self)\n"
    "    COLIND(self,int)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenSX_sparsity(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > *arg1 = (casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("GenSX_sparsity",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_casadi__SXElem_t_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenSX_sparsity" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > const *)arg1)->sparsity();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenSX_sparsity'."
      "  Prototype:\n"
      "    SPARSITY(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenSX_sym__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  casadi_int arg2 = (casadi_int) 1 ;
  casadi_int arg3 = (casadi_int) 1 ;
  std::string m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenSX_sym",argc,3,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  }
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  }
  {
    try {
      result = casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > >::SWIGTEMPLATEDISAMBIGUATOR sym((std::string const &)*arg1,arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenSX_sym'."
      "  Prototype:\n"
      "    SYM(char,int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenSX_sym__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::pair< casadi_int,casadi_int > *arg2 = 0 ;
  std::string m1 ;
  std::pair< casadi_int,casadi_int > m2 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenSX_sym",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "[int,int]" "'.");
  {
    try {
      result = casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > >::SWIGTEMPLATEDISAMBIGUATOR sym((std::string const &)*arg1,(std::pair< long long,long long > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenSX_sym'."
      "  Prototype:\n"
      "    SYM(char,[int,int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenSX_sym__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  casadi::Sparsity *arg2 = 0 ;
  std::string m1 ;
  casadi::Sparsity m2 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenSX_sym",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "Sparsity" "'.");
  {
    try {
      result = casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > >::SWIGTEMPLATEDISAMBIGUATOR sym((std::string const &)*arg1,(casadi::Sparsity const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenSX_sym'."
      "  Prototype:\n"
      "    SYM(char,Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenSX_sym__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  casadi::Sparsity *arg2 = 0 ;
  casadi_int arg3 ;
  std::string m1 ;
  casadi::Sparsity m2 ;
  mxArray * _out;
  std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > result;
  
  if (!SWIG_check_num_args("GenSX_sym",argc,3,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "Sparsity" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  {
    try {
      result = casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > >::SWIGTEMPLATEDISAMBIGUATOR sym((std::string const &)*arg1,(casadi::Sparsity const &)*arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "SX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenSX_sym'."
      "  Prototype:\n"
      "    SYM(char,Sparsity,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenSX_sym__SWIG_4(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  casadi_int arg2 ;
  casadi_int arg3 ;
  casadi_int arg4 ;
  std::string m1 ;
  mxArray * _out;
  std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > result;
  
  if (!SWIG_check_num_args("GenSX_sym",argc,4,4,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  if (!casadi::to_val(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "int" "'.");
  {
    try {
      result = casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > >::SWIGTEMPLATEDISAMBIGUATOR sym((std::string const &)*arg1,arg2,arg3,arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "SX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenSX_sym'."
      "  Prototype:\n"
      "    SYM(char,int,int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenSX_sym__SWIG_5(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  casadi::Sparsity *arg2 = 0 ;
  casadi_int arg3 ;
  casadi_int arg4 ;
  std::string m1 ;
  casadi::Sparsity m2 ;
  mxArray * _out;
  std::vector< std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > >,std::allocator< std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > > > result;
  
  if (!SWIG_check_num_args("GenSX_sym",argc,4,4,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "Sparsity" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  if (!casadi::to_val(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "int" "'.");
  {
    try {
      result = casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > >::SWIGTEMPLATEDISAMBIGUATOR sym((std::string const &)*arg1,(casadi::Sparsity const &)*arg2,arg3,arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "{" "SX" "}" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenSX_sym'."
      "  Prototype:\n"
      "    SYM(char,Sparsity,int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenSX_sym__SWIG_6(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  casadi_int arg2 ;
  casadi_int arg3 ;
  casadi_int arg4 ;
  casadi_int arg5 ;
  std::string m1 ;
  mxArray * _out;
  std::vector< std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > >,std::allocator< std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > > > result;
  
  if (!SWIG_check_num_args("GenSX_sym",argc,5,5,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  if (!casadi::to_val(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "int" "'.");
  if (!casadi::to_val(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "int" "'.");
  {
    try {
      result = casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > >::SWIGTEMPLATEDISAMBIGUATOR sym((std::string const &)*arg1,arg2,arg3,arg4,arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "{" "SX" "}" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenSX_sym'."
      "  Prototype:\n"
      "    SYM(char,int,int,int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenSX_sym(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 1) && (argc <= 3)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::string **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_GenSX_sym__SWIG_0(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_GenSX_sym__SWIG_0(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          return _wrap_GenSX_sym__SWIG_0(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::string **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::pair<casadi_int,casadi_int> **>(0));
      if (_v) {
        return _wrap_GenSX_sym__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::string **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Sparsity **>(0));
      if (_v) {
        return _wrap_GenSX_sym__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 3) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::string **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Sparsity **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          return _wrap_GenSX_sym__SWIG_3(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::string **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi_int **>(0));
          if (_v) {
            return _wrap_GenSX_sym__SWIG_4(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::string **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Sparsity **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi_int **>(0));
          if (_v) {
            return _wrap_GenSX_sym__SWIG_5(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if (argc == 5) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::string **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi_int **>(0));
          if (_v) {
            _v = casadi::to_ptr(argv[4], static_cast< casadi_int **>(0));
            if (_v) {
              return _wrap_GenSX_sym__SWIG_6(resc,resv,argc,argv);
            }
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenSX_sym'."
    "  Possible prototypes are:\n"
    "    SYM(char,int,int)\n"
    "    SYM(char,[int,int])\n"
    "    SYM(char,Sparsity)\n"
    "    SYM(char,Sparsity,int)\n"
    "    SYM(char,int,int,int)\n"
    "    SYM(char,Sparsity,int,int)\n"
    "    SYM(char,int,int,int,int)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenSX_zeros__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 = (casadi_int) 1 ;
  casadi_int arg2 = (casadi_int) 1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenSX_zeros",argc,2,0,0)) {
    SWIG_fail;
  }
  if (0<argc) {
    if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  }
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  }
  {
    try {
      result = casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > >::SWIGTEMPLATEDISAMBIGUATOR zeros(arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenSX_zeros'."
      "  Prototype:\n"
      "    ZEROS(int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenSX_zeros__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = 0 ;
  casadi::Sparsity m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenSX_zeros",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Sparsity" "'.");
  {
    try {
      result = casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > >::SWIGTEMPLATEDISAMBIGUATOR zeros((casadi::Sparsity const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenSX_zeros'."
      "  Prototype:\n"
      "    ZEROS(Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenSX_zeros__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::pair< casadi_int,casadi_int > *arg1 = 0 ;
  std::pair< casadi_int,casadi_int > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenSX_zeros",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "[int,int]" "'.");
  {
    try {
      result = casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > >::SWIGTEMPLATEDISAMBIGUATOR zeros((std::pair< long long,long long > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenSX_zeros'."
      "  Prototype:\n"
      "    ZEROS([int,int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenSX_zeros(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 0) && (argc <= 2)) {
    int _v;
    if (argc <= 0) {
      return _wrap_GenSX_zeros__SWIG_0(resc,resv,argc,argv);
    }
    _v = casadi::to_ptr(argv[0], static_cast< casadi_int **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_GenSX_zeros__SWIG_0(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_GenSX_zeros__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::pair<casadi_int,casadi_int> **>(0));
    if (_v) {
      return _wrap_GenSX_zeros__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Sparsity **>(0));
    if (_v) {
      return _wrap_GenSX_zeros__SWIG_1(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenSX_zeros'."
    "  Possible prototypes are:\n"
    "    ZEROS(int,int)\n"
    "    ZEROS([int,int])\n"
    "    ZEROS(Sparsity)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenSX_ones__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 = (casadi_int) 1 ;
  casadi_int arg2 = (casadi_int) 1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenSX_ones",argc,2,0,0)) {
    SWIG_fail;
  }
  if (0<argc) {
    if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  }
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  }
  {
    try {
      result = casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > >::SWIGTEMPLATEDISAMBIGUATOR ones(arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenSX_ones'."
      "  Prototype:\n"
      "    ONES(int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenSX_ones__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = 0 ;
  casadi::Sparsity m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenSX_ones",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Sparsity" "'.");
  {
    try {
      result = casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > >::SWIGTEMPLATEDISAMBIGUATOR ones((casadi::Sparsity const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenSX_ones'."
      "  Prototype:\n"
      "    ONES(Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenSX_ones__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::pair< casadi_int,casadi_int > *arg1 = 0 ;
  std::pair< casadi_int,casadi_int > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenSX_ones",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "[int,int]" "'.");
  {
    try {
      result = casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > >::SWIGTEMPLATEDISAMBIGUATOR ones((std::pair< long long,long long > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenSX_ones'."
      "  Prototype:\n"
      "    ONES([int,int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenSX_ones(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 0) && (argc <= 2)) {
    int _v;
    if (argc <= 0) {
      return _wrap_GenSX_ones__SWIG_0(resc,resv,argc,argv);
    }
    _v = casadi::to_ptr(argv[0], static_cast< casadi_int **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_GenSX_ones__SWIG_0(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_GenSX_ones__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::pair<casadi_int,casadi_int> **>(0));
    if (_v) {
      return _wrap_GenSX_ones__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Sparsity **>(0));
    if (_v) {
      return _wrap_GenSX_ones__SWIG_1(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenSX_ones'."
    "  Possible prototypes are:\n"
    "    ONES(int,int)\n"
    "    ONES([int,int])\n"
    "    ONES(Sparsity)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_new_GenSX__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > *result = 0 ;
  
  if (!SWIG_check_num_args("new_GenSX",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    result = (casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > *)new casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > >();
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_casadi__SXElem_t_t, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_GenSX'."
      "  Prototype:\n"
      "    GENSX()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_GenSX__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > *arg1 = 0 ;
  void *argp1 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > *result = 0 ;
  
  if (!SWIG_check_num_args("new_GenSX",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_casadi__SXElem_t_t,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_GenSX" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > const &""'"); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_GenSX" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > const &""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > * >(argp1);
  {
    result = (casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > *)new casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > >((casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > const &)*arg1);
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_casadi__SXElem_t_t, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_GenSX'."
      "  Prototype:\n"
      "    GENSX(GenSX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_GenSX(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 0) {
    return _wrap_new_GenSX__SWIG_0(resc,resv,argc,argv);
  }
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_casadi__SXElem_t_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_new_GenSX__SWIG_1(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_GenSX'."
    "  Possible prototypes are:\n"
    "    GENSX()\n"
    "    GENSX(GenSX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_delete_GenSX(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > *arg1 = (casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  int is_owned;
  if (!SWIG_check_num_args("delete_GenSX",argc,1,1,0)) {
    SWIG_fail;
  }
  is_owned = SWIG_Matlab_isOwned(argv[0]);
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MatrixT_casadi__SXElem_t_t, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GenSX" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  if (is_owned) {
    {
      delete arg1;
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'delete_GenSX'."
      "  Prototype:\n"
      "    GENSX(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenMX_nnz(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::MX > *arg1 = (casadi::GenericMatrix< casadi::MX > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("GenMX_nnz",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MX_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenMX_nnz" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::MX > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::MX > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::GenericMatrix< casadi::MX > const *)arg1)->nnz();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenMX_nnz'."
      "  Prototype:\n"
      "    NNZ(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenMX_nnz_lower(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::MX > *arg1 = (casadi::GenericMatrix< casadi::MX > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("GenMX_nnz_lower",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MX_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenMX_nnz_lower" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::MX > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::MX > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::GenericMatrix< casadi::MX > const *)arg1)->nnz_lower();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenMX_nnz_lower'."
      "  Prototype:\n"
      "    NNZ_LOWER(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenMX_nnz_upper(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::MX > *arg1 = (casadi::GenericMatrix< casadi::MX > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("GenMX_nnz_upper",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MX_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenMX_nnz_upper" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::MX > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::MX > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::GenericMatrix< casadi::MX > const *)arg1)->nnz_upper();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenMX_nnz_upper'."
      "  Prototype:\n"
      "    NNZ_UPPER(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenMX_nnz_diag(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::MX > *arg1 = (casadi::GenericMatrix< casadi::MX > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("GenMX_nnz_diag",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MX_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenMX_nnz_diag" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::MX > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::MX > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::GenericMatrix< casadi::MX > const *)arg1)->nnz_diag();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenMX_nnz_diag'."
      "  Prototype:\n"
      "    NNZ_DIAG(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenMX_numel(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::MX > *arg1 = (casadi::GenericMatrix< casadi::MX > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("GenMX_numel",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MX_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenMX_numel" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::MX > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::MX > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::GenericMatrix< casadi::MX > const *)arg1)->numel();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenMX_numel'."
      "  Prototype:\n"
      "    NUMEL(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenMX_size1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::MX > *arg1 = (casadi::GenericMatrix< casadi::MX > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("GenMX_size1",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MX_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenMX_size1" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::MX > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::MX > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::GenericMatrix< casadi::MX > const *)arg1)->size1();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenMX_size1'."
      "  Prototype:\n"
      "    SIZE1(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenMX_rows(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::MX > *arg1 = (casadi::GenericMatrix< casadi::MX > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("GenMX_rows",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MX_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenMX_rows" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::MX > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::MX > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::GenericMatrix< casadi::MX > const *)arg1)->rows();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenMX_rows'."
      "  Prototype:\n"
      "    ROWS(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenMX_size2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::MX > *arg1 = (casadi::GenericMatrix< casadi::MX > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("GenMX_size2",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MX_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenMX_size2" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::MX > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::MX > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::GenericMatrix< casadi::MX > const *)arg1)->size2();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenMX_size2'."
      "  Prototype:\n"
      "    SIZE2(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenMX_columns(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::MX > *arg1 = (casadi::GenericMatrix< casadi::MX > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("GenMX_columns",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MX_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenMX_columns" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::MX > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::MX > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::GenericMatrix< casadi::MX > const *)arg1)->columns();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenMX_columns'."
      "  Prototype:\n"
      "    COLUMNS(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenMX_dim(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::MX > *arg1 = (casadi::GenericMatrix< casadi::MX > *) 0 ;
  bool arg2 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("GenMX_dim",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MX_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenMX_dim" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::MX > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::MX > * >(argp1);
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::GenericMatrix< casadi::MX > const *)arg1)->dim(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenMX_dim'."
      "  Prototype:\n"
      "    DIM(self,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenMX_size__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::MX > *arg1 = (casadi::GenericMatrix< casadi::MX > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::pair< casadi_int,casadi_int > result;
  
  if (!SWIG_check_num_args("GenMX_size",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MX_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenMX_size" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::MX > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::MX > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::GenericMatrix< casadi::MX > const *)arg1)->size();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[int,int]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenMX_size'."
      "  Prototype:\n"
      "    SIZE(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenMX_size__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::MX > *arg1 = (casadi::GenericMatrix< casadi::MX > *) 0 ;
  casadi_int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("GenMX_size",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MX_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenMX_size" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::MX > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::MX > * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::GenericMatrix< casadi::MX > const *)arg1)->size(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenMX_size'."
      "  Prototype:\n"
      "    SIZE(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenMX_size(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__GenericMatrixT_casadi__MX_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_GenMX_size__SWIG_0(resc,resv,argc,argv);
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__GenericMatrixT_casadi__MX_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_GenMX_size__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenMX_size'."
    "  Possible prototypes are:\n"
    "    SIZE(self)\n"
    "    SIZE(self,int)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenMX_is_empty(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::MX > *arg1 = (casadi::GenericMatrix< casadi::MX > *) 0 ;
  bool arg2 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("GenMX_is_empty",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MX_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenMX_is_empty" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::MX > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::MX > * >(argp1);
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::GenericMatrix< casadi::MX > const *)arg1)->is_empty(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenMX_is_empty'."
      "  Prototype:\n"
      "    IS_EMPTY(self,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenMX_is_dense(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::MX > *arg1 = (casadi::GenericMatrix< casadi::MX > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("GenMX_is_dense",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MX_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenMX_is_dense" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::MX > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::MX > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::GenericMatrix< casadi::MX > const *)arg1)->is_dense();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenMX_is_dense'."
      "  Prototype:\n"
      "    IS_DENSE(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenMX_is_scalar(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::MX > *arg1 = (casadi::GenericMatrix< casadi::MX > *) 0 ;
  bool arg2 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("GenMX_is_scalar",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MX_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenMX_is_scalar" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::MX > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::MX > * >(argp1);
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::GenericMatrix< casadi::MX > const *)arg1)->is_scalar(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenMX_is_scalar'."
      "  Prototype:\n"
      "    IS_SCALAR(self,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenMX_is_square(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::MX > *arg1 = (casadi::GenericMatrix< casadi::MX > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("GenMX_is_square",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MX_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenMX_is_square" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::MX > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::MX > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::GenericMatrix< casadi::MX > const *)arg1)->is_square();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenMX_is_square'."
      "  Prototype:\n"
      "    IS_SQUARE(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenMX_is_vector(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::MX > *arg1 = (casadi::GenericMatrix< casadi::MX > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("GenMX_is_vector",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MX_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenMX_is_vector" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::MX > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::MX > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::GenericMatrix< casadi::MX > const *)arg1)->is_vector();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenMX_is_vector'."
      "  Prototype:\n"
      "    IS_VECTOR(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenMX_is_row(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::MX > *arg1 = (casadi::GenericMatrix< casadi::MX > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("GenMX_is_row",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MX_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenMX_is_row" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::MX > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::MX > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::GenericMatrix< casadi::MX > const *)arg1)->is_row();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenMX_is_row'."
      "  Prototype:\n"
      "    IS_ROW(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenMX_is_column(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::MX > *arg1 = (casadi::GenericMatrix< casadi::MX > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("GenMX_is_column",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MX_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenMX_is_column" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::MX > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::MX > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::GenericMatrix< casadi::MX > const *)arg1)->is_column();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenMX_is_column'."
      "  Prototype:\n"
      "    IS_COLUMN(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenMX_is_triu(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::MX > *arg1 = (casadi::GenericMatrix< casadi::MX > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("GenMX_is_triu",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MX_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenMX_is_triu" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::MX > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::MX > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::GenericMatrix< casadi::MX > const *)arg1)->is_triu();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenMX_is_triu'."
      "  Prototype:\n"
      "    IS_TRIU(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenMX_is_tril(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::MX > *arg1 = (casadi::GenericMatrix< casadi::MX > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("GenMX_is_tril",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MX_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenMX_is_tril" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::MX > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::MX > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::GenericMatrix< casadi::MX > const *)arg1)->is_tril();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenMX_is_tril'."
      "  Prototype:\n"
      "    IS_TRIL(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenMX_row__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::MX > *arg1 = (casadi::GenericMatrix< casadi::MX > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi_int,std::allocator< casadi_int > > result;
  
  if (!SWIG_check_num_args("GenMX_row",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MX_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenMX_row" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::MX > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::MX > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::GenericMatrix< casadi::MX > const *)arg1)->get_row();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[" "int" "]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenMX_row'."
      "  Prototype:\n"
      "    ROW(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenMX_colind__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::MX > *arg1 = (casadi::GenericMatrix< casadi::MX > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi_int,std::allocator< casadi_int > > result;
  
  if (!SWIG_check_num_args("GenMX_colind",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MX_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenMX_colind" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::MX > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::MX > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::GenericMatrix< casadi::MX > const *)arg1)->get_colind();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[" "int" "]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenMX_colind'."
      "  Prototype:\n"
      "    COLIND(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenMX_row__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::MX > *arg1 = (casadi::GenericMatrix< casadi::MX > *) 0 ;
  casadi_int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("GenMX_row",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MX_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenMX_row" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::MX > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::MX > * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::GenericMatrix< casadi::MX > const *)arg1)->row(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenMX_row'."
      "  Prototype:\n"
      "    ROW(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenMX_row(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__GenericMatrixT_casadi__MX_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_GenMX_row__SWIG_0(resc,resv,argc,argv);
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__GenericMatrixT_casadi__MX_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_GenMX_row__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenMX_row'."
    "  Possible prototypes are:\n"
    "    ROW(self)\n"
    "    ROW(self,int)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenMX_colind__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::MX > *arg1 = (casadi::GenericMatrix< casadi::MX > *) 0 ;
  casadi_int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("GenMX_colind",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MX_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenMX_colind" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::MX > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::MX > * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::GenericMatrix< casadi::MX > const *)arg1)->colind(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenMX_colind'."
      "  Prototype:\n"
      "    COLIND(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenMX_colind(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__GenericMatrixT_casadi__MX_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_GenMX_colind__SWIG_0(resc,resv,argc,argv);
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__GenericMatrixT_casadi__MX_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_GenMX_colind__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenMX_colind'."
    "  Possible prototypes are:\n"
    "    COLIND(self)\n"
    "    COLIND(self,int)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenMX_sparsity(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::MX > *arg1 = (casadi::GenericMatrix< casadi::MX > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("GenMX_sparsity",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MX_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenMX_sparsity" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::MX > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::MX > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::GenericMatrix< casadi::MX > const *)arg1)->sparsity();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenMX_sparsity'."
      "  Prototype:\n"
      "    SPARSITY(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenMX_sym__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  casadi_int arg2 = (casadi_int) 1 ;
  casadi_int arg3 = (casadi_int) 1 ;
  std::string m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenMX_sym",argc,3,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  }
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  }
  {
    try {
      result = casadi::GenericMatrix< casadi::MX >::SWIGTEMPLATEDISAMBIGUATOR sym((std::string const &)*arg1,arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenMX_sym'."
      "  Prototype:\n"
      "    SYM(char,int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenMX_sym__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::pair< casadi_int,casadi_int > *arg2 = 0 ;
  std::string m1 ;
  std::pair< casadi_int,casadi_int > m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenMX_sym",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "[int,int]" "'.");
  {
    try {
      result = casadi::GenericMatrix< casadi::MX >::SWIGTEMPLATEDISAMBIGUATOR sym((std::string const &)*arg1,(std::pair< long long,long long > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenMX_sym'."
      "  Prototype:\n"
      "    SYM(char,[int,int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenMX_sym__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  casadi::Sparsity *arg2 = 0 ;
  std::string m1 ;
  casadi::Sparsity m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenMX_sym",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "Sparsity" "'.");
  {
    try {
      result = casadi::GenericMatrix< casadi::MX >::SWIGTEMPLATEDISAMBIGUATOR sym((std::string const &)*arg1,(casadi::Sparsity const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenMX_sym'."
      "  Prototype:\n"
      "    SYM(char,Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenMX_sym__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  casadi::Sparsity *arg2 = 0 ;
  casadi_int arg3 ;
  std::string m1 ;
  casadi::Sparsity m2 ;
  mxArray * _out;
  std::vector< casadi::MX,std::allocator< casadi::MX > > result;
  
  if (!SWIG_check_num_args("GenMX_sym",argc,3,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "Sparsity" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  {
    try {
      result = casadi::GenericMatrix< casadi::MX >::SWIGTEMPLATEDISAMBIGUATOR sym((std::string const &)*arg1,(casadi::Sparsity const &)*arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "MX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenMX_sym'."
      "  Prototype:\n"
      "    SYM(char,Sparsity,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenMX_sym__SWIG_4(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  casadi_int arg2 ;
  casadi_int arg3 ;
  casadi_int arg4 ;
  std::string m1 ;
  mxArray * _out;
  std::vector< casadi::MX,std::allocator< casadi::MX > > result;
  
  if (!SWIG_check_num_args("GenMX_sym",argc,4,4,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  if (!casadi::to_val(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "int" "'.");
  {
    try {
      result = casadi::GenericMatrix< casadi::MX >::SWIGTEMPLATEDISAMBIGUATOR sym((std::string const &)*arg1,arg2,arg3,arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "MX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenMX_sym'."
      "  Prototype:\n"
      "    SYM(char,int,int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenMX_sym__SWIG_5(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  casadi::Sparsity *arg2 = 0 ;
  casadi_int arg3 ;
  casadi_int arg4 ;
  std::string m1 ;
  casadi::Sparsity m2 ;
  mxArray * _out;
  std::vector< std::vector< casadi::MX,std::allocator< casadi::MX > >,std::allocator< std::vector< casadi::MX,std::allocator< casadi::MX > > > > result;
  
  if (!SWIG_check_num_args("GenMX_sym",argc,4,4,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "Sparsity" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  if (!casadi::to_val(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "int" "'.");
  {
    try {
      result = casadi::GenericMatrix< casadi::MX >::SWIGTEMPLATEDISAMBIGUATOR sym((std::string const &)*arg1,(casadi::Sparsity const &)*arg2,arg3,arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "{" "MX" "}" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenMX_sym'."
      "  Prototype:\n"
      "    SYM(char,Sparsity,int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenMX_sym__SWIG_6(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  casadi_int arg2 ;
  casadi_int arg3 ;
  casadi_int arg4 ;
  casadi_int arg5 ;
  std::string m1 ;
  mxArray * _out;
  std::vector< std::vector< casadi::MX,std::allocator< casadi::MX > >,std::allocator< std::vector< casadi::MX,std::allocator< casadi::MX > > > > result;
  
  if (!SWIG_check_num_args("GenMX_sym",argc,5,5,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  if (!casadi::to_val(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "int" "'.");
  if (!casadi::to_val(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "int" "'.");
  {
    try {
      result = casadi::GenericMatrix< casadi::MX >::SWIGTEMPLATEDISAMBIGUATOR sym((std::string const &)*arg1,arg2,arg3,arg4,arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "{" "MX" "}" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenMX_sym'."
      "  Prototype:\n"
      "    SYM(char,int,int,int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenMX_sym(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 1) && (argc <= 3)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::string **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_GenMX_sym__SWIG_0(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_GenMX_sym__SWIG_0(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          return _wrap_GenMX_sym__SWIG_0(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::string **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::pair<casadi_int,casadi_int> **>(0));
      if (_v) {
        return _wrap_GenMX_sym__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::string **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Sparsity **>(0));
      if (_v) {
        return _wrap_GenMX_sym__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 3) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::string **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Sparsity **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          return _wrap_GenMX_sym__SWIG_3(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::string **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi_int **>(0));
          if (_v) {
            return _wrap_GenMX_sym__SWIG_4(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::string **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Sparsity **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi_int **>(0));
          if (_v) {
            return _wrap_GenMX_sym__SWIG_5(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if (argc == 5) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::string **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi_int **>(0));
          if (_v) {
            _v = casadi::to_ptr(argv[4], static_cast< casadi_int **>(0));
            if (_v) {
              return _wrap_GenMX_sym__SWIG_6(resc,resv,argc,argv);
            }
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenMX_sym'."
    "  Possible prototypes are:\n"
    "    SYM(char,int,int)\n"
    "    SYM(char,[int,int])\n"
    "    SYM(char,Sparsity)\n"
    "    SYM(char,Sparsity,int)\n"
    "    SYM(char,int,int,int)\n"
    "    SYM(char,Sparsity,int,int)\n"
    "    SYM(char,int,int,int,int)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenMX_zeros__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 = (casadi_int) 1 ;
  casadi_int arg2 = (casadi_int) 1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenMX_zeros",argc,2,0,0)) {
    SWIG_fail;
  }
  if (0<argc) {
    if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  }
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  }
  {
    try {
      result = casadi::GenericMatrix< casadi::MX >::SWIGTEMPLATEDISAMBIGUATOR zeros(arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenMX_zeros'."
      "  Prototype:\n"
      "    ZEROS(int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenMX_zeros__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = 0 ;
  casadi::Sparsity m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenMX_zeros",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Sparsity" "'.");
  {
    try {
      result = casadi::GenericMatrix< casadi::MX >::SWIGTEMPLATEDISAMBIGUATOR zeros((casadi::Sparsity const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenMX_zeros'."
      "  Prototype:\n"
      "    ZEROS(Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenMX_zeros__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::pair< casadi_int,casadi_int > *arg1 = 0 ;
  std::pair< casadi_int,casadi_int > m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenMX_zeros",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "[int,int]" "'.");
  {
    try {
      result = casadi::GenericMatrix< casadi::MX >::SWIGTEMPLATEDISAMBIGUATOR zeros((std::pair< long long,long long > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenMX_zeros'."
      "  Prototype:\n"
      "    ZEROS([int,int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenMX_zeros(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 0) && (argc <= 2)) {
    int _v;
    if (argc <= 0) {
      return _wrap_GenMX_zeros__SWIG_0(resc,resv,argc,argv);
    }
    _v = casadi::to_ptr(argv[0], static_cast< casadi_int **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_GenMX_zeros__SWIG_0(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_GenMX_zeros__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::pair<casadi_int,casadi_int> **>(0));
    if (_v) {
      return _wrap_GenMX_zeros__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Sparsity **>(0));
    if (_v) {
      return _wrap_GenMX_zeros__SWIG_1(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenMX_zeros'."
    "  Possible prototypes are:\n"
    "    ZEROS(int,int)\n"
    "    ZEROS([int,int])\n"
    "    ZEROS(Sparsity)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenMX_ones__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 = (casadi_int) 1 ;
  casadi_int arg2 = (casadi_int) 1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenMX_ones",argc,2,0,0)) {
    SWIG_fail;
  }
  if (0<argc) {
    if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  }
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  }
  {
    try {
      result = casadi::GenericMatrix< casadi::MX >::SWIGTEMPLATEDISAMBIGUATOR ones(arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenMX_ones'."
      "  Prototype:\n"
      "    ONES(int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenMX_ones__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = 0 ;
  casadi::Sparsity m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenMX_ones",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Sparsity" "'.");
  {
    try {
      result = casadi::GenericMatrix< casadi::MX >::SWIGTEMPLATEDISAMBIGUATOR ones((casadi::Sparsity const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenMX_ones'."
      "  Prototype:\n"
      "    ONES(Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenMX_ones__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::pair< casadi_int,casadi_int > *arg1 = 0 ;
  std::pair< casadi_int,casadi_int > m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenMX_ones",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "[int,int]" "'.");
  {
    try {
      result = casadi::GenericMatrix< casadi::MX >::SWIGTEMPLATEDISAMBIGUATOR ones((std::pair< long long,long long > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenMX_ones'."
      "  Prototype:\n"
      "    ONES([int,int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenMX_ones(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 0) && (argc <= 2)) {
    int _v;
    if (argc <= 0) {
      return _wrap_GenMX_ones__SWIG_0(resc,resv,argc,argv);
    }
    _v = casadi::to_ptr(argv[0], static_cast< casadi_int **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_GenMX_ones__SWIG_0(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_GenMX_ones__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::pair<casadi_int,casadi_int> **>(0));
    if (_v) {
      return _wrap_GenMX_ones__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Sparsity **>(0));
    if (_v) {
      return _wrap_GenMX_ones__SWIG_1(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenMX_ones'."
    "  Possible prototypes are:\n"
    "    ONES(int,int)\n"
    "    ONES([int,int])\n"
    "    ONES(Sparsity)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_new_GenMX__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  casadi::GenericMatrix< casadi::MX > *result = 0 ;
  
  if (!SWIG_check_num_args("new_GenMX",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    result = (casadi::GenericMatrix< casadi::MX > *)new casadi::GenericMatrix< casadi::MX >();
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__GenericMatrixT_casadi__MX_t, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_GenMX'."
      "  Prototype:\n"
      "    GENMX()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_GenMX__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::MX > *arg1 = 0 ;
  void *argp1 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::GenericMatrix< casadi::MX > *result = 0 ;
  
  if (!SWIG_check_num_args("new_GenMX",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_casadi__GenericMatrixT_casadi__MX_t,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_GenMX" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::MX > const &""'"); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_GenMX" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::MX > const &""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::MX > * >(argp1);
  {
    result = (casadi::GenericMatrix< casadi::MX > *)new casadi::GenericMatrix< casadi::MX >((casadi::GenericMatrix< casadi::MX > const &)*arg1);
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__GenericMatrixT_casadi__MX_t, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_GenMX'."
      "  Prototype:\n"
      "    GENMX(GenMX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_GenMX(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 0) {
    return _wrap_new_GenMX__SWIG_0(resc,resv,argc,argv);
  }
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__GenericMatrixT_casadi__MX_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_new_GenMX__SWIG_1(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_GenMX'."
    "  Possible prototypes are:\n"
    "    GENMX()\n"
    "    GENMX(GenMX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_delete_GenMX(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericMatrix< casadi::MX > *arg1 = (casadi::GenericMatrix< casadi::MX > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  int is_owned;
  if (!SWIG_check_num_args("delete_GenMX",argc,1,1,0)) {
    SWIG_fail;
  }
  is_owned = SWIG_Matlab_isOwned(argv[0]);
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericMatrixT_casadi__MX_t, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GenMX" "', argument " "1"" of type '" "casadi::GenericMatrix< casadi::MX > *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericMatrix< casadi::MX > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  if (is_owned) {
    {
      delete arg1;
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'delete_GenMX'."
      "  Prototype:\n"
      "    GENMX(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_plus__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_plus",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_plus__SWIG_0((casadi::MX const &)*arg1,(casadi::MX const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_plus'."
      "  Prototype:\n"
      "    PLUS(MX,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_minus__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_minus",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_minus__SWIG_0((casadi::MX const &)*arg1,(casadi::MX const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_minus'."
      "  Prototype:\n"
      "    MINUS(MX,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_times__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_times",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_times__SWIG_0((casadi::MX const &)*arg1,(casadi::MX const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_times'."
      "  Prototype:\n"
      "    TIMES(MX,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_rdivide__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_rdivide",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_rdivide__SWIG_0((casadi::MX const &)*arg1,(casadi::MX const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_rdivide'."
      "  Prototype:\n"
      "    RDIVIDE(MX,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_ldivide__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_ldivide",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_ldivide__SWIG_0((casadi::MX const &)*arg1,(casadi::MX const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_ldivide'."
      "  Prototype:\n"
      "    LDIVIDE(MX,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_lt__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_lt",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_lt__SWIG_0((casadi::MX const &)*arg1,(casadi::MX const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_lt'."
      "  Prototype:\n"
      "    LT(MX,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_le__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_le",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_le__SWIG_0((casadi::MX const &)*arg1,(casadi::MX const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_le'."
      "  Prototype:\n"
      "    LE(MX,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_gt__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_gt",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_gt__SWIG_0((casadi::MX const &)*arg1,(casadi::MX const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_gt'."
      "  Prototype:\n"
      "    GT(MX,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_ge__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_ge",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_ge__SWIG_0((casadi::MX const &)*arg1,(casadi::MX const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_ge'."
      "  Prototype:\n"
      "    GE(MX,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_eq__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_eq",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_eq__SWIG_0((casadi::MX const &)*arg1,(casadi::MX const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_eq'."
      "  Prototype:\n"
      "    EQ(MX,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_ne__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_ne",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_ne__SWIG_0((casadi::MX const &)*arg1,(casadi::MX const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_ne'."
      "  Prototype:\n"
      "    NE(MX,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_and__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_and",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_and__SWIG_0((casadi::MX const &)*arg1,(casadi::MX const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_and'."
      "  Prototype:\n"
      "    AND(MX,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_or__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_or",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_or__SWIG_0((casadi::MX const &)*arg1,(casadi::MX const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_or'."
      "  Prototype:\n"
      "    OR(MX,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_not__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_not",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_not__SWIG_0((casadi::MX const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_not'."
      "  Prototype:\n"
      "    NOT(MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_abs__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_abs",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_abs__SWIG_0((casadi::MX const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_abs'."
      "  Prototype:\n"
      "    ABS(MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_sqrt__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_sqrt",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_sqrt__SWIG_0((casadi::MX const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_sqrt'."
      "  Prototype:\n"
      "    SQRT(MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_sin__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_sin",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_sin__SWIG_0((casadi::MX const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_sin'."
      "  Prototype:\n"
      "    SIN(MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_cos__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_cos",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_cos__SWIG_0((casadi::MX const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_cos'."
      "  Prototype:\n"
      "    COS(MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_tan__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_tan",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_tan__SWIG_0((casadi::MX const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_tan'."
      "  Prototype:\n"
      "    TAN(MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_atan__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_atan",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_atan__SWIG_0((casadi::MX const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_atan'."
      "  Prototype:\n"
      "    ATAN(MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_asin__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_asin",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_asin__SWIG_0((casadi::MX const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_asin'."
      "  Prototype:\n"
      "    ASIN(MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_acos__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_acos",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_acos__SWIG_0((casadi::MX const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_acos'."
      "  Prototype:\n"
      "    ACOS(MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_tanh__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_tanh",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_tanh__SWIG_0((casadi::MX const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_tanh'."
      "  Prototype:\n"
      "    TANH(MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_sinh__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_sinh",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_sinh__SWIG_0((casadi::MX const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_sinh'."
      "  Prototype:\n"
      "    SINH(MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_cosh__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_cosh",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_cosh__SWIG_0((casadi::MX const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_cosh'."
      "  Prototype:\n"
      "    COSH(MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_atanh__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_atanh",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_atanh__SWIG_0((casadi::MX const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_atanh'."
      "  Prototype:\n"
      "    ATANH(MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_asinh__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_asinh",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_asinh__SWIG_0((casadi::MX const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_asinh'."
      "  Prototype:\n"
      "    ASINH(MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_acosh__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_acosh",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_acosh__SWIG_0((casadi::MX const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_acosh'."
      "  Prototype:\n"
      "    ACOSH(MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_exp__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_exp",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_exp__SWIG_0((casadi::MX const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_exp'."
      "  Prototype:\n"
      "    EXP(MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_log__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_log",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_log__SWIG_0((casadi::MX const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_log'."
      "  Prototype:\n"
      "    LOG(MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_log10__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_log10",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_log10__SWIG_0((casadi::MX const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_log10'."
      "  Prototype:\n"
      "    LOG10(MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_log1p__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_log1p",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_log1p__SWIG_0((casadi::MX const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_log1p'."
      "  Prototype:\n"
      "    LOG1P(MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_expm1__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_expm1",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_expm1__SWIG_0((casadi::MX const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_expm1'."
      "  Prototype:\n"
      "    EXPM1(MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_floor__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_floor",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_floor__SWIG_0((casadi::MX const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_floor'."
      "  Prototype:\n"
      "    FLOOR(MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_ceil__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_ceil",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_ceil__SWIG_0((casadi::MX const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_ceil'."
      "  Prototype:\n"
      "    CEIL(MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_erf__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_erf",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_erf__SWIG_0((casadi::MX const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_erf'."
      "  Prototype:\n"
      "    ERF(MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_erfinv__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_erfinv",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_erfinv__SWIG_0((casadi::MX const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_erfinv'."
      "  Prototype:\n"
      "    ERFINV(MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_sign__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_sign",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_sign__SWIG_0((casadi::MX const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_sign'."
      "  Prototype:\n"
      "    SIGN(MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_power__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_power",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_power__SWIG_0((casadi::MX const &)*arg1,(casadi::MX const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_power'."
      "  Prototype:\n"
      "    POWER(MX,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_rem__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_rem",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_mod__SWIG_0((casadi::MX const &)*arg1,(casadi::MX const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_rem'."
      "  Prototype:\n"
      "    REM(MX,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_fmod__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_fmod",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_fmod__SWIG_0((casadi::MX const &)*arg1,(casadi::MX const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_fmod'."
      "  Prototype:\n"
      "    FMOD(MX,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_remainder__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_remainder",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_remainder__SWIG_0((casadi::MX const &)*arg1,(casadi::MX const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_remainder'."
      "  Prototype:\n"
      "    REMAINDER(MX,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_atan2__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_atan2",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_atan2__SWIG_0((casadi::MX const &)*arg1,(casadi::MX const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_atan2'."
      "  Prototype:\n"
      "    ATAN2(MX,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_fmin__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_fmin",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_fmin__SWIG_0((casadi::MX const &)*arg1,(casadi::MX const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_fmin'."
      "  Prototype:\n"
      "    FMIN(MX,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_fmax__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_fmax",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_fmax__SWIG_0((casadi::MX const &)*arg1,(casadi::MX const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_fmax'."
      "  Prototype:\n"
      "    FMAX(MX,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_hypot__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_hypot",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_hypot__SWIG_0((casadi::MX const &)*arg1,(casadi::MX const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_hypot'."
      "  Prototype:\n"
      "    HYPOT(MX,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_simplify__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_simplify",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_simplify__SWIG_0((casadi::MX const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_simplify'."
      "  Prototype:\n"
      "    SIMPLIFY(MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_is_equal__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  casadi_int arg3 = (casadi_int) 0 ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_is_equal",argc,3,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  }
  {
    try {
      result = (bool)casadi_GenericExpressionCommon_casadi_is_equal__SWIG_0((casadi::MX const &)*arg1,(casadi::MX const &)*arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_is_equal'."
      "  Prototype:\n"
      "    IS_EQUAL(MX,MX,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_copysign__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_copysign",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_copysign__SWIG_0((casadi::MX const &)*arg1,(casadi::MX const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_copysign'."
      "  Prototype:\n"
      "    COPYSIGN(MX,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_constpow__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_constpow",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_constpow__SWIG_0((casadi::MX const &)*arg1,(casadi::MX const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_constpow'."
      "  Prototype:\n"
      "    CONSTPOW(MX,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_plus__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_plus",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_plus__SWIG_1((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_plus'."
      "  Prototype:\n"
      "    PLUS(DM,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_minus__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_minus",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_minus__SWIG_1((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_minus'."
      "  Prototype:\n"
      "    MINUS(DM,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_times__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_times",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_times__SWIG_1((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_times'."
      "  Prototype:\n"
      "    TIMES(DM,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_rdivide__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_rdivide",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_rdivide__SWIG_1((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_rdivide'."
      "  Prototype:\n"
      "    RDIVIDE(DM,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_ldivide__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_ldivide",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_ldivide__SWIG_1((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_ldivide'."
      "  Prototype:\n"
      "    LDIVIDE(DM,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_lt__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_lt",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_lt__SWIG_1((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_lt'."
      "  Prototype:\n"
      "    LT(DM,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_le__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_le",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_le__SWIG_1((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_le'."
      "  Prototype:\n"
      "    LE(DM,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_gt__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_gt",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_gt__SWIG_1((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_gt'."
      "  Prototype:\n"
      "    GT(DM,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_ge__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_ge",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_ge__SWIG_1((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_ge'."
      "  Prototype:\n"
      "    GE(DM,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_eq__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_eq",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_eq__SWIG_1((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_eq'."
      "  Prototype:\n"
      "    EQ(DM,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_ne__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_ne",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_ne__SWIG_1((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_ne'."
      "  Prototype:\n"
      "    NE(DM,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_and__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_and",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_and__SWIG_1((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_and'."
      "  Prototype:\n"
      "    AND(DM,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_or__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_or",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_or__SWIG_1((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_or'."
      "  Prototype:\n"
      "    OR(DM,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_not__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_not",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_not__SWIG_1((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_not'."
      "  Prototype:\n"
      "    NOT(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_abs__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_abs",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_abs__SWIG_1((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_abs'."
      "  Prototype:\n"
      "    ABS(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_sqrt__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_sqrt",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_sqrt__SWIG_1((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_sqrt'."
      "  Prototype:\n"
      "    SQRT(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_sin__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_sin",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_sin__SWIG_1((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_sin'."
      "  Prototype:\n"
      "    SIN(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_cos__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_cos",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_cos__SWIG_1((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_cos'."
      "  Prototype:\n"
      "    COS(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_tan__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_tan",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_tan__SWIG_1((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_tan'."
      "  Prototype:\n"
      "    TAN(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_atan__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_atan",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_atan__SWIG_1((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_atan'."
      "  Prototype:\n"
      "    ATAN(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_asin__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_asin",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_asin__SWIG_1((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_asin'."
      "  Prototype:\n"
      "    ASIN(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_acos__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_acos",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_acos__SWIG_1((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_acos'."
      "  Prototype:\n"
      "    ACOS(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_tanh__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_tanh",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_tanh__SWIG_1((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_tanh'."
      "  Prototype:\n"
      "    TANH(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_sinh__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_sinh",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_sinh__SWIG_1((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_sinh'."
      "  Prototype:\n"
      "    SINH(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_cosh__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_cosh",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_cosh__SWIG_1((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_cosh'."
      "  Prototype:\n"
      "    COSH(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_atanh__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_atanh",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_atanh__SWIG_1((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_atanh'."
      "  Prototype:\n"
      "    ATANH(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_asinh__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_asinh",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_asinh__SWIG_1((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_asinh'."
      "  Prototype:\n"
      "    ASINH(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_acosh__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_acosh",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_acosh__SWIG_1((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_acosh'."
      "  Prototype:\n"
      "    ACOSH(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_exp__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_exp",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_exp__SWIG_1((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_exp'."
      "  Prototype:\n"
      "    EXP(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_log__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_log",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_log__SWIG_1((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_log'."
      "  Prototype:\n"
      "    LOG(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_log10__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_log10",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_log10__SWIG_1((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_log10'."
      "  Prototype:\n"
      "    LOG10(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_log1p__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_log1p",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_log1p__SWIG_1((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_log1p'."
      "  Prototype:\n"
      "    LOG1P(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_expm1__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_expm1",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_expm1__SWIG_1((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_expm1'."
      "  Prototype:\n"
      "    EXPM1(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_floor__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_floor",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_floor__SWIG_1((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_floor'."
      "  Prototype:\n"
      "    FLOOR(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_ceil__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_ceil",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_ceil__SWIG_1((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_ceil'."
      "  Prototype:\n"
      "    CEIL(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_erf__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_erf",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_erf__SWIG_1((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_erf'."
      "  Prototype:\n"
      "    ERF(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_erfinv__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_erfinv",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_erfinv__SWIG_1((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_erfinv'."
      "  Prototype:\n"
      "    ERFINV(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_sign__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_sign",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_sign__SWIG_1((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_sign'."
      "  Prototype:\n"
      "    SIGN(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_power__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_power",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_power__SWIG_1((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_power'."
      "  Prototype:\n"
      "    POWER(DM,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_rem__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_rem",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_mod__SWIG_1((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_rem'."
      "  Prototype:\n"
      "    REM(DM,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_fmod__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_fmod",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_fmod__SWIG_1((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_fmod'."
      "  Prototype:\n"
      "    FMOD(DM,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_remainder__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_remainder",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_remainder__SWIG_1((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_remainder'."
      "  Prototype:\n"
      "    REMAINDER(DM,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_atan2__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_atan2",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_atan2__SWIG_1((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_atan2'."
      "  Prototype:\n"
      "    ATAN2(DM,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_fmin__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_fmin",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_fmin__SWIG_1((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_fmin'."
      "  Prototype:\n"
      "    FMIN(DM,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_fmax__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_fmax",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_fmax__SWIG_1((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_fmax'."
      "  Prototype:\n"
      "    FMAX(DM,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_hypot__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_hypot",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_hypot__SWIG_1((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_hypot'."
      "  Prototype:\n"
      "    HYPOT(DM,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_simplify__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_simplify",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_simplify__SWIG_1((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_simplify'."
      "  Prototype:\n"
      "    SIMPLIFY(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_is_equal__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi_int arg3 = (casadi_int) 0 ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_is_equal",argc,3,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  }
  {
    try {
      result = (bool)casadi_GenericExpressionCommon_casadi_is_equal__SWIG_1((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_is_equal'."
      "  Prototype:\n"
      "    IS_EQUAL(DM,DM,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_copysign__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_copysign",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_copysign__SWIG_1((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_copysign'."
      "  Prototype:\n"
      "    COPYSIGN(DM,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_constpow__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_constpow",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_constpow__SWIG_1((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_constpow'."
      "  Prototype:\n"
      "    CONSTPOW(DM,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_plus__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_plus",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_plus__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_plus'."
      "  Prototype:\n"
      "    PLUS(SX,SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_minus__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_minus",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_minus__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_minus'."
      "  Prototype:\n"
      "    MINUS(SX,SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_times__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_times",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_times__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_times'."
      "  Prototype:\n"
      "    TIMES(SX,SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_rdivide__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_rdivide",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_rdivide__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_rdivide'."
      "  Prototype:\n"
      "    RDIVIDE(SX,SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_ldivide__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_ldivide",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_ldivide__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_ldivide'."
      "  Prototype:\n"
      "    LDIVIDE(SX,SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_lt__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_lt",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_lt__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_lt'."
      "  Prototype:\n"
      "    LT(SX,SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_le__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_le",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_le__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_le'."
      "  Prototype:\n"
      "    LE(SX,SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_gt__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_gt",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_gt__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_gt'."
      "  Prototype:\n"
      "    GT(SX,SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_ge__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_ge",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_ge__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_ge'."
      "  Prototype:\n"
      "    GE(SX,SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_eq__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_eq",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_eq__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_eq'."
      "  Prototype:\n"
      "    EQ(SX,SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_ne__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_ne",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_ne__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_ne'."
      "  Prototype:\n"
      "    NE(SX,SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_and__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_and",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_and__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_and'."
      "  Prototype:\n"
      "    AND(SX,SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_or__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_or",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_or__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_or'."
      "  Prototype:\n"
      "    OR(SX,SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_not__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_not",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_not__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_not'."
      "  Prototype:\n"
      "    NOT(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_abs__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_abs",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_abs__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_abs'."
      "  Prototype:\n"
      "    ABS(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_sqrt__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_sqrt",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_sqrt__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_sqrt'."
      "  Prototype:\n"
      "    SQRT(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_sin__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_sin",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_sin__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_sin'."
      "  Prototype:\n"
      "    SIN(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_cos__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_cos",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_cos__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_cos'."
      "  Prototype:\n"
      "    COS(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_tan__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_tan",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_tan__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_tan'."
      "  Prototype:\n"
      "    TAN(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_atan__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_atan",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_atan__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_atan'."
      "  Prototype:\n"
      "    ATAN(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_asin__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_asin",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_asin__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_asin'."
      "  Prototype:\n"
      "    ASIN(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_acos__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_acos",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_acos__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_acos'."
      "  Prototype:\n"
      "    ACOS(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_tanh__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_tanh",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_tanh__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_tanh'."
      "  Prototype:\n"
      "    TANH(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_sinh__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_sinh",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_sinh__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_sinh'."
      "  Prototype:\n"
      "    SINH(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_cosh__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_cosh",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_cosh__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_cosh'."
      "  Prototype:\n"
      "    COSH(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_atanh__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_atanh",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_atanh__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_atanh'."
      "  Prototype:\n"
      "    ATANH(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_asinh__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_asinh",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_asinh__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_asinh'."
      "  Prototype:\n"
      "    ASINH(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_acosh__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_acosh",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_acosh__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_acosh'."
      "  Prototype:\n"
      "    ACOSH(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_exp__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_exp",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_exp__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_exp'."
      "  Prototype:\n"
      "    EXP(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_log__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_log",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_log__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_log'."
      "  Prototype:\n"
      "    LOG(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_log10__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_log10",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_log10__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_log10'."
      "  Prototype:\n"
      "    LOG10(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_log1p__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_log1p",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_log1p__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_log1p'."
      "  Prototype:\n"
      "    LOG1P(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_expm1__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_expm1",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_expm1__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_expm1'."
      "  Prototype:\n"
      "    EXPM1(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_floor__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_floor",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_floor__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_floor'."
      "  Prototype:\n"
      "    FLOOR(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_ceil__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_ceil",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_ceil__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_ceil'."
      "  Prototype:\n"
      "    CEIL(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_erf__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_erf",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_erf__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_erf'."
      "  Prototype:\n"
      "    ERF(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_erfinv__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_erfinv",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_erfinv__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_erfinv'."
      "  Prototype:\n"
      "    ERFINV(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_sign__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_sign",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_sign__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_sign'."
      "  Prototype:\n"
      "    SIGN(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_power__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_power",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_power__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_power'."
      "  Prototype:\n"
      "    POWER(SX,SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_rem__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_rem",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_mod__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_rem'."
      "  Prototype:\n"
      "    REM(SX,SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_fmod__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_fmod",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_fmod__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_fmod'."
      "  Prototype:\n"
      "    FMOD(SX,SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_remainder__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_remainder",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_remainder__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_remainder'."
      "  Prototype:\n"
      "    REMAINDER(SX,SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_atan2__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_atan2",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_atan2__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_atan2'."
      "  Prototype:\n"
      "    ATAN2(SX,SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_fmin__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_fmin",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_fmin__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_fmin'."
      "  Prototype:\n"
      "    FMIN(SX,SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_fmax__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_fmax",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_fmax__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_fmax'."
      "  Prototype:\n"
      "    FMAX(SX,SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_hypot__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_hypot",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_hypot__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_hypot'."
      "  Prototype:\n"
      "    HYPOT(SX,SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_simplify__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_simplify",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_simplify__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_simplify'."
      "  Prototype:\n"
      "    SIMPLIFY(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_is_equal__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi_int arg3 = (casadi_int) 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_is_equal",argc,3,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  }
  {
    try {
      result = (bool)casadi_GenericExpressionCommon_casadi_is_equal__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_is_equal'."
      "  Prototype:\n"
      "    IS_EQUAL(SX,SX,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_copysign__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_copysign",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_copysign__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_copysign'."
      "  Prototype:\n"
      "    COPYSIGN(SX,SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_constpow__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_constpow",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  {
    try {
      result = casadi_GenericExpressionCommon_casadi_constpow__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_constpow'."
      "  Prototype:\n"
      "    CONSTPOW(SX,SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_plus__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  double *arg1 = 0 ;
  double *arg2 = 0 ;
  double m1 ;
  double m2 ;
  mxArray * _out;
  double result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_plus",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "double" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "double" "'.");
  {
    try {
      result = (double)casadi_GenericExpressionCommon_casadi_plus__SWIG_3((double const &)*arg1,(double const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "double" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_plus'."
      "  Prototype:\n"
      "    PLUS(double,double)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_plus(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< double **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< double **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_plus__SWIG_3(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_plus__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_plus__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_plus__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_plus'."
    "  Possible prototypes are:\n"
    "    PLUS(double,double)\n"
    "    PLUS(DM,DM)\n"
    "    PLUS(SX,SX)\n"
    "    PLUS(MX,MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericExpressionCommon_minus__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  double *arg1 = 0 ;
  double *arg2 = 0 ;
  double m1 ;
  double m2 ;
  mxArray * _out;
  double result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_minus",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "double" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "double" "'.");
  {
    try {
      result = (double)casadi_GenericExpressionCommon_casadi_minus__SWIG_3((double const &)*arg1,(double const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "double" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_minus'."
      "  Prototype:\n"
      "    MINUS(double,double)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_minus(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< double **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< double **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_minus__SWIG_3(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_minus__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_minus__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_minus__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_minus'."
    "  Possible prototypes are:\n"
    "    MINUS(double,double)\n"
    "    MINUS(DM,DM)\n"
    "    MINUS(SX,SX)\n"
    "    MINUS(MX,MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericExpressionCommon_times__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  double *arg1 = 0 ;
  double *arg2 = 0 ;
  double m1 ;
  double m2 ;
  mxArray * _out;
  double result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_times",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "double" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "double" "'.");
  {
    try {
      result = (double)casadi_GenericExpressionCommon_casadi_times__SWIG_3((double const &)*arg1,(double const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "double" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_times'."
      "  Prototype:\n"
      "    TIMES(double,double)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_times(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< double **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< double **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_times__SWIG_3(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_times__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_times__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_times__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_times'."
    "  Possible prototypes are:\n"
    "    TIMES(double,double)\n"
    "    TIMES(DM,DM)\n"
    "    TIMES(SX,SX)\n"
    "    TIMES(MX,MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericExpressionCommon_rdivide__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  double *arg1 = 0 ;
  double *arg2 = 0 ;
  double m1 ;
  double m2 ;
  mxArray * _out;
  double result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_rdivide",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "double" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "double" "'.");
  {
    try {
      result = (double)casadi_GenericExpressionCommon_casadi_rdivide__SWIG_3((double const &)*arg1,(double const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "double" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_rdivide'."
      "  Prototype:\n"
      "    RDIVIDE(double,double)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_rdivide(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< double **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< double **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_rdivide__SWIG_3(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_rdivide__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_rdivide__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_rdivide__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_rdivide'."
    "  Possible prototypes are:\n"
    "    RDIVIDE(double,double)\n"
    "    RDIVIDE(DM,DM)\n"
    "    RDIVIDE(SX,SX)\n"
    "    RDIVIDE(MX,MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericExpressionCommon_ldivide__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  double *arg1 = 0 ;
  double *arg2 = 0 ;
  double m1 ;
  double m2 ;
  mxArray * _out;
  double result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_ldivide",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "double" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "double" "'.");
  {
    try {
      result = (double)casadi_GenericExpressionCommon_casadi_ldivide__SWIG_3((double const &)*arg1,(double const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "double" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_ldivide'."
      "  Prototype:\n"
      "    LDIVIDE(double,double)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_ldivide(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< double **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< double **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_ldivide__SWIG_3(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_ldivide__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_ldivide__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_ldivide__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_ldivide'."
    "  Possible prototypes are:\n"
    "    LDIVIDE(double,double)\n"
    "    LDIVIDE(DM,DM)\n"
    "    LDIVIDE(SX,SX)\n"
    "    LDIVIDE(MX,MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericExpressionCommon_lt__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  double *arg1 = 0 ;
  double *arg2 = 0 ;
  double m1 ;
  double m2 ;
  mxArray * _out;
  double result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_lt",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "double" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "double" "'.");
  {
    try {
      result = (double)casadi_GenericExpressionCommon_casadi_lt__SWIG_3((double const &)*arg1,(double const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "double" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_lt'."
      "  Prototype:\n"
      "    LT(double,double)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_lt(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< double **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< double **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_lt__SWIG_3(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_lt__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_lt__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_lt__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_lt'."
    "  Possible prototypes are:\n"
    "    LT(double,double)\n"
    "    LT(DM,DM)\n"
    "    LT(SX,SX)\n"
    "    LT(MX,MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericExpressionCommon_le__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  double *arg1 = 0 ;
  double *arg2 = 0 ;
  double m1 ;
  double m2 ;
  mxArray * _out;
  double result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_le",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "double" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "double" "'.");
  {
    try {
      result = (double)casadi_GenericExpressionCommon_casadi_le__SWIG_3((double const &)*arg1,(double const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "double" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_le'."
      "  Prototype:\n"
      "    LE(double,double)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_le(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< double **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< double **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_le__SWIG_3(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_le__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_le__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_le__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_le'."
    "  Possible prototypes are:\n"
    "    LE(double,double)\n"
    "    LE(DM,DM)\n"
    "    LE(SX,SX)\n"
    "    LE(MX,MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericExpressionCommon_gt__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  double *arg1 = 0 ;
  double *arg2 = 0 ;
  double m1 ;
  double m2 ;
  mxArray * _out;
  double result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_gt",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "double" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "double" "'.");
  {
    try {
      result = (double)casadi_GenericExpressionCommon_casadi_gt__SWIG_3((double const &)*arg1,(double const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "double" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_gt'."
      "  Prototype:\n"
      "    GT(double,double)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_gt(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< double **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< double **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_gt__SWIG_3(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_gt__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_gt__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_gt__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_gt'."
    "  Possible prototypes are:\n"
    "    GT(double,double)\n"
    "    GT(DM,DM)\n"
    "    GT(SX,SX)\n"
    "    GT(MX,MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericExpressionCommon_ge__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  double *arg1 = 0 ;
  double *arg2 = 0 ;
  double m1 ;
  double m2 ;
  mxArray * _out;
  double result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_ge",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "double" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "double" "'.");
  {
    try {
      result = (double)casadi_GenericExpressionCommon_casadi_ge__SWIG_3((double const &)*arg1,(double const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "double" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_ge'."
      "  Prototype:\n"
      "    GE(double,double)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_ge(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< double **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< double **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_ge__SWIG_3(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_ge__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_ge__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_ge__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_ge'."
    "  Possible prototypes are:\n"
    "    GE(double,double)\n"
    "    GE(DM,DM)\n"
    "    GE(SX,SX)\n"
    "    GE(MX,MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericExpressionCommon_eq__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  double *arg1 = 0 ;
  double *arg2 = 0 ;
  double m1 ;
  double m2 ;
  mxArray * _out;
  double result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_eq",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "double" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "double" "'.");
  {
    try {
      result = (double)casadi_GenericExpressionCommon_casadi_eq__SWIG_3((double const &)*arg1,(double const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "double" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_eq'."
      "  Prototype:\n"
      "    EQ(double,double)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_eq(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< double **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< double **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_eq__SWIG_3(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_eq__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_eq__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_eq__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_eq'."
    "  Possible prototypes are:\n"
    "    EQ(double,double)\n"
    "    EQ(DM,DM)\n"
    "    EQ(SX,SX)\n"
    "    EQ(MX,MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericExpressionCommon_ne__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  double *arg1 = 0 ;
  double *arg2 = 0 ;
  double m1 ;
  double m2 ;
  mxArray * _out;
  double result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_ne",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "double" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "double" "'.");
  {
    try {
      result = (double)casadi_GenericExpressionCommon_casadi_ne__SWIG_3((double const &)*arg1,(double const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "double" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_ne'."
      "  Prototype:\n"
      "    NE(double,double)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_ne(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< double **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< double **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_ne__SWIG_3(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_ne__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_ne__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_ne__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_ne'."
    "  Possible prototypes are:\n"
    "    NE(double,double)\n"
    "    NE(DM,DM)\n"
    "    NE(SX,SX)\n"
    "    NE(MX,MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericExpressionCommon_and__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  double *arg1 = 0 ;
  double *arg2 = 0 ;
  double m1 ;
  double m2 ;
  mxArray * _out;
  double result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_and",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "double" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "double" "'.");
  {
    try {
      result = (double)casadi_GenericExpressionCommon_casadi_and__SWIG_3((double const &)*arg1,(double const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "double" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_and'."
      "  Prototype:\n"
      "    AND(double,double)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_and(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< double **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< double **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_and__SWIG_3(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_and__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_and__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_and__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_and'."
    "  Possible prototypes are:\n"
    "    AND(double,double)\n"
    "    AND(DM,DM)\n"
    "    AND(SX,SX)\n"
    "    AND(MX,MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericExpressionCommon_or__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  double *arg1 = 0 ;
  double *arg2 = 0 ;
  double m1 ;
  double m2 ;
  mxArray * _out;
  double result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_or",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "double" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "double" "'.");
  {
    try {
      result = (double)casadi_GenericExpressionCommon_casadi_or__SWIG_3((double const &)*arg1,(double const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "double" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_or'."
      "  Prototype:\n"
      "    OR(double,double)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_or(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< double **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< double **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_or__SWIG_3(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_or__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_or__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_or__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_or'."
    "  Possible prototypes are:\n"
    "    OR(double,double)\n"
    "    OR(DM,DM)\n"
    "    OR(SX,SX)\n"
    "    OR(MX,MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericExpressionCommon_not__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  double *arg1 = 0 ;
  double m1 ;
  mxArray * _out;
  double result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_not",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "double" "'.");
  {
    try {
      result = (double)casadi_GenericExpressionCommon_casadi_not__SWIG_3((double const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "double" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_not'."
      "  Prototype:\n"
      "    NOT(double)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_not(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< double **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_not__SWIG_3(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_not__SWIG_1(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_not__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_not__SWIG_0(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_not'."
    "  Possible prototypes are:\n"
    "    NOT(double)\n"
    "    NOT(DM)\n"
    "    NOT(SX)\n"
    "    NOT(MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericExpressionCommon_abs__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  double *arg1 = 0 ;
  double m1 ;
  mxArray * _out;
  double result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_abs",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "double" "'.");
  {
    try {
      result = (double)casadi_GenericExpressionCommon_casadi_abs__SWIG_3((double const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "double" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_abs'."
      "  Prototype:\n"
      "    ABS(double)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_abs(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< double **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_abs__SWIG_3(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_abs__SWIG_1(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_abs__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_abs__SWIG_0(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_abs'."
    "  Possible prototypes are:\n"
    "    ABS(double)\n"
    "    ABS(DM)\n"
    "    ABS(SX)\n"
    "    ABS(MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericExpressionCommon_sqrt__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  double *arg1 = 0 ;
  double m1 ;
  mxArray * _out;
  double result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_sqrt",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "double" "'.");
  {
    try {
      result = (double)casadi_GenericExpressionCommon_casadi_sqrt__SWIG_3((double const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "double" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_sqrt'."
      "  Prototype:\n"
      "    SQRT(double)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_sqrt(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< double **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_sqrt__SWIG_3(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_sqrt__SWIG_1(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_sqrt__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_sqrt__SWIG_0(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_sqrt'."
    "  Possible prototypes are:\n"
    "    SQRT(double)\n"
    "    SQRT(DM)\n"
    "    SQRT(SX)\n"
    "    SQRT(MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericExpressionCommon_sin__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  double *arg1 = 0 ;
  double m1 ;
  mxArray * _out;
  double result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_sin",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "double" "'.");
  {
    try {
      result = (double)casadi_GenericExpressionCommon_casadi_sin__SWIG_3((double const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "double" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_sin'."
      "  Prototype:\n"
      "    SIN(double)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_sin(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< double **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_sin__SWIG_3(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_sin__SWIG_1(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_sin__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_sin__SWIG_0(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_sin'."
    "  Possible prototypes are:\n"
    "    SIN(double)\n"
    "    SIN(DM)\n"
    "    SIN(SX)\n"
    "    SIN(MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericExpressionCommon_cos__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  double *arg1 = 0 ;
  double m1 ;
  mxArray * _out;
  double result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_cos",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "double" "'.");
  {
    try {
      result = (double)casadi_GenericExpressionCommon_casadi_cos__SWIG_3((double const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "double" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_cos'."
      "  Prototype:\n"
      "    COS(double)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_cos(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< double **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_cos__SWIG_3(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_cos__SWIG_1(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_cos__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_cos__SWIG_0(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_cos'."
    "  Possible prototypes are:\n"
    "    COS(double)\n"
    "    COS(DM)\n"
    "    COS(SX)\n"
    "    COS(MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericExpressionCommon_tan__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  double *arg1 = 0 ;
  double m1 ;
  mxArray * _out;
  double result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_tan",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "double" "'.");
  {
    try {
      result = (double)casadi_GenericExpressionCommon_casadi_tan__SWIG_3((double const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "double" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_tan'."
      "  Prototype:\n"
      "    TAN(double)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_tan(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< double **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_tan__SWIG_3(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_tan__SWIG_1(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_tan__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_tan__SWIG_0(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_tan'."
    "  Possible prototypes are:\n"
    "    TAN(double)\n"
    "    TAN(DM)\n"
    "    TAN(SX)\n"
    "    TAN(MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericExpressionCommon_atan__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  double *arg1 = 0 ;
  double m1 ;
  mxArray * _out;
  double result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_atan",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "double" "'.");
  {
    try {
      result = (double)casadi_GenericExpressionCommon_casadi_atan__SWIG_3((double const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "double" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_atan'."
      "  Prototype:\n"
      "    ATAN(double)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_atan(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< double **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_atan__SWIG_3(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_atan__SWIG_1(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_atan__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_atan__SWIG_0(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_atan'."
    "  Possible prototypes are:\n"
    "    ATAN(double)\n"
    "    ATAN(DM)\n"
    "    ATAN(SX)\n"
    "    ATAN(MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericExpressionCommon_asin__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  double *arg1 = 0 ;
  double m1 ;
  mxArray * _out;
  double result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_asin",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "double" "'.");
  {
    try {
      result = (double)casadi_GenericExpressionCommon_casadi_asin__SWIG_3((double const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "double" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_asin'."
      "  Prototype:\n"
      "    ASIN(double)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_asin(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< double **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_asin__SWIG_3(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_asin__SWIG_1(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_asin__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_asin__SWIG_0(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_asin'."
    "  Possible prototypes are:\n"
    "    ASIN(double)\n"
    "    ASIN(DM)\n"
    "    ASIN(SX)\n"
    "    ASIN(MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericExpressionCommon_acos__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  double *arg1 = 0 ;
  double m1 ;
  mxArray * _out;
  double result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_acos",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "double" "'.");
  {
    try {
      result = (double)casadi_GenericExpressionCommon_casadi_acos__SWIG_3((double const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "double" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_acos'."
      "  Prototype:\n"
      "    ACOS(double)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_acos(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< double **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_acos__SWIG_3(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_acos__SWIG_1(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_acos__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_acos__SWIG_0(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_acos'."
    "  Possible prototypes are:\n"
    "    ACOS(double)\n"
    "    ACOS(DM)\n"
    "    ACOS(SX)\n"
    "    ACOS(MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericExpressionCommon_tanh__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  double *arg1 = 0 ;
  double m1 ;
  mxArray * _out;
  double result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_tanh",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "double" "'.");
  {
    try {
      result = (double)casadi_GenericExpressionCommon_casadi_tanh__SWIG_3((double const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "double" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_tanh'."
      "  Prototype:\n"
      "    TANH(double)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_tanh(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< double **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_tanh__SWIG_3(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_tanh__SWIG_1(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_tanh__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_tanh__SWIG_0(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_tanh'."
    "  Possible prototypes are:\n"
    "    TANH(double)\n"
    "    TANH(DM)\n"
    "    TANH(SX)\n"
    "    TANH(MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericExpressionCommon_sinh__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  double *arg1 = 0 ;
  double m1 ;
  mxArray * _out;
  double result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_sinh",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "double" "'.");
  {
    try {
      result = (double)casadi_GenericExpressionCommon_casadi_sinh__SWIG_3((double const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "double" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_sinh'."
      "  Prototype:\n"
      "    SINH(double)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_sinh(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< double **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_sinh__SWIG_3(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_sinh__SWIG_1(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_sinh__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_sinh__SWIG_0(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_sinh'."
    "  Possible prototypes are:\n"
    "    SINH(double)\n"
    "    SINH(DM)\n"
    "    SINH(SX)\n"
    "    SINH(MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericExpressionCommon_cosh__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  double *arg1 = 0 ;
  double m1 ;
  mxArray * _out;
  double result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_cosh",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "double" "'.");
  {
    try {
      result = (double)casadi_GenericExpressionCommon_casadi_cosh__SWIG_3((double const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "double" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_cosh'."
      "  Prototype:\n"
      "    COSH(double)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_cosh(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< double **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_cosh__SWIG_3(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_cosh__SWIG_1(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_cosh__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_cosh__SWIG_0(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_cosh'."
    "  Possible prototypes are:\n"
    "    COSH(double)\n"
    "    COSH(DM)\n"
    "    COSH(SX)\n"
    "    COSH(MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericExpressionCommon_atanh__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  double *arg1 = 0 ;
  double m1 ;
  mxArray * _out;
  double result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_atanh",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "double" "'.");
  {
    try {
      result = (double)casadi_GenericExpressionCommon_casadi_atanh__SWIG_3((double const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "double" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_atanh'."
      "  Prototype:\n"
      "    ATANH(double)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_atanh(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< double **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_atanh__SWIG_3(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_atanh__SWIG_1(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_atanh__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_atanh__SWIG_0(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_atanh'."
    "  Possible prototypes are:\n"
    "    ATANH(double)\n"
    "    ATANH(DM)\n"
    "    ATANH(SX)\n"
    "    ATANH(MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericExpressionCommon_asinh__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  double *arg1 = 0 ;
  double m1 ;
  mxArray * _out;
  double result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_asinh",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "double" "'.");
  {
    try {
      result = (double)casadi_GenericExpressionCommon_casadi_asinh__SWIG_3((double const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "double" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_asinh'."
      "  Prototype:\n"
      "    ASINH(double)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_asinh(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< double **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_asinh__SWIG_3(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_asinh__SWIG_1(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_asinh__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_asinh__SWIG_0(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_asinh'."
    "  Possible prototypes are:\n"
    "    ASINH(double)\n"
    "    ASINH(DM)\n"
    "    ASINH(SX)\n"
    "    ASINH(MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericExpressionCommon_acosh__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  double *arg1 = 0 ;
  double m1 ;
  mxArray * _out;
  double result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_acosh",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "double" "'.");
  {
    try {
      result = (double)casadi_GenericExpressionCommon_casadi_acosh__SWIG_3((double const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "double" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_acosh'."
      "  Prototype:\n"
      "    ACOSH(double)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_acosh(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< double **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_acosh__SWIG_3(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_acosh__SWIG_1(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_acosh__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_acosh__SWIG_0(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_acosh'."
    "  Possible prototypes are:\n"
    "    ACOSH(double)\n"
    "    ACOSH(DM)\n"
    "    ACOSH(SX)\n"
    "    ACOSH(MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericExpressionCommon_exp__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  double *arg1 = 0 ;
  double m1 ;
  mxArray * _out;
  double result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_exp",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "double" "'.");
  {
    try {
      result = (double)casadi_GenericExpressionCommon_casadi_exp__SWIG_3((double const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "double" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_exp'."
      "  Prototype:\n"
      "    EXP(double)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_exp(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< double **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_exp__SWIG_3(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_exp__SWIG_1(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_exp__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_exp__SWIG_0(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_exp'."
    "  Possible prototypes are:\n"
    "    EXP(double)\n"
    "    EXP(DM)\n"
    "    EXP(SX)\n"
    "    EXP(MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericExpressionCommon_log__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  double *arg1 = 0 ;
  double m1 ;
  mxArray * _out;
  double result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_log",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "double" "'.");
  {
    try {
      result = (double)casadi_GenericExpressionCommon_casadi_log__SWIG_3((double const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "double" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_log'."
      "  Prototype:\n"
      "    LOG(double)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_log(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< double **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_log__SWIG_3(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_log__SWIG_1(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_log__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_log__SWIG_0(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_log'."
    "  Possible prototypes are:\n"
    "    LOG(double)\n"
    "    LOG(DM)\n"
    "    LOG(SX)\n"
    "    LOG(MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericExpressionCommon_log10__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  double *arg1 = 0 ;
  double m1 ;
  mxArray * _out;
  double result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_log10",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "double" "'.");
  {
    try {
      result = (double)casadi_GenericExpressionCommon_casadi_log10__SWIG_3((double const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "double" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_log10'."
      "  Prototype:\n"
      "    LOG10(double)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_log10(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< double **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_log10__SWIG_3(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_log10__SWIG_1(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_log10__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_log10__SWIG_0(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_log10'."
    "  Possible prototypes are:\n"
    "    LOG10(double)\n"
    "    LOG10(DM)\n"
    "    LOG10(SX)\n"
    "    LOG10(MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericExpressionCommon_log1p__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  double *arg1 = 0 ;
  double m1 ;
  mxArray * _out;
  double result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_log1p",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "double" "'.");
  {
    try {
      result = (double)casadi_GenericExpressionCommon_casadi_log1p__SWIG_3((double const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "double" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_log1p'."
      "  Prototype:\n"
      "    LOG1P(double)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_log1p(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< double **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_log1p__SWIG_3(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_log1p__SWIG_1(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_log1p__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_log1p__SWIG_0(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_log1p'."
    "  Possible prototypes are:\n"
    "    LOG1P(double)\n"
    "    LOG1P(DM)\n"
    "    LOG1P(SX)\n"
    "    LOG1P(MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericExpressionCommon_expm1__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  double *arg1 = 0 ;
  double m1 ;
  mxArray * _out;
  double result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_expm1",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "double" "'.");
  {
    try {
      result = (double)casadi_GenericExpressionCommon_casadi_expm1__SWIG_3((double const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "double" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_expm1'."
      "  Prototype:\n"
      "    EXPM1(double)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_expm1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< double **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_expm1__SWIG_3(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_expm1__SWIG_1(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_expm1__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_expm1__SWIG_0(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_expm1'."
    "  Possible prototypes are:\n"
    "    EXPM1(double)\n"
    "    EXPM1(DM)\n"
    "    EXPM1(SX)\n"
    "    EXPM1(MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericExpressionCommon_floor__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  double *arg1 = 0 ;
  double m1 ;
  mxArray * _out;
  double result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_floor",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "double" "'.");
  {
    try {
      result = (double)casadi_GenericExpressionCommon_casadi_floor__SWIG_3((double const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "double" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_floor'."
      "  Prototype:\n"
      "    FLOOR(double)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_floor(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< double **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_floor__SWIG_3(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_floor__SWIG_1(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_floor__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_floor__SWIG_0(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_floor'."
    "  Possible prototypes are:\n"
    "    FLOOR(double)\n"
    "    FLOOR(DM)\n"
    "    FLOOR(SX)\n"
    "    FLOOR(MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericExpressionCommon_ceil__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  double *arg1 = 0 ;
  double m1 ;
  mxArray * _out;
  double result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_ceil",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "double" "'.");
  {
    try {
      result = (double)casadi_GenericExpressionCommon_casadi_ceil__SWIG_3((double const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "double" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_ceil'."
      "  Prototype:\n"
      "    CEIL(double)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_ceil(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< double **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_ceil__SWIG_3(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_ceil__SWIG_1(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_ceil__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_ceil__SWIG_0(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_ceil'."
    "  Possible prototypes are:\n"
    "    CEIL(double)\n"
    "    CEIL(DM)\n"
    "    CEIL(SX)\n"
    "    CEIL(MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericExpressionCommon_erf__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  double *arg1 = 0 ;
  double m1 ;
  mxArray * _out;
  double result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_erf",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "double" "'.");
  {
    try {
      result = (double)casadi_GenericExpressionCommon_casadi_erf__SWIG_3((double const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "double" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_erf'."
      "  Prototype:\n"
      "    ERF(double)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_erf(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< double **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_erf__SWIG_3(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_erf__SWIG_1(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_erf__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_erf__SWIG_0(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_erf'."
    "  Possible prototypes are:\n"
    "    ERF(double)\n"
    "    ERF(DM)\n"
    "    ERF(SX)\n"
    "    ERF(MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericExpressionCommon_erfinv__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  double *arg1 = 0 ;
  double m1 ;
  mxArray * _out;
  double result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_erfinv",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "double" "'.");
  {
    try {
      result = (double)casadi_GenericExpressionCommon_casadi_erfinv__SWIG_3((double const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "double" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_erfinv'."
      "  Prototype:\n"
      "    ERFINV(double)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_erfinv(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< double **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_erfinv__SWIG_3(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_erfinv__SWIG_1(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_erfinv__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_erfinv__SWIG_0(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_erfinv'."
    "  Possible prototypes are:\n"
    "    ERFINV(double)\n"
    "    ERFINV(DM)\n"
    "    ERFINV(SX)\n"
    "    ERFINV(MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericExpressionCommon_sign__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  double *arg1 = 0 ;
  double m1 ;
  mxArray * _out;
  double result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_sign",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "double" "'.");
  {
    try {
      result = (double)casadi_GenericExpressionCommon_casadi_sign__SWIG_3((double const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "double" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_sign'."
      "  Prototype:\n"
      "    SIGN(double)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_sign(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< double **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_sign__SWIG_3(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_sign__SWIG_1(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_sign__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_sign__SWIG_0(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_sign'."
    "  Possible prototypes are:\n"
    "    SIGN(double)\n"
    "    SIGN(DM)\n"
    "    SIGN(SX)\n"
    "    SIGN(MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericExpressionCommon_power__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  double *arg1 = 0 ;
  double *arg2 = 0 ;
  double m1 ;
  double m2 ;
  mxArray * _out;
  double result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_power",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "double" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "double" "'.");
  {
    try {
      result = (double)casadi_GenericExpressionCommon_casadi_power__SWIG_3((double const &)*arg1,(double const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "double" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_power'."
      "  Prototype:\n"
      "    POWER(double,double)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_power(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< double **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< double **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_power__SWIG_3(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_power__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_power__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_power__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_power'."
    "  Possible prototypes are:\n"
    "    POWER(double,double)\n"
    "    POWER(DM,DM)\n"
    "    POWER(SX,SX)\n"
    "    POWER(MX,MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericExpressionCommon_rem__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  double *arg1 = 0 ;
  double *arg2 = 0 ;
  double m1 ;
  double m2 ;
  mxArray * _out;
  double result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_rem",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "double" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "double" "'.");
  {
    try {
      result = (double)casadi_GenericExpressionCommon_casadi_mod__SWIG_3((double const &)*arg1,(double const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "double" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_rem'."
      "  Prototype:\n"
      "    REM(double,double)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_rem(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< double **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< double **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_rem__SWIG_3(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_rem__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_rem__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_rem__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_rem'."
    "  Possible prototypes are:\n"
    "    REM(double,double)\n"
    "    REM(DM,DM)\n"
    "    REM(SX,SX)\n"
    "    REM(MX,MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericExpressionCommon_fmod__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  double *arg1 = 0 ;
  double *arg2 = 0 ;
  double m1 ;
  double m2 ;
  mxArray * _out;
  double result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_fmod",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "double" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "double" "'.");
  {
    try {
      result = (double)casadi_GenericExpressionCommon_casadi_fmod__SWIG_3((double const &)*arg1,(double const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "double" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_fmod'."
      "  Prototype:\n"
      "    FMOD(double,double)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_fmod(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< double **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< double **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_fmod__SWIG_3(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_fmod__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_fmod__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_fmod__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_fmod'."
    "  Possible prototypes are:\n"
    "    FMOD(double,double)\n"
    "    FMOD(DM,DM)\n"
    "    FMOD(SX,SX)\n"
    "    FMOD(MX,MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericExpressionCommon_remainder__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  double *arg1 = 0 ;
  double *arg2 = 0 ;
  double m1 ;
  double m2 ;
  mxArray * _out;
  double result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_remainder",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "double" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "double" "'.");
  {
    try {
      result = (double)casadi_GenericExpressionCommon_casadi_remainder__SWIG_3((double const &)*arg1,(double const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "double" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_remainder'."
      "  Prototype:\n"
      "    REMAINDER(double,double)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_remainder(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< double **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< double **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_remainder__SWIG_3(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_remainder__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_remainder__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_remainder__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_remainder'."
    "  Possible prototypes are:\n"
    "    REMAINDER(double,double)\n"
    "    REMAINDER(DM,DM)\n"
    "    REMAINDER(SX,SX)\n"
    "    REMAINDER(MX,MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericExpressionCommon_atan2__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  double *arg1 = 0 ;
  double *arg2 = 0 ;
  double m1 ;
  double m2 ;
  mxArray * _out;
  double result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_atan2",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "double" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "double" "'.");
  {
    try {
      result = (double)casadi_GenericExpressionCommon_casadi_atan2__SWIG_3((double const &)*arg1,(double const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "double" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_atan2'."
      "  Prototype:\n"
      "    ATAN2(double,double)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_atan2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< double **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< double **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_atan2__SWIG_3(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_atan2__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_atan2__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_atan2__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_atan2'."
    "  Possible prototypes are:\n"
    "    ATAN2(double,double)\n"
    "    ATAN2(DM,DM)\n"
    "    ATAN2(SX,SX)\n"
    "    ATAN2(MX,MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericExpressionCommon_fmin__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  double *arg1 = 0 ;
  double *arg2 = 0 ;
  double m1 ;
  double m2 ;
  mxArray * _out;
  double result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_fmin",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "double" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "double" "'.");
  {
    try {
      result = (double)casadi_GenericExpressionCommon_casadi_fmin__SWIG_3((double const &)*arg1,(double const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "double" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_fmin'."
      "  Prototype:\n"
      "    FMIN(double,double)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_fmin(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< double **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< double **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_fmin__SWIG_3(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_fmin__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_fmin__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_fmin__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_fmin'."
    "  Possible prototypes are:\n"
    "    FMIN(double,double)\n"
    "    FMIN(DM,DM)\n"
    "    FMIN(SX,SX)\n"
    "    FMIN(MX,MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericExpressionCommon_fmax__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  double *arg1 = 0 ;
  double *arg2 = 0 ;
  double m1 ;
  double m2 ;
  mxArray * _out;
  double result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_fmax",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "double" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "double" "'.");
  {
    try {
      result = (double)casadi_GenericExpressionCommon_casadi_fmax__SWIG_3((double const &)*arg1,(double const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "double" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_fmax'."
      "  Prototype:\n"
      "    FMAX(double,double)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_fmax(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< double **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< double **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_fmax__SWIG_3(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_fmax__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_fmax__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_fmax__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_fmax'."
    "  Possible prototypes are:\n"
    "    FMAX(double,double)\n"
    "    FMAX(DM,DM)\n"
    "    FMAX(SX,SX)\n"
    "    FMAX(MX,MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericExpressionCommon_hypot__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  double *arg1 = 0 ;
  double *arg2 = 0 ;
  double m1 ;
  double m2 ;
  mxArray * _out;
  double result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_hypot",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "double" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "double" "'.");
  {
    try {
      result = (double)casadi_GenericExpressionCommon_casadi_hypot__SWIG_3((double const &)*arg1,(double const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "double" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_hypot'."
      "  Prototype:\n"
      "    HYPOT(double,double)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_hypot(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< double **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< double **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_hypot__SWIG_3(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_hypot__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_hypot__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_hypot__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_hypot'."
    "  Possible prototypes are:\n"
    "    HYPOT(double,double)\n"
    "    HYPOT(DM,DM)\n"
    "    HYPOT(SX,SX)\n"
    "    HYPOT(MX,MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericExpressionCommon_simplify__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  double *arg1 = 0 ;
  double m1 ;
  mxArray * _out;
  double result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_simplify",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "double" "'.");
  {
    try {
      result = (double)casadi_GenericExpressionCommon_casadi_simplify__SWIG_3((double const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "double" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_simplify'."
      "  Prototype:\n"
      "    SIMPLIFY(double)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_simplify(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< double **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_simplify__SWIG_3(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_simplify__SWIG_1(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_simplify__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      return _wrap_GenericExpressionCommon_simplify__SWIG_0(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_simplify'."
    "  Possible prototypes are:\n"
    "    SIMPLIFY(double)\n"
    "    SIMPLIFY(DM)\n"
    "    SIMPLIFY(SX)\n"
    "    SIMPLIFY(MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericExpressionCommon_is_equal__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  double *arg1 = 0 ;
  double *arg2 = 0 ;
  casadi_int arg3 = (casadi_int) 0 ;
  double m1 ;
  double m2 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_is_equal",argc,3,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "double" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "double" "'.");
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  }
  {
    try {
      result = (bool)casadi_GenericExpressionCommon_casadi_is_equal__SWIG_3((double const &)*arg1,(double const &)*arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_is_equal'."
      "  Prototype:\n"
      "    IS_EQUAL(double,double,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_is_equal(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 2) && (argc <= 3)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< double **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< double **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_GenericExpressionCommon_is_equal__SWIG_3(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          return _wrap_GenericExpressionCommon_is_equal__SWIG_3(resc,resv,argc,argv);
        }
      }
    }
  }
  if ((argc >= 2) && (argc <= 3)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_GenericExpressionCommon_is_equal__SWIG_1(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          return _wrap_GenericExpressionCommon_is_equal__SWIG_1(resc,resv,argc,argv);
        }
      }
    }
  }
  if ((argc >= 2) && (argc <= 3)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_GenericExpressionCommon_is_equal__SWIG_2(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          return _wrap_GenericExpressionCommon_is_equal__SWIG_2(resc,resv,argc,argv);
        }
      }
    }
  }
  if ((argc >= 2) && (argc <= 3)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_GenericExpressionCommon_is_equal__SWIG_0(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          return _wrap_GenericExpressionCommon_is_equal__SWIG_0(resc,resv,argc,argv);
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_is_equal'."
    "  Possible prototypes are:\n"
    "    IS_EQUAL(double,double,int)\n"
    "    IS_EQUAL(DM,DM,int)\n"
    "    IS_EQUAL(SX,SX,int)\n"
    "    IS_EQUAL(MX,MX,int)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericExpressionCommon_copysign__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  double *arg1 = 0 ;
  double *arg2 = 0 ;
  double m1 ;
  double m2 ;
  mxArray * _out;
  double result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_copysign",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "double" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "double" "'.");
  {
    try {
      result = (double)casadi_GenericExpressionCommon_casadi_copysign__SWIG_3((double const &)*arg1,(double const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "double" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_copysign'."
      "  Prototype:\n"
      "    COPYSIGN(double,double)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_copysign(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< double **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< double **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_copysign__SWIG_3(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_copysign__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_copysign__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_copysign__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_copysign'."
    "  Possible prototypes are:\n"
    "    COPYSIGN(double,double)\n"
    "    COPYSIGN(DM,DM)\n"
    "    COPYSIGN(SX,SX)\n"
    "    COPYSIGN(MX,MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_GenericExpressionCommon_constpow__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  double *arg1 = 0 ;
  double *arg2 = 0 ;
  double m1 ;
  double m2 ;
  mxArray * _out;
  double result;
  
  if (!SWIG_check_num_args("GenericExpressionCommon_constpow",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "double" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "double" "'.");
  {
    try {
      result = (double)casadi_GenericExpressionCommon_casadi_constpow__SWIG_3((double const &)*arg1,(double const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "double" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_constpow'."
      "  Prototype:\n"
      "    CONSTPOW(double,double)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GenericExpressionCommon_constpow(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< double **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< double **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_constpow__SWIG_3(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_constpow__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_constpow__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        return _wrap_GenericExpressionCommon_constpow__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GenericExpressionCommon_constpow'."
    "  Possible prototypes are:\n"
    "    CONSTPOW(double,double)\n"
    "    CONSTPOW(DM,DM)\n"
    "    CONSTPOW(SX,SX)\n"
    "    CONSTPOW(MX,MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_new_GenericExpressionCommon__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  casadi::GenericExpressionCommon *result = 0 ;
  
  if (!SWIG_check_num_args("new_GenericExpressionCommon",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    result = (casadi::GenericExpressionCommon *)new casadi::GenericExpressionCommon();
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__GenericExpressionCommon, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_GenericExpressionCommon'."
      "  Prototype:\n"
      "    GENERICEXPRESSIONCOMMON()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_GenericExpressionCommon__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericExpressionCommon *arg1 = 0 ;
  void *argp1 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::GenericExpressionCommon *result = 0 ;
  
  if (!SWIG_check_num_args("new_GenericExpressionCommon",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_casadi__GenericExpressionCommon,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_GenericExpressionCommon" "', argument " "1"" of type '" "casadi::GenericExpressionCommon const &""'"); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_GenericExpressionCommon" "', argument " "1"" of type '" "casadi::GenericExpressionCommon const &""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericExpressionCommon * >(argp1);
  {
    result = (casadi::GenericExpressionCommon *)new casadi::GenericExpressionCommon((casadi::GenericExpressionCommon const &)*arg1);
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__GenericExpressionCommon, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_GenericExpressionCommon'."
      "  Prototype:\n"
      "    GENERICEXPRESSIONCOMMON(GenericExpressionCommon)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_GenericExpressionCommon(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 0) {
    return _wrap_new_GenericExpressionCommon__SWIG_0(resc,resv,argc,argv);
  }
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__GenericExpressionCommon, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_new_GenericExpressionCommon__SWIG_1(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_GenericExpressionCommon'."
    "  Possible prototypes are:\n"
    "    GENERICEXPRESSIONCOMMON()\n"
    "    GENERICEXPRESSIONCOMMON(GenericExpressionCommon)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_delete_GenericExpressionCommon(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GenericExpressionCommon *arg1 = (casadi::GenericExpressionCommon *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  int is_owned;
  if (!SWIG_check_num_args("delete_GenericExpressionCommon",argc,1,1,0)) {
    SWIG_fail;
  }
  is_owned = SWIG_Matlab_isOwned(argv[0]);
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GenericExpressionCommon, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GenericExpressionCommon" "', argument " "1"" of type '" "casadi::GenericExpressionCommon *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GenericExpressionCommon * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  if (is_owned) {
    {
      delete arg1;
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'delete_GenericExpressionCommon'."
      "  Prototype:\n"
      "    GENERICEXPRESSIONCOMMON(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatrixCommon_all__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("MatrixCommon_all",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = casadi_MatrixCommon_casadi_all__SWIG_0((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_all'."
      "  Prototype:\n"
      "    ALL(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatrixCommon_any__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("MatrixCommon_any",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = casadi_MatrixCommon_casadi_any__SWIG_0((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_any'."
      "  Prototype:\n"
      "    ANY(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatrixCommon_adj__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("MatrixCommon_adj",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = casadi_MatrixCommon_casadi_adj__SWIG_0((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_adj'."
      "  Prototype:\n"
      "    ADJ(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatrixCommon_minor__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi_int arg2 ;
  casadi_int arg3 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("MatrixCommon_minor",argc,3,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  {
    try {
      result = casadi_MatrixCommon_casadi_minor__SWIG_0((casadi::Matrix< double > const &)*arg1,arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_minor'."
      "  Prototype:\n"
      "    MINOR(DM,int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatrixCommon_cofactor__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi_int arg2 ;
  casadi_int arg3 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("MatrixCommon_cofactor",argc,3,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  {
    try {
      result = casadi_MatrixCommon_casadi_cofactor__SWIG_0((casadi::Matrix< double > const &)*arg1,arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_cofactor'."
      "  Prototype:\n"
      "    COFACTOR(DM,int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatrixCommon_qr__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > *arg3 = 0 ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  casadi::Matrix< double > m3 ;
  mxArray * _out;
  
  arg2 = &m2;
  arg3 = &m3;
  if (!SWIG_check_num_args("MatrixCommon_qr",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      casadi_MatrixCommon_casadi_qr__SWIG_0((casadi::Matrix< double > const &)*arg1,*arg2,*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg3);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_qr'."
      "  Prototype:\n"
      "    QR(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatrixCommon_qr_sparse__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > *arg3 = 0 ;
  casadi::Matrix< double > *arg4 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg5 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg6 = 0 ;
  bool arg7 = (bool) true ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  casadi::Matrix< double > m3 ;
  casadi::Matrix< double > m4 ;
  std::vector< casadi_int > m5 ;
  std::vector< casadi_int > m6 ;
  mxArray * _out;
  
  arg2 = &m2;
  arg3 = &m3;
  arg4 = &m4;
  arg5 = &m5;
  arg6 = &m6;
  if (!SWIG_check_num_args("MatrixCommon_qr_sparse",argc,2,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg7)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 7 to type '" "bool" "'.");
  }
  {
    try {
      casadi_MatrixCommon_casadi_qr_sparse__SWIG_0((casadi::Matrix< double > const &)*arg1,*arg2,*arg3,*arg4,*arg5,*arg6,arg7);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg3);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg4);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg5);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg6);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_qr_sparse'."
      "  Prototype:\n"
      "    QR_SPARSE(DM,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatrixCommon_qr_solve__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > *arg3 = 0 ;
  casadi::Matrix< double > *arg4 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg5 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg6 = 0 ;
  bool arg7 = (bool) false ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  casadi::Matrix< double > m3 ;
  casadi::Matrix< double > m4 ;
  std::vector< casadi_int > m5 ;
  std::vector< casadi_int > m6 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("MatrixCommon_qr_solve",argc,7,6,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "DM" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "DM" "'.");
  arg5 = &m5;
  if (!casadi::to_ptr(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "[" "int" "]" "'.");
  arg6 = &m6;
  if (!casadi::to_ptr(argv[5], &arg6)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 6 to type '" "[" "int" "]" "'.");
  if (6<argc) {
    if (!casadi::to_val(argv[6], &arg7)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 7 to type '" "bool" "'.");
  }
  {
    try {
      result = casadi_MatrixCommon_casadi_qr_solve__SWIG_0((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2,(casadi::Matrix< double > const &)*arg3,(casadi::Matrix< double > const &)*arg4,(std::vector< long long,std::allocator< long long > > const &)*arg5,(std::vector< long long,std::allocator< long long > > const &)*arg6,arg7);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_qr_solve'."
      "  Prototype:\n"
      "    QR_SOLVE(DM,DM,DM,DM,[int],[int],bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatrixCommon_ldl__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > *arg3 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg4 = 0 ;
  bool arg5 = (bool) true ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  casadi::Matrix< double > m3 ;
  std::vector< casadi_int > m4 ;
  mxArray * _out;
  
  arg2 = &m2;
  arg3 = &m3;
  arg4 = &m4;
  if (!SWIG_check_num_args("MatrixCommon_ldl",argc,2,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "bool" "'.");
  }
  {
    try {
      casadi_MatrixCommon_casadi_ldl__SWIG_0((casadi::Matrix< double > const &)*arg1,*arg2,*arg3,*arg4,arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg3);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg4);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_ldl'."
      "  Prototype:\n"
      "    LDL(DM,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatrixCommon_ldl_solve__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > *arg3 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg4 = 0 ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  casadi::Matrix< double > m3 ;
  std::vector< casadi_int > m4 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("MatrixCommon_ldl_solve",argc,4,4,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "DM" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "[" "int" "]" "'.");
  {
    try {
      result = casadi_MatrixCommon_casadi_ldl_solve__SWIG_0((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2,(casadi::Matrix< double > const &)*arg3,(std::vector< long long,std::allocator< long long > > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_ldl_solve'."
      "  Prototype:\n"
      "    LDL_SOLVE(DM,DM,DM,[int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatrixCommon_chol__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("MatrixCommon_chol",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = casadi_MatrixCommon_casadi_chol__SWIG_0((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_chol'."
      "  Prototype:\n"
      "    CHOL(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatrixCommon_norm_inf_mul__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("MatrixCommon_norm_inf_mul",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  {
    try {
      result = casadi_MatrixCommon_casadi_norm_inf_mul__SWIG_0((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_norm_inf_mul'."
      "  Prototype:\n"
      "    NORM_INF_MUL(DM,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatrixCommon_sparsify__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  double arg2 = (double) 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("MatrixCommon_sparsify",argc,2,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "double" "'.");
  }
  {
    try {
      result = casadi_MatrixCommon_casadi_sparsify__SWIG_0((casadi::Matrix< double > const &)*arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_sparsify'."
      "  Prototype:\n"
      "    SPARSIFY(DM,double)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatrixCommon_expand__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > *arg3 = 0 ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  casadi::Matrix< double > m3 ;
  mxArray * _out;
  
  arg2 = &m2;
  arg3 = &m3;
  if (!SWIG_check_num_args("MatrixCommon_expand",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      casadi_MatrixCommon_casadi_expand__SWIG_0((casadi::Matrix< double > const &)*arg1,*arg2,*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg3);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_expand'."
      "  Prototype:\n"
      "    EXPAND(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatrixCommon_pw_const__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > *arg3 = 0 ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  casadi::Matrix< double > m3 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("MatrixCommon_pw_const",argc,3,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "DM" "'.");
  {
    try {
      result = casadi_MatrixCommon_casadi_pw_const__SWIG_0((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2,(casadi::Matrix< double > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_pw_const'."
      "  Prototype:\n"
      "    PW_CONST(DM,DM,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatrixCommon_pw_lin__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > *arg3 = 0 ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  casadi::Matrix< double > m3 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("MatrixCommon_pw_lin",argc,3,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "DM" "'.");
  {
    try {
      result = casadi_MatrixCommon_casadi_pw_lin__SWIG_0((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2,(casadi::Matrix< double > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_pw_lin'."
      "  Prototype:\n"
      "    PW_LIN(DM,DM,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatrixCommon_heaviside__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("MatrixCommon_heaviside",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = casadi_MatrixCommon_casadi_heaviside__SWIG_0((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_heaviside'."
      "  Prototype:\n"
      "    HEAVISIDE(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatrixCommon_rectangle__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("MatrixCommon_rectangle",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = casadi_MatrixCommon_casadi_rectangle__SWIG_0((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_rectangle'."
      "  Prototype:\n"
      "    RECTANGLE(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatrixCommon_triangle__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("MatrixCommon_triangle",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = casadi_MatrixCommon_casadi_triangle__SWIG_0((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_triangle'."
      "  Prototype:\n"
      "    TRIANGLE(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatrixCommon_ramp__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("MatrixCommon_ramp",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = casadi_MatrixCommon_casadi_ramp__SWIG_0((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_ramp'."
      "  Prototype:\n"
      "    RAMP(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatrixCommon_gauss_quadrature__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > *arg3 = 0 ;
  casadi::Matrix< double > *arg4 = 0 ;
  casadi_int arg5 = (casadi_int) 5 ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  casadi::Matrix< double > m3 ;
  casadi::Matrix< double > m4 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("MatrixCommon_gauss_quadrature",argc,5,4,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "DM" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "DM" "'.");
  if (4<argc) {
    if (!casadi::to_val(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "int" "'.");
  }
  {
    try {
      result = casadi_MatrixCommon_casadi_gauss_quadrature__SWIG_0((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2,(casadi::Matrix< double > const &)*arg3,(casadi::Matrix< double > const &)*arg4,arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_gauss_quadrature'."
      "  Prototype:\n"
      "    GAUSS_QUADRATURE(DM,DM,DM,DM,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatrixCommon_gauss_quadrature__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > *arg3 = 0 ;
  casadi::Matrix< double > *arg4 = 0 ;
  casadi_int arg5 ;
  casadi::Matrix< double > *arg6 = 0 ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  casadi::Matrix< double > m3 ;
  casadi::Matrix< double > m4 ;
  casadi::Matrix< double > m6 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("MatrixCommon_gauss_quadrature",argc,6,6,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "DM" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "DM" "'.");
  if (!casadi::to_val(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "int" "'.");
  arg6 = &m6;
  if (!casadi::to_ptr(argv[5], &arg6)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 6 to type '" "DM" "'.");
  {
    try {
      result = casadi_MatrixCommon_casadi_gauss_quadrature__SWIG_1((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2,(casadi::Matrix< double > const &)*arg3,(casadi::Matrix< double > const &)*arg4,arg5,(casadi::Matrix< double > const &)*arg6);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_gauss_quadrature'."
      "  Prototype:\n"
      "    GAUSS_QUADRATURE(DM,DM,DM,DM,int,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatrixCommon_taylor__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > const &arg3_defvalue = 0 ;
  casadi::Matrix< double > *arg3 = (casadi::Matrix< double > *) &arg3_defvalue ;
  casadi_int arg4 = (casadi_int) 1 ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  casadi::Matrix< double > m3 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("MatrixCommon_taylor",argc,4,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  if (2<argc) {
    arg3 = &m3;
    if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "DM" "'.");
  }
  if (3<argc) {
    if (!casadi::to_val(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "int" "'.");
  }
  {
    try {
      result = casadi_MatrixCommon_casadi_taylor__SWIG_0((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2,(casadi::Matrix< double > const &)*arg3,arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_taylor'."
      "  Prototype:\n"
      "    TAYLOR(DM,DM,DM,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatrixCommon_mtaylor__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > *arg3 = 0 ;
  casadi_int arg4 = (casadi_int) 1 ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  casadi::Matrix< double > m3 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("MatrixCommon_mtaylor",argc,4,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "DM" "'.");
  if (3<argc) {
    if (!casadi::to_val(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "int" "'.");
  }
  {
    try {
      result = casadi_MatrixCommon_casadi_mtaylor__SWIG_0((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2,(casadi::Matrix< double > const &)*arg3,arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_mtaylor'."
      "  Prototype:\n"
      "    MTAYLOR(DM,DM,DM,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatrixCommon_mtaylor__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > *arg3 = 0 ;
  casadi_int arg4 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg5 = 0 ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  casadi::Matrix< double > m3 ;
  std::vector< casadi_int > m5 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("MatrixCommon_mtaylor",argc,5,5,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "DM" "'.");
  if (!casadi::to_val(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "int" "'.");
  arg5 = &m5;
  if (!casadi::to_ptr(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "[" "int" "]" "'.");
  {
    try {
      result = casadi_MatrixCommon_casadi_mtaylor__SWIG_1((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2,(casadi::Matrix< double > const &)*arg3,arg4,(std::vector< long long,std::allocator< long long > > const &)*arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_mtaylor'."
      "  Prototype:\n"
      "    MTAYLOR(DM,DM,DM,int,[int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatrixCommon_poly_coeff__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("MatrixCommon_poly_coeff",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  {
    try {
      result = casadi_MatrixCommon_casadi_poly_coeff__SWIG_0((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_poly_coeff'."
      "  Prototype:\n"
      "    POLY_COEFF(DM,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatrixCommon_poly_roots__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("MatrixCommon_poly_roots",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = casadi_MatrixCommon_casadi_poly_roots__SWIG_0((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_poly_roots'."
      "  Prototype:\n"
      "    POLY_ROOTS(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatrixCommon_eig_symbolic__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("MatrixCommon_eig_symbolic",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = casadi_MatrixCommon_casadi_eig_symbolic__SWIG_0((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_eig_symbolic'."
      "  Prototype:\n"
      "    EIG_SYMBOLIC(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatrixCommon_all__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("MatrixCommon_all",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = casadi_MatrixCommon_casadi_all__SWIG_1((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_all'."
      "  Prototype:\n"
      "    ALL(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatrixCommon_all(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_MatrixCommon_all__SWIG_0(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_MatrixCommon_all__SWIG_1(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_all'."
    "  Possible prototypes are:\n"
    "    ALL(DM)\n"
    "    ALL(SX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_MatrixCommon_any__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("MatrixCommon_any",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = casadi_MatrixCommon_casadi_any__SWIG_1((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_any'."
      "  Prototype:\n"
      "    ANY(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatrixCommon_any(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_MatrixCommon_any__SWIG_0(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_MatrixCommon_any__SWIG_1(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_any'."
    "  Possible prototypes are:\n"
    "    ANY(DM)\n"
    "    ANY(SX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_MatrixCommon_adj__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("MatrixCommon_adj",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = casadi_MatrixCommon_casadi_adj__SWIG_1((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_adj'."
      "  Prototype:\n"
      "    ADJ(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatrixCommon_adj(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_MatrixCommon_adj__SWIG_0(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_MatrixCommon_adj__SWIG_1(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_adj'."
    "  Possible prototypes are:\n"
    "    ADJ(DM)\n"
    "    ADJ(SX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_MatrixCommon_minor__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi_int arg2 ;
  casadi_int arg3 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("MatrixCommon_minor",argc,3,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  {
    try {
      result = casadi_MatrixCommon_casadi_minor__SWIG_1((casadi::Matrix< casadi::SXElem > const &)*arg1,arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_minor'."
      "  Prototype:\n"
      "    MINOR(SX,int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatrixCommon_minor(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 3) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          return _wrap_MatrixCommon_minor__SWIG_0(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          return _wrap_MatrixCommon_minor__SWIG_1(resc,resv,argc,argv);
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_minor'."
    "  Possible prototypes are:\n"
    "    MINOR(DM,int,int)\n"
    "    MINOR(SX,int,int)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_MatrixCommon_cofactor__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi_int arg2 ;
  casadi_int arg3 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("MatrixCommon_cofactor",argc,3,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  {
    try {
      result = casadi_MatrixCommon_casadi_cofactor__SWIG_1((casadi::Matrix< casadi::SXElem > const &)*arg1,arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_cofactor'."
      "  Prototype:\n"
      "    COFACTOR(SX,int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatrixCommon_cofactor(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 3) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          return _wrap_MatrixCommon_cofactor__SWIG_0(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          return _wrap_MatrixCommon_cofactor__SWIG_1(resc,resv,argc,argv);
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_cofactor'."
    "  Possible prototypes are:\n"
    "    COFACTOR(DM,int,int)\n"
    "    COFACTOR(SX,int,int)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_MatrixCommon_qr__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg3 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  casadi::Matrix< casadi::SXElem > m3 ;
  mxArray * _out;
  
  arg2 = &m2;
  arg3 = &m3;
  if (!SWIG_check_num_args("MatrixCommon_qr",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      casadi_MatrixCommon_casadi_qr__SWIG_1((casadi::Matrix< casadi::SXElem > const &)*arg1,*arg2,*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg3);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_qr'."
      "  Prototype:\n"
      "    QR(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatrixCommon_qr(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_MatrixCommon_qr__SWIG_0(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_MatrixCommon_qr__SWIG_1(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_qr'."
    "  Possible prototypes are:\n"
    "    QR(DM)\n"
    "    QR(SX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_MatrixCommon_qr_sparse__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg3 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg4 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg5 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg6 = 0 ;
  bool arg7 = (bool) true ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  casadi::Matrix< casadi::SXElem > m3 ;
  casadi::Matrix< casadi::SXElem > m4 ;
  std::vector< casadi_int > m5 ;
  std::vector< casadi_int > m6 ;
  mxArray * _out;
  
  arg2 = &m2;
  arg3 = &m3;
  arg4 = &m4;
  arg5 = &m5;
  arg6 = &m6;
  if (!SWIG_check_num_args("MatrixCommon_qr_sparse",argc,2,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg7)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 7 to type '" "bool" "'.");
  }
  {
    try {
      casadi_MatrixCommon_casadi_qr_sparse__SWIG_1((casadi::Matrix< casadi::SXElem > const &)*arg1,*arg2,*arg3,*arg4,*arg5,*arg6,arg7);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg3);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg4);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg5);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg6);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_qr_sparse'."
      "  Prototype:\n"
      "    QR_SPARSE(SX,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatrixCommon_qr_sparse(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 1) && (argc <= 2)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_MatrixCommon_qr_sparse__SWIG_0(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< bool **>(0));
      if (_v) {
        return _wrap_MatrixCommon_qr_sparse__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  if ((argc >= 1) && (argc <= 2)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_MatrixCommon_qr_sparse__SWIG_1(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< bool **>(0));
      if (_v) {
        return _wrap_MatrixCommon_qr_sparse__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_qr_sparse'."
    "  Possible prototypes are:\n"
    "    QR_SPARSE(DM,bool)\n"
    "    QR_SPARSE(SX,bool)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_MatrixCommon_qr_solve__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg3 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg4 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg5 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg6 = 0 ;
  bool arg7 = (bool) false ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  casadi::Matrix< casadi::SXElem > m3 ;
  casadi::Matrix< casadi::SXElem > m4 ;
  std::vector< casadi_int > m5 ;
  std::vector< casadi_int > m6 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("MatrixCommon_qr_solve",argc,7,6,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "SX" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "SX" "'.");
  arg5 = &m5;
  if (!casadi::to_ptr(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "[" "int" "]" "'.");
  arg6 = &m6;
  if (!casadi::to_ptr(argv[5], &arg6)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 6 to type '" "[" "int" "]" "'.");
  if (6<argc) {
    if (!casadi::to_val(argv[6], &arg7)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 7 to type '" "bool" "'.");
  }
  {
    try {
      result = casadi_MatrixCommon_casadi_qr_solve__SWIG_1((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2,(casadi::Matrix< casadi::SXElem > const &)*arg3,(casadi::Matrix< casadi::SXElem > const &)*arg4,(std::vector< long long,std::allocator< long long > > const &)*arg5,(std::vector< long long,std::allocator< long long > > const &)*arg6,arg7);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_qr_solve'."
      "  Prototype:\n"
      "    QR_SOLVE(SX,SX,SX,SX,[int],[int],bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatrixCommon_qr_solve(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 6) && (argc <= 7)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<double> **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::Matrix<double> **>(0));
          if (_v) {
            _v = casadi::to_ptr(argv[4], static_cast< std::vector<casadi_int> **>(0));
            if (_v) {
              _v = casadi::to_ptr(argv[5], static_cast< std::vector<casadi_int> **>(0));
              if (_v) {
                if (argc <= 6) {
                  return _wrap_MatrixCommon_qr_solve__SWIG_0(resc,resv,argc,argv);
                }
                _v = casadi::to_ptr(argv[6], static_cast< bool **>(0));
                if (_v) {
                  return _wrap_MatrixCommon_qr_solve__SWIG_0(resc,resv,argc,argv);
                }
              }
            }
          }
        }
      }
    }
  }
  if ((argc >= 6) && (argc <= 7)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
          if (_v) {
            _v = casadi::to_ptr(argv[4], static_cast< std::vector<casadi_int> **>(0));
            if (_v) {
              _v = casadi::to_ptr(argv[5], static_cast< std::vector<casadi_int> **>(0));
              if (_v) {
                if (argc <= 6) {
                  return _wrap_MatrixCommon_qr_solve__SWIG_1(resc,resv,argc,argv);
                }
                _v = casadi::to_ptr(argv[6], static_cast< bool **>(0));
                if (_v) {
                  return _wrap_MatrixCommon_qr_solve__SWIG_1(resc,resv,argc,argv);
                }
              }
            }
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_qr_solve'."
    "  Possible prototypes are:\n"
    "    QR_SOLVE(DM,DM,DM,DM,[int],[int],bool)\n"
    "    QR_SOLVE(SX,SX,SX,SX,[int],[int],bool)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_MatrixCommon_ldl__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg3 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg4 = 0 ;
  bool arg5 = (bool) true ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  casadi::Matrix< casadi::SXElem > m3 ;
  std::vector< casadi_int > m4 ;
  mxArray * _out;
  
  arg2 = &m2;
  arg3 = &m3;
  arg4 = &m4;
  if (!SWIG_check_num_args("MatrixCommon_ldl",argc,2,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "bool" "'.");
  }
  {
    try {
      casadi_MatrixCommon_casadi_ldl__SWIG_1((casadi::Matrix< casadi::SXElem > const &)*arg1,*arg2,*arg3,*arg4,arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg3);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg4);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_ldl'."
      "  Prototype:\n"
      "    LDL(SX,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatrixCommon_ldl(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 1) && (argc <= 2)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_MatrixCommon_ldl__SWIG_0(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< bool **>(0));
      if (_v) {
        return _wrap_MatrixCommon_ldl__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  if ((argc >= 1) && (argc <= 2)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_MatrixCommon_ldl__SWIG_1(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< bool **>(0));
      if (_v) {
        return _wrap_MatrixCommon_ldl__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_ldl'."
    "  Possible prototypes are:\n"
    "    LDL(DM,bool)\n"
    "    LDL(SX,bool)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_MatrixCommon_ldl_solve__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg3 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg4 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  casadi::Matrix< casadi::SXElem > m3 ;
  std::vector< casadi_int > m4 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("MatrixCommon_ldl_solve",argc,4,4,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "SX" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "[" "int" "]" "'.");
  {
    try {
      result = casadi_MatrixCommon_casadi_ldl_solve__SWIG_1((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2,(casadi::Matrix< casadi::SXElem > const &)*arg3,(std::vector< long long,std::allocator< long long > > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_ldl_solve'."
      "  Prototype:\n"
      "    LDL_SOLVE(SX,SX,SX,[int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatrixCommon_ldl_solve(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 4) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<double> **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< std::vector<casadi_int> **>(0));
          if (_v) {
            return _wrap_MatrixCommon_ldl_solve__SWIG_0(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< std::vector<casadi_int> **>(0));
          if (_v) {
            return _wrap_MatrixCommon_ldl_solve__SWIG_1(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_ldl_solve'."
    "  Possible prototypes are:\n"
    "    LDL_SOLVE(DM,DM,DM,[int])\n"
    "    LDL_SOLVE(SX,SX,SX,[int])\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_MatrixCommon_chol__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("MatrixCommon_chol",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = casadi_MatrixCommon_casadi_chol__SWIG_1((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_chol'."
      "  Prototype:\n"
      "    CHOL(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatrixCommon_chol(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_MatrixCommon_chol__SWIG_0(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_MatrixCommon_chol__SWIG_1(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_chol'."
    "  Possible prototypes are:\n"
    "    CHOL(DM)\n"
    "    CHOL(SX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_MatrixCommon_norm_inf_mul__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("MatrixCommon_norm_inf_mul",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  {
    try {
      result = casadi_MatrixCommon_casadi_norm_inf_mul__SWIG_1((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_norm_inf_mul'."
      "  Prototype:\n"
      "    NORM_INF_MUL(SX,SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatrixCommon_norm_inf_mul(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        return _wrap_MatrixCommon_norm_inf_mul__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        return _wrap_MatrixCommon_norm_inf_mul__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_norm_inf_mul'."
    "  Possible prototypes are:\n"
    "    NORM_INF_MUL(DM,DM)\n"
    "    NORM_INF_MUL(SX,SX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_MatrixCommon_sparsify__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  double arg2 = (double) 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("MatrixCommon_sparsify",argc,2,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "double" "'.");
  }
  {
    try {
      result = casadi_MatrixCommon_casadi_sparsify__SWIG_1((casadi::Matrix< casadi::SXElem > const &)*arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_sparsify'."
      "  Prototype:\n"
      "    SPARSIFY(SX,double)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatrixCommon_sparsify(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 1) && (argc <= 2)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_MatrixCommon_sparsify__SWIG_0(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< double **>(0));
      if (_v) {
        return _wrap_MatrixCommon_sparsify__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  if ((argc >= 1) && (argc <= 2)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_MatrixCommon_sparsify__SWIG_1(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< double **>(0));
      if (_v) {
        return _wrap_MatrixCommon_sparsify__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_sparsify'."
    "  Possible prototypes are:\n"
    "    SPARSIFY(DM,double)\n"
    "    SPARSIFY(SX,double)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_MatrixCommon_expand__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg3 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  casadi::Matrix< casadi::SXElem > m3 ;
  mxArray * _out;
  
  arg2 = &m2;
  arg3 = &m3;
  if (!SWIG_check_num_args("MatrixCommon_expand",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      casadi_MatrixCommon_casadi_expand__SWIG_1((casadi::Matrix< casadi::SXElem > const &)*arg1,*arg2,*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg3);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_expand'."
      "  Prototype:\n"
      "    EXPAND(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatrixCommon_expand(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_MatrixCommon_expand__SWIG_0(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_MatrixCommon_expand__SWIG_1(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_expand'."
    "  Possible prototypes are:\n"
    "    EXPAND(DM)\n"
    "    EXPAND(SX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_MatrixCommon_pw_const__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg3 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  casadi::Matrix< casadi::SXElem > m3 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("MatrixCommon_pw_const",argc,3,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "SX" "'.");
  {
    try {
      result = casadi_MatrixCommon_casadi_pw_const__SWIG_1((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2,(casadi::Matrix< casadi::SXElem > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_pw_const'."
      "  Prototype:\n"
      "    PW_CONST(SX,SX,SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatrixCommon_pw_const(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 3) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<double> **>(0));
        if (_v) {
          return _wrap_MatrixCommon_pw_const__SWIG_0(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
        if (_v) {
          return _wrap_MatrixCommon_pw_const__SWIG_1(resc,resv,argc,argv);
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_pw_const'."
    "  Possible prototypes are:\n"
    "    PW_CONST(DM,DM,DM)\n"
    "    PW_CONST(SX,SX,SX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_MatrixCommon_pw_lin__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg3 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  casadi::Matrix< casadi::SXElem > m3 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("MatrixCommon_pw_lin",argc,3,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "SX" "'.");
  {
    try {
      result = casadi_MatrixCommon_casadi_pw_lin__SWIG_1((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2,(casadi::Matrix< casadi::SXElem > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_pw_lin'."
      "  Prototype:\n"
      "    PW_LIN(SX,SX,SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatrixCommon_pw_lin(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 3) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<double> **>(0));
        if (_v) {
          return _wrap_MatrixCommon_pw_lin__SWIG_0(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
        if (_v) {
          return _wrap_MatrixCommon_pw_lin__SWIG_1(resc,resv,argc,argv);
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_pw_lin'."
    "  Possible prototypes are:\n"
    "    PW_LIN(DM,DM,DM)\n"
    "    PW_LIN(SX,SX,SX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_MatrixCommon_heaviside__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("MatrixCommon_heaviside",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = casadi_MatrixCommon_casadi_heaviside__SWIG_1((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_heaviside'."
      "  Prototype:\n"
      "    HEAVISIDE(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatrixCommon_heaviside(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_MatrixCommon_heaviside__SWIG_0(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_MatrixCommon_heaviside__SWIG_1(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_heaviside'."
    "  Possible prototypes are:\n"
    "    HEAVISIDE(DM)\n"
    "    HEAVISIDE(SX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_MatrixCommon_rectangle__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("MatrixCommon_rectangle",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = casadi_MatrixCommon_casadi_rectangle__SWIG_1((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_rectangle'."
      "  Prototype:\n"
      "    RECTANGLE(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatrixCommon_rectangle(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_MatrixCommon_rectangle__SWIG_0(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_MatrixCommon_rectangle__SWIG_1(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_rectangle'."
    "  Possible prototypes are:\n"
    "    RECTANGLE(DM)\n"
    "    RECTANGLE(SX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_MatrixCommon_triangle__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("MatrixCommon_triangle",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = casadi_MatrixCommon_casadi_triangle__SWIG_1((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_triangle'."
      "  Prototype:\n"
      "    TRIANGLE(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatrixCommon_triangle(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_MatrixCommon_triangle__SWIG_0(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_MatrixCommon_triangle__SWIG_1(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_triangle'."
    "  Possible prototypes are:\n"
    "    TRIANGLE(DM)\n"
    "    TRIANGLE(SX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_MatrixCommon_ramp__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("MatrixCommon_ramp",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = casadi_MatrixCommon_casadi_ramp__SWIG_1((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_ramp'."
      "  Prototype:\n"
      "    RAMP(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatrixCommon_ramp(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_MatrixCommon_ramp__SWIG_0(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_MatrixCommon_ramp__SWIG_1(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_ramp'."
    "  Possible prototypes are:\n"
    "    RAMP(DM)\n"
    "    RAMP(SX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_MatrixCommon_gauss_quadrature__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg3 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg4 = 0 ;
  casadi_int arg5 = (casadi_int) 5 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  casadi::Matrix< casadi::SXElem > m3 ;
  casadi::Matrix< casadi::SXElem > m4 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("MatrixCommon_gauss_quadrature",argc,5,4,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "SX" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "SX" "'.");
  if (4<argc) {
    if (!casadi::to_val(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "int" "'.");
  }
  {
    try {
      result = casadi_MatrixCommon_casadi_gauss_quadrature__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2,(casadi::Matrix< casadi::SXElem > const &)*arg3,(casadi::Matrix< casadi::SXElem > const &)*arg4,arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_gauss_quadrature'."
      "  Prototype:\n"
      "    GAUSS_QUADRATURE(SX,SX,SX,SX,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatrixCommon_gauss_quadrature__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg3 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg4 = 0 ;
  casadi_int arg5 ;
  casadi::Matrix< casadi::SXElem > *arg6 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  casadi::Matrix< casadi::SXElem > m3 ;
  casadi::Matrix< casadi::SXElem > m4 ;
  casadi::Matrix< casadi::SXElem > m6 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("MatrixCommon_gauss_quadrature",argc,6,6,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "SX" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "SX" "'.");
  if (!casadi::to_val(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "int" "'.");
  arg6 = &m6;
  if (!casadi::to_ptr(argv[5], &arg6)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 6 to type '" "SX" "'.");
  {
    try {
      result = casadi_MatrixCommon_casadi_gauss_quadrature__SWIG_3((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2,(casadi::Matrix< casadi::SXElem > const &)*arg3,(casadi::Matrix< casadi::SXElem > const &)*arg4,arg5,(casadi::Matrix< casadi::SXElem > const &)*arg6);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_gauss_quadrature'."
      "  Prototype:\n"
      "    GAUSS_QUADRATURE(SX,SX,SX,SX,int,SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatrixCommon_gauss_quadrature(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 4) && (argc <= 5)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<double> **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::Matrix<double> **>(0));
          if (_v) {
            if (argc <= 4) {
              return _wrap_MatrixCommon_gauss_quadrature__SWIG_0(resc,resv,argc,argv);
            }
            _v = casadi::to_ptr(argv[4], static_cast< casadi_int **>(0));
            if (_v) {
              return _wrap_MatrixCommon_gauss_quadrature__SWIG_0(resc,resv,argc,argv);
            }
          }
        }
      }
    }
  }
  if ((argc >= 4) && (argc <= 5)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
          if (_v) {
            if (argc <= 4) {
              return _wrap_MatrixCommon_gauss_quadrature__SWIG_2(resc,resv,argc,argv);
            }
            _v = casadi::to_ptr(argv[4], static_cast< casadi_int **>(0));
            if (_v) {
              return _wrap_MatrixCommon_gauss_quadrature__SWIG_2(resc,resv,argc,argv);
            }
          }
        }
      }
    }
  }
  if (argc == 6) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<double> **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::Matrix<double> **>(0));
          if (_v) {
            _v = casadi::to_ptr(argv[4], static_cast< casadi_int **>(0));
            if (_v) {
              _v = casadi::to_ptr(argv[5], static_cast< casadi::Matrix<double> **>(0));
              if (_v) {
                return _wrap_MatrixCommon_gauss_quadrature__SWIG_1(resc,resv,argc,argv);
              }
            }
          }
        }
      }
    }
  }
  if (argc == 6) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
          if (_v) {
            _v = casadi::to_ptr(argv[4], static_cast< casadi_int **>(0));
            if (_v) {
              _v = casadi::to_ptr(argv[5], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
              if (_v) {
                return _wrap_MatrixCommon_gauss_quadrature__SWIG_3(resc,resv,argc,argv);
              }
            }
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_gauss_quadrature'."
    "  Possible prototypes are:\n"
    "    GAUSS_QUADRATURE(DM,DM,DM,DM,int)\n"
    "    GAUSS_QUADRATURE(SX,SX,SX,SX,int)\n"
    "    GAUSS_QUADRATURE(DM,DM,DM,DM,int,DM)\n"
    "    GAUSS_QUADRATURE(SX,SX,SX,SX,int,SX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_MatrixCommon_taylor__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > const &arg3_defvalue = 0 ;
  casadi::Matrix< casadi::SXElem > *arg3 = (casadi::Matrix< casadi::SXElem > *) &arg3_defvalue ;
  casadi_int arg4 = (casadi_int) 1 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  casadi::Matrix< casadi::SXElem > m3 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("MatrixCommon_taylor",argc,4,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  if (2<argc) {
    arg3 = &m3;
    if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "SX" "'.");
  }
  if (3<argc) {
    if (!casadi::to_val(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "int" "'.");
  }
  {
    try {
      result = casadi_MatrixCommon_casadi_taylor__SWIG_1((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2,(casadi::Matrix< casadi::SXElem > const &)*arg3,arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_taylor'."
      "  Prototype:\n"
      "    TAYLOR(SX,SX,SX,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatrixCommon_taylor(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 2) && (argc <= 4)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_MatrixCommon_taylor__SWIG_0(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<double> **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_MatrixCommon_taylor__SWIG_0(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< casadi_int **>(0));
          if (_v) {
            return _wrap_MatrixCommon_taylor__SWIG_0(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if ((argc >= 2) && (argc <= 4)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_MatrixCommon_taylor__SWIG_1(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_MatrixCommon_taylor__SWIG_1(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< casadi_int **>(0));
          if (_v) {
            return _wrap_MatrixCommon_taylor__SWIG_1(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_taylor'."
    "  Possible prototypes are:\n"
    "    TAYLOR(DM,DM,DM,int)\n"
    "    TAYLOR(SX,SX,SX,int)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_MatrixCommon_mtaylor__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg3 = 0 ;
  casadi_int arg4 = (casadi_int) 1 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  casadi::Matrix< casadi::SXElem > m3 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("MatrixCommon_mtaylor",argc,4,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "SX" "'.");
  if (3<argc) {
    if (!casadi::to_val(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "int" "'.");
  }
  {
    try {
      result = casadi_MatrixCommon_casadi_mtaylor__SWIG_2((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2,(casadi::Matrix< casadi::SXElem > const &)*arg3,arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_mtaylor'."
      "  Prototype:\n"
      "    MTAYLOR(SX,SX,SX,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatrixCommon_mtaylor__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg3 = 0 ;
  casadi_int arg4 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg5 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  casadi::Matrix< casadi::SXElem > m3 ;
  std::vector< casadi_int > m5 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("MatrixCommon_mtaylor",argc,5,5,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "SX" "'.");
  if (!casadi::to_val(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "int" "'.");
  arg5 = &m5;
  if (!casadi::to_ptr(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "[" "int" "]" "'.");
  {
    try {
      result = casadi_MatrixCommon_casadi_mtaylor__SWIG_3((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2,(casadi::Matrix< casadi::SXElem > const &)*arg3,arg4,(std::vector< long long,std::allocator< long long > > const &)*arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_mtaylor'."
      "  Prototype:\n"
      "    MTAYLOR(SX,SX,SX,int,[int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatrixCommon_mtaylor(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 3) && (argc <= 4)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<double> **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_MatrixCommon_mtaylor__SWIG_0(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< casadi_int **>(0));
          if (_v) {
            return _wrap_MatrixCommon_mtaylor__SWIG_0(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if ((argc >= 3) && (argc <= 4)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_MatrixCommon_mtaylor__SWIG_2(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< casadi_int **>(0));
          if (_v) {
            return _wrap_MatrixCommon_mtaylor__SWIG_2(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if (argc == 5) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<double> **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi_int **>(0));
          if (_v) {
            _v = casadi::to_ptr(argv[4], static_cast< std::vector<casadi_int> **>(0));
            if (_v) {
              return _wrap_MatrixCommon_mtaylor__SWIG_1(resc,resv,argc,argv);
            }
          }
        }
      }
    }
  }
  if (argc == 5) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi_int **>(0));
          if (_v) {
            _v = casadi::to_ptr(argv[4], static_cast< std::vector<casadi_int> **>(0));
            if (_v) {
              return _wrap_MatrixCommon_mtaylor__SWIG_3(resc,resv,argc,argv);
            }
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_mtaylor'."
    "  Possible prototypes are:\n"
    "    MTAYLOR(DM,DM,DM,int)\n"
    "    MTAYLOR(SX,SX,SX,int)\n"
    "    MTAYLOR(DM,DM,DM,int,[int])\n"
    "    MTAYLOR(SX,SX,SX,int,[int])\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_MatrixCommon_poly_coeff__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("MatrixCommon_poly_coeff",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  {
    try {
      result = casadi_MatrixCommon_casadi_poly_coeff__SWIG_1((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_poly_coeff'."
      "  Prototype:\n"
      "    POLY_COEFF(SX,SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatrixCommon_poly_coeff(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        return _wrap_MatrixCommon_poly_coeff__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        return _wrap_MatrixCommon_poly_coeff__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_poly_coeff'."
    "  Possible prototypes are:\n"
    "    POLY_COEFF(DM,DM)\n"
    "    POLY_COEFF(SX,SX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_MatrixCommon_poly_roots__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("MatrixCommon_poly_roots",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = casadi_MatrixCommon_casadi_poly_roots__SWIG_1((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_poly_roots'."
      "  Prototype:\n"
      "    POLY_ROOTS(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatrixCommon_poly_roots(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_MatrixCommon_poly_roots__SWIG_0(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_MatrixCommon_poly_roots__SWIG_1(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_poly_roots'."
    "  Possible prototypes are:\n"
    "    POLY_ROOTS(DM)\n"
    "    POLY_ROOTS(SX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_MatrixCommon_eig_symbolic__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("MatrixCommon_eig_symbolic",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = casadi_MatrixCommon_casadi_eig_symbolic__SWIG_1((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_eig_symbolic'."
      "  Prototype:\n"
      "    EIG_SYMBOLIC(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MatrixCommon_eig_symbolic(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_MatrixCommon_eig_symbolic__SWIG_0(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_MatrixCommon_eig_symbolic__SWIG_1(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MatrixCommon_eig_symbolic'."
    "  Possible prototypes are:\n"
    "    EIG_SYMBOLIC(DM)\n"
    "    EIG_SYMBOLIC(SX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_new_MatrixCommon__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  casadi::MatrixCommon *result = 0 ;
  
  if (!SWIG_check_num_args("new_MatrixCommon",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    result = (casadi::MatrixCommon *)new casadi::MatrixCommon();
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__MatrixCommon, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_MatrixCommon'."
      "  Prototype:\n"
      "    MATRIXCOMMON()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_MatrixCommon__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MatrixCommon *arg1 = 0 ;
  void *argp1 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::MatrixCommon *result = 0 ;
  
  if (!SWIG_check_num_args("new_MatrixCommon",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_casadi__MatrixCommon,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_MatrixCommon" "', argument " "1"" of type '" "casadi::MatrixCommon const &""'"); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_MatrixCommon" "', argument " "1"" of type '" "casadi::MatrixCommon const &""'"); 
  }
  arg1 = reinterpret_cast< casadi::MatrixCommon * >(argp1);
  {
    result = (casadi::MatrixCommon *)new casadi::MatrixCommon((casadi::MatrixCommon const &)*arg1);
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__MatrixCommon, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_MatrixCommon'."
      "  Prototype:\n"
      "    MATRIXCOMMON(MatrixCommon)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_MatrixCommon(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 0) {
    return _wrap_new_MatrixCommon__SWIG_0(resc,resv,argc,argv);
  }
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixCommon, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_new_MatrixCommon__SWIG_1(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_MatrixCommon'."
    "  Possible prototypes are:\n"
    "    MATRIXCOMMON()\n"
    "    MATRIXCOMMON(MatrixCommon)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_delete_MatrixCommon(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MatrixCommon *arg1 = (casadi::MatrixCommon *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  int is_owned;
  if (!SWIG_check_num_args("delete_MatrixCommon",argc,1,1,0)) {
    SWIG_fail;
  }
  is_owned = SWIG_Matlab_isOwned(argv[0]);
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixCommon, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_MatrixCommon" "', argument " "1"" of type '" "casadi::MatrixCommon *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MatrixCommon * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  if (is_owned) {
    {
      delete arg1;
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'delete_MatrixCommon'."
      "  Prototype:\n"
      "    MATRIXCOMMON(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_DM__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  casadi::Matrix< double > *result = 0 ;
  
  if (!SWIG_check_num_args("new_DM",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      result = (casadi::Matrix< double > *)new casadi::Matrix< double >();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__MatrixT_double_t, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_DM'."
      "  Prototype:\n"
      "    DM()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_DM__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< double > *result = 0 ;
  
  if (!SWIG_check_num_args("new_DM",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = (casadi::Matrix< double > *)new casadi::Matrix< double >((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__MatrixT_double_t, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_DM'."
      "  Prototype:\n"
      "    DM(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_DM__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 ;
  casadi_int arg2 ;
  mxArray * _out;
  casadi::Matrix< double > *result = 0 ;
  
  if (!SWIG_check_num_args("new_DM",argc,2,2,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  {
    try {
      result = (casadi::Matrix< double > *)new casadi::Matrix< double >(arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__MatrixT_double_t, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_DM'."
      "  Prototype:\n"
      "    DM(int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_DM__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = 0 ;
  casadi::Sparsity m1 ;
  mxArray * _out;
  casadi::Matrix< double > *result = 0 ;
  
  if (!SWIG_check_num_args("new_DM",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Sparsity" "'.");
  {
    try {
      result = (casadi::Matrix< double > *)new casadi::Matrix< double >((casadi::Sparsity const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__MatrixT_double_t, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_DM'."
      "  Prototype:\n"
      "    DM(Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_DM__SWIG_4(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Sparsity m1 ;
  casadi::Matrix< double > m2 ;
  mxArray * _out;
  casadi::Matrix< double > *result = 0 ;
  
  if (!SWIG_check_num_args("new_DM",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Sparsity" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  {
    try {
      result = (casadi::Matrix< double > *)new casadi::Matrix< double >((casadi::Sparsity const &)*arg1,(casadi::Matrix< double > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__MatrixT_double_t, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_DM'."
      "  Prototype:\n"
      "    DM(Sparsity,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_DM__SWIG_5(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  double arg1 ;
  mxArray * _out;
  casadi::Matrix< double > *result = 0 ;
  
  if (!SWIG_check_num_args("new_DM",argc,1,1,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "double" "'.");
  {
    try {
      result = (casadi::Matrix< double > *)new casadi::Matrix< double >(arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__MatrixT_double_t, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_DM'."
      "  Prototype:\n"
      "    DM(double)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_has_nz(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  casadi_int arg2 ;
  casadi_int arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("DM_has_nz",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_has_nz" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Matrix< double > const *)arg1)->has_nz(arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_has_nz'."
      "  Prototype:\n"
      "    HAS_NZ(self,int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_nonzero(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("DM_nonzero",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_nonzero" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Matrix< double > const *)arg1)->__nonzero__();
    } catch (const std::exception& e) {
      SWIG_exception(SWIG_TypeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_nonzero'."
      "  Prototype:\n"
      "    NONZERO(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_get__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  bool arg3 ;
  casadi::Slice *arg4 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< double > m2 ;
  casadi::Slice m4 ;
  mxArray * _out;
  
  arg2 = &m2;
  if (!SWIG_check_num_args("DM_get",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_get" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  if (!casadi::to_val(argv[1], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[2], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "Slice" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Matrix< double > const *)arg1)->get(*arg2,arg3,(casadi::Slice const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_get'."
      "  Prototype:\n"
      "    GET(self,bool,Slice)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_get__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  bool arg3 ;
  casadi::Matrix< casadi_int > *arg4 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< double > m2 ;
  casadi::Matrix< casadi_int > m4 ;
  mxArray * _out;
  
  arg2 = &m2;
  if (!SWIG_check_num_args("DM_get",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_get" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  if (!casadi::to_val(argv[1], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[2], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "IM" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Matrix< double > const *)arg1)->get(*arg2,arg3,(casadi::Matrix< casadi_int > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_get'."
      "  Prototype:\n"
      "    GET(self,bool,IM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_get__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  bool arg3 ;
  casadi::Sparsity *arg4 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< double > m2 ;
  casadi::Sparsity m4 ;
  mxArray * _out;
  
  arg2 = &m2;
  if (!SWIG_check_num_args("DM_get",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_get" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  if (!casadi::to_val(argv[1], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[2], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "Sparsity" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Matrix< double > const *)arg1)->get(*arg2,arg3,(casadi::Sparsity const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_get'."
      "  Prototype:\n"
      "    GET(self,bool,Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_get__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  bool arg3 ;
  casadi::Slice *arg4 = 0 ;
  casadi::Slice *arg5 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< double > m2 ;
  casadi::Slice m4 ;
  casadi::Slice m5 ;
  mxArray * _out;
  
  arg2 = &m2;
  if (!SWIG_check_num_args("DM_get",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_get" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  if (!casadi::to_val(argv[1], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[2], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "Slice" "'.");
  arg5 = &m5;
  if (!casadi::to_ptr(argv[3], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "Slice" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Matrix< double > const *)arg1)->get(*arg2,arg3,(casadi::Slice const &)*arg4,(casadi::Slice const &)*arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_get'."
      "  Prototype:\n"
      "    GET(self,bool,Slice,Slice)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_get__SWIG_4(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  bool arg3 ;
  casadi::Slice *arg4 = 0 ;
  casadi::Matrix< casadi_int > *arg5 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< double > m2 ;
  casadi::Slice m4 ;
  casadi::Matrix< casadi_int > m5 ;
  mxArray * _out;
  
  arg2 = &m2;
  if (!SWIG_check_num_args("DM_get",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_get" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  if (!casadi::to_val(argv[1], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[2], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "Slice" "'.");
  arg5 = &m5;
  if (!casadi::to_ptr(argv[3], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "IM" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Matrix< double > const *)arg1)->get(*arg2,arg3,(casadi::Slice const &)*arg4,(casadi::Matrix< casadi_int > const &)*arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_get'."
      "  Prototype:\n"
      "    GET(self,bool,Slice,IM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_get__SWIG_5(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  bool arg3 ;
  casadi::Matrix< casadi_int > *arg4 = 0 ;
  casadi::Slice *arg5 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< double > m2 ;
  casadi::Matrix< casadi_int > m4 ;
  casadi::Slice m5 ;
  mxArray * _out;
  
  arg2 = &m2;
  if (!SWIG_check_num_args("DM_get",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_get" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  if (!casadi::to_val(argv[1], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[2], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "IM" "'.");
  arg5 = &m5;
  if (!casadi::to_ptr(argv[3], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "Slice" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Matrix< double > const *)arg1)->get(*arg2,arg3,(casadi::Matrix< casadi_int > const &)*arg4,(casadi::Slice const &)*arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_get'."
      "  Prototype:\n"
      "    GET(self,bool,IM,Slice)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_get__SWIG_6(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  bool arg3 ;
  casadi::Matrix< casadi_int > *arg4 = 0 ;
  casadi::Matrix< casadi_int > *arg5 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< double > m2 ;
  casadi::Matrix< casadi_int > m4 ;
  casadi::Matrix< casadi_int > m5 ;
  mxArray * _out;
  
  arg2 = &m2;
  if (!SWIG_check_num_args("DM_get",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_get" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  if (!casadi::to_val(argv[1], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[2], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "IM" "'.");
  arg5 = &m5;
  if (!casadi::to_ptr(argv[3], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "IM" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Matrix< double > const *)arg1)->get(*arg2,arg3,(casadi::Matrix< casadi_int > const &)*arg4,(casadi::Matrix< casadi_int > const &)*arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_get'."
      "  Prototype:\n"
      "    GET(self,bool,IM,IM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_get(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_double_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< bool **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Sparsity **>(0));
        if (_v) {
          return _wrap_DM_get__SWIG_2(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_double_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< bool **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Slice **>(0));
        if (_v) {
          return _wrap_DM_get__SWIG_0(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_double_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< bool **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<casadi_int> **>(0));
        if (_v) {
          return _wrap_DM_get__SWIG_1(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_double_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< bool **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Slice **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::Slice **>(0));
          if (_v) {
            return _wrap_DM_get__SWIG_3(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_double_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< bool **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Slice **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::Matrix<casadi_int> **>(0));
          if (_v) {
            return _wrap_DM_get__SWIG_4(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_double_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< bool **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<casadi_int> **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::Slice **>(0));
          if (_v) {
            return _wrap_DM_get__SWIG_5(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_double_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< bool **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<casadi_int> **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::Matrix<casadi_int> **>(0));
          if (_v) {
            return _wrap_DM_get__SWIG_6(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_get'."
    "  Possible prototypes are:\n"
    "    GET(self,bool,Sparsity)\n"
    "    GET(self,bool,Slice)\n"
    "    GET(self,bool,IM)\n"
    "    GET(self,bool,Slice,Slice)\n"
    "    GET(self,bool,Slice,IM)\n"
    "    GET(self,bool,IM,Slice)\n"
    "    GET(self,bool,IM,IM)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_DM_set__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  bool arg3 ;
  casadi::Slice *arg4 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< double > m2 ;
  casadi::Slice m4 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DM_set",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_set" "', argument " "1"" of type '" "casadi::Matrix< double > *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "Slice" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->set((casadi::Matrix< double > const &)*arg2,arg3,(casadi::Slice const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_set'."
      "  Prototype:\n"
      "    SET(self,DM,bool,Slice)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_set__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  bool arg3 ;
  casadi::Matrix< casadi_int > *arg4 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< double > m2 ;
  casadi::Matrix< casadi_int > m4 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DM_set",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_set" "', argument " "1"" of type '" "casadi::Matrix< double > *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "IM" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->set((casadi::Matrix< double > const &)*arg2,arg3,(casadi::Matrix< casadi_int > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_set'."
      "  Prototype:\n"
      "    SET(self,DM,bool,IM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_set__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  bool arg3 ;
  casadi::Sparsity *arg4 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< double > m2 ;
  casadi::Sparsity m4 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DM_set",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_set" "', argument " "1"" of type '" "casadi::Matrix< double > *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "Sparsity" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->set((casadi::Matrix< double > const &)*arg2,arg3,(casadi::Sparsity const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_set'."
      "  Prototype:\n"
      "    SET(self,DM,bool,Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_set__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  bool arg3 ;
  casadi::Slice *arg4 = 0 ;
  casadi::Slice *arg5 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< double > m2 ;
  casadi::Slice m4 ;
  casadi::Slice m5 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DM_set",argc,5,5,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_set" "', argument " "1"" of type '" "casadi::Matrix< double > *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "Slice" "'.");
  arg5 = &m5;
  if (!casadi::to_ptr(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "Slice" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->set((casadi::Matrix< double > const &)*arg2,arg3,(casadi::Slice const &)*arg4,(casadi::Slice const &)*arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_set'."
      "  Prototype:\n"
      "    SET(self,DM,bool,Slice,Slice)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_set__SWIG_4(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  bool arg3 ;
  casadi::Slice *arg4 = 0 ;
  casadi::Matrix< casadi_int > *arg5 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< double > m2 ;
  casadi::Slice m4 ;
  casadi::Matrix< casadi_int > m5 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DM_set",argc,5,5,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_set" "', argument " "1"" of type '" "casadi::Matrix< double > *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "Slice" "'.");
  arg5 = &m5;
  if (!casadi::to_ptr(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "IM" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->set((casadi::Matrix< double > const &)*arg2,arg3,(casadi::Slice const &)*arg4,(casadi::Matrix< casadi_int > const &)*arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_set'."
      "  Prototype:\n"
      "    SET(self,DM,bool,Slice,IM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_set__SWIG_5(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  bool arg3 ;
  casadi::Matrix< casadi_int > *arg4 = 0 ;
  casadi::Slice *arg5 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< double > m2 ;
  casadi::Matrix< casadi_int > m4 ;
  casadi::Slice m5 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DM_set",argc,5,5,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_set" "', argument " "1"" of type '" "casadi::Matrix< double > *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "IM" "'.");
  arg5 = &m5;
  if (!casadi::to_ptr(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "Slice" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->set((casadi::Matrix< double > const &)*arg2,arg3,(casadi::Matrix< casadi_int > const &)*arg4,(casadi::Slice const &)*arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_set'."
      "  Prototype:\n"
      "    SET(self,DM,bool,IM,Slice)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_set__SWIG_6(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  bool arg3 ;
  casadi::Matrix< casadi_int > *arg4 = 0 ;
  casadi::Matrix< casadi_int > *arg5 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< double > m2 ;
  casadi::Matrix< casadi_int > m4 ;
  casadi::Matrix< casadi_int > m5 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DM_set",argc,5,5,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_set" "', argument " "1"" of type '" "casadi::Matrix< double > *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "IM" "'.");
  arg5 = &m5;
  if (!casadi::to_ptr(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "IM" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->set((casadi::Matrix< double > const &)*arg2,arg3,(casadi::Matrix< casadi_int > const &)*arg4,(casadi::Matrix< casadi_int > const &)*arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_set'."
      "  Prototype:\n"
      "    SET(self,DM,bool,IM,IM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_set(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_double_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< bool **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::Sparsity **>(0));
          if (_v) {
            return _wrap_DM_set__SWIG_2(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_double_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< bool **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::Slice **>(0));
          if (_v) {
            return _wrap_DM_set__SWIG_0(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_double_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< bool **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::Matrix<casadi_int> **>(0));
          if (_v) {
            return _wrap_DM_set__SWIG_1(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if (argc == 5) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_double_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< bool **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::Slice **>(0));
          if (_v) {
            _v = casadi::to_ptr(argv[4], static_cast< casadi::Slice **>(0));
            if (_v) {
              return _wrap_DM_set__SWIG_3(resc,resv,argc,argv);
            }
          }
        }
      }
    }
  }
  if (argc == 5) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_double_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< bool **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::Slice **>(0));
          if (_v) {
            _v = casadi::to_ptr(argv[4], static_cast< casadi::Matrix<casadi_int> **>(0));
            if (_v) {
              return _wrap_DM_set__SWIG_4(resc,resv,argc,argv);
            }
          }
        }
      }
    }
  }
  if (argc == 5) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_double_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< bool **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::Matrix<casadi_int> **>(0));
          if (_v) {
            _v = casadi::to_ptr(argv[4], static_cast< casadi::Slice **>(0));
            if (_v) {
              return _wrap_DM_set__SWIG_5(resc,resv,argc,argv);
            }
          }
        }
      }
    }
  }
  if (argc == 5) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_double_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< bool **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::Matrix<casadi_int> **>(0));
          if (_v) {
            _v = casadi::to_ptr(argv[4], static_cast< casadi::Matrix<casadi_int> **>(0));
            if (_v) {
              return _wrap_DM_set__SWIG_6(resc,resv,argc,argv);
            }
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_set'."
    "  Possible prototypes are:\n"
    "    SET(self,DM,bool,Sparsity)\n"
    "    SET(self,DM,bool,Slice)\n"
    "    SET(self,DM,bool,IM)\n"
    "    SET(self,DM,bool,Slice,Slice)\n"
    "    SET(self,DM,bool,Slice,IM)\n"
    "    SET(self,DM,bool,IM,Slice)\n"
    "    SET(self,DM,bool,IM,IM)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_DM_get_nz__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  bool arg3 ;
  casadi::Slice *arg4 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< double > m2 ;
  casadi::Slice m4 ;
  mxArray * _out;
  
  arg2 = &m2;
  if (!SWIG_check_num_args("DM_get_nz",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_get_nz" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  if (!casadi::to_val(argv[1], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[2], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "Slice" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Matrix< double > const *)arg1)->get_nz(*arg2,arg3,(casadi::Slice const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_get_nz'."
      "  Prototype:\n"
      "    GET_NZ(self,bool,Slice)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_get_nz__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  bool arg3 ;
  casadi::Matrix< casadi_int > *arg4 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< double > m2 ;
  casadi::Matrix< casadi_int > m4 ;
  mxArray * _out;
  
  arg2 = &m2;
  if (!SWIG_check_num_args("DM_get_nz",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_get_nz" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  if (!casadi::to_val(argv[1], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[2], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "IM" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Matrix< double > const *)arg1)->get_nz(*arg2,arg3,(casadi::Matrix< casadi_int > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_get_nz'."
      "  Prototype:\n"
      "    GET_NZ(self,bool,IM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_get_nz(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_double_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< bool **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Slice **>(0));
        if (_v) {
          return _wrap_DM_get_nz__SWIG_0(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_double_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< bool **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<casadi_int> **>(0));
        if (_v) {
          return _wrap_DM_get_nz__SWIG_1(resc,resv,argc,argv);
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_get_nz'."
    "  Possible prototypes are:\n"
    "    GET_NZ(self,bool,Slice)\n"
    "    GET_NZ(self,bool,IM)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_DM_set_nz__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  bool arg3 ;
  casadi::Slice *arg4 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< double > m2 ;
  casadi::Slice m4 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DM_set_nz",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_set_nz" "', argument " "1"" of type '" "casadi::Matrix< double > *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "Slice" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->set_nz((casadi::Matrix< double > const &)*arg2,arg3,(casadi::Slice const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_set_nz'."
      "  Prototype:\n"
      "    SET_NZ(self,DM,bool,Slice)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_set_nz__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  bool arg3 ;
  casadi::Matrix< casadi_int > *arg4 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< double > m2 ;
  casadi::Matrix< casadi_int > m4 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DM_set_nz",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_set_nz" "', argument " "1"" of type '" "casadi::Matrix< double > *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "IM" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->set_nz((casadi::Matrix< double > const &)*arg2,arg3,(casadi::Matrix< casadi_int > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_set_nz'."
      "  Prototype:\n"
      "    SET_NZ(self,DM,bool,IM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_set_nz(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_double_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< bool **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::Slice **>(0));
          if (_v) {
            return _wrap_DM_set_nz__SWIG_0(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_double_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< bool **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::Matrix<casadi_int> **>(0));
          if (_v) {
            return _wrap_DM_set_nz__SWIG_1(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_set_nz'."
    "  Possible prototypes are:\n"
    "    SET_NZ(self,DM,bool,Slice)\n"
    "    SET_NZ(self,DM,bool,IM)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_DM_uplus(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("DM_uplus",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_uplus" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Matrix< double > const *)arg1)->operator +();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_uplus'."
      "  Prototype:\n"
      "    UPLUS(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_uminus(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("DM_uminus",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_uminus" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Matrix< double > const *)arg1)->operator -();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_uminus'."
      "  Prototype:\n"
      "    UMINUS(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_binary(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > *arg3 = 0 ;
  casadi::Matrix< double > m2 ;
  casadi::Matrix< double > m3 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("DM_binary",argc,3,3,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "DM" "'.");
  {
    try {
      result = casadi::Matrix< double >::SWIGTEMPLATEDISAMBIGUATOR binary(arg1,(casadi::Matrix< double > const &)*arg2,(casadi::Matrix< double > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_binary'."
      "  Prototype:\n"
      "    BINARY(int,DM,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_unary(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > m2 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("DM_unary",argc,2,2,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  {
    try {
      result = casadi::Matrix< double >::SWIGTEMPLATEDISAMBIGUATOR unary(arg1,(casadi::Matrix< double > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_unary'."
      "  Prototype:\n"
      "    UNARY(int,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_scalar_matrix(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > *arg3 = 0 ;
  casadi::Matrix< double > m2 ;
  casadi::Matrix< double > m3 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("DM_scalar_matrix",argc,3,3,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "DM" "'.");
  {
    try {
      result = casadi::Matrix< double >::SWIGTEMPLATEDISAMBIGUATOR scalar_matrix(arg1,(casadi::Matrix< double > const &)*arg2,(casadi::Matrix< double > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_scalar_matrix'."
      "  Prototype:\n"
      "    SCALAR_MATRIX(int,DM,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_matrix_scalar(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > *arg3 = 0 ;
  casadi::Matrix< double > m2 ;
  casadi::Matrix< double > m3 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("DM_matrix_scalar",argc,3,3,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "DM" "'.");
  {
    try {
      result = casadi::Matrix< double >::SWIGTEMPLATEDISAMBIGUATOR matrix_scalar(arg1,(casadi::Matrix< double > const &)*arg2,(casadi::Matrix< double > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_matrix_scalar'."
      "  Prototype:\n"
      "    MATRIX_SCALAR(int,DM,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_matrix_matrix(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > *arg3 = 0 ;
  casadi::Matrix< double > m2 ;
  casadi::Matrix< double > m3 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("DM_matrix_matrix",argc,3,3,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "DM" "'.");
  {
    try {
      result = casadi::Matrix< double >::SWIGTEMPLATEDISAMBIGUATOR matrix_matrix(arg1,(casadi::Matrix< double > const &)*arg2,(casadi::Matrix< double > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_matrix_matrix'."
      "  Prototype:\n"
      "    MATRIX_MATRIX(int,DM,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_printme(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< double > m2 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("DM_printme",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_printme" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Matrix< double > const *)arg1)->printme((casadi::Matrix< double > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_printme'."
      "  Prototype:\n"
      "    PRINTME(self,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_T(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("DM_T",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_T" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Matrix< double > const *)arg1)->T();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_T'."
      "  Prototype:\n"
      "    T(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_set_max_depth(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 = (casadi_int) 1 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DM_set_max_depth",argc,1,0,0)) {
    SWIG_fail;
  }
  if (0<argc) {
    if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  }
  {
    try {
      casadi::Matrix< double >::SWIGTEMPLATEDISAMBIGUATOR set_max_depth(arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_set_max_depth'."
      "  Prototype:\n"
      "    SET_MAX_DEPTH(int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_get_max_depth(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("DM_get_max_depth",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      result = (casadi_int)casadi::Matrix< double >::SWIGTEMPLATEDISAMBIGUATOR get_max_depth();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_get_max_depth'."
      "  Prototype:\n"
      "    GET_MAX_DEPTH()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_get_input(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = 0 ;
  casadi::Function m1 ;
  mxArray * _out;
  std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > result;
  
  if (!SWIG_check_num_args("DM_get_input",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Function" "'.");
  {
    try {
      result = casadi::Matrix< double >::SWIGTEMPLATEDISAMBIGUATOR get_input((casadi::Function const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "DM" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_get_input'."
      "  Prototype:\n"
      "    GET_INPUT(Function)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_get_free(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = 0 ;
  casadi::Function m1 ;
  mxArray * _out;
  std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > result;
  
  if (!SWIG_check_num_args("DM_get_free",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Function" "'.");
  {
    try {
      result = casadi::Matrix< double >::SWIGTEMPLATEDISAMBIGUATOR get_free((casadi::Function const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "DM" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_get_free'."
      "  Prototype:\n"
      "    GET_FREE(Function)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_type_name(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("DM_type_name",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      result = casadi::Matrix< double >::SWIGTEMPLATEDISAMBIGUATOR type_name();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_type_name'."
      "  Prototype:\n"
      "    TYPE_NAME()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_print_split(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg2 = 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< std::string > m2 ;
  std::vector< std::string > m3 ;
  mxArray * _out;
  
  arg2 = &m2;
  arg3 = &m3;
  if (!SWIG_check_num_args("DM_print_split",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_print_split" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Matrix< double > const *)arg1)->print_split(*arg2,*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg3);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_print_split'."
      "  Prototype:\n"
      "    PRINT_SPLIT(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_disp(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  std::ostream *arg2 = 0 ;
  bool arg3 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  arg2 = &casadi::uout();
  if (!SWIG_check_num_args("DM_disp",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_disp" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Matrix< double > const *)arg1)->disp(*arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  *arg2 << "\n" << std::flush;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_disp'."
      "  Prototype:\n"
      "    DISP(self,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_str(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  bool arg2 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("DM_str",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_str" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Matrix< double > const *)arg1)->get_str(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_str'."
      "  Prototype:\n"
      "    STR(self,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_print_scalar(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  std::ostream *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  arg2 = &casadi::uout();
  if (!SWIG_check_num_args("DM_print_scalar",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_print_scalar" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Matrix< double > const *)arg1)->print_scalar(*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  *arg2 << "\n" << std::flush;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_print_scalar'."
      "  Prototype:\n"
      "    PRINT_SCALAR(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_print_vector(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  std::ostream *arg2 = 0 ;
  bool arg3 = (bool) true ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  arg2 = &casadi::uout();
  if (!SWIG_check_num_args("DM_print_vector",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_print_vector" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Matrix< double > const *)arg1)->print_vector(*arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  *arg2 << "\n" << std::flush;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_print_vector'."
      "  Prototype:\n"
      "    PRINT_VECTOR(self,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_print_dense(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  std::ostream *arg2 = 0 ;
  bool arg3 = (bool) true ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  arg2 = &casadi::uout();
  if (!SWIG_check_num_args("DM_print_dense",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_print_dense" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Matrix< double > const *)arg1)->print_dense(*arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  *arg2 << "\n" << std::flush;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_print_dense'."
      "  Prototype:\n"
      "    PRINT_DENSE(self,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_print_sparse(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  std::ostream *arg2 = 0 ;
  bool arg3 = (bool) true ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  arg2 = &casadi::uout();
  if (!SWIG_check_num_args("DM_print_sparse",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_print_sparse" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Matrix< double > const *)arg1)->print_sparse(*arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  *arg2 << "\n" << std::flush;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_print_sparse'."
      "  Prototype:\n"
      "    PRINT_SPARSE(self,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_clear(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DM_clear",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_clear" "', argument " "1"" of type '" "casadi::Matrix< double > *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->clear();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_clear'."
      "  Prototype:\n"
      "    CLEAR(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_resize(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  casadi_int arg2 ;
  casadi_int arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DM_resize",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_resize" "', argument " "1"" of type '" "casadi::Matrix< double > *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->resize(arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_resize'."
      "  Prototype:\n"
      "    RESIZE(self,int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_reserve__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  casadi_int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DM_reserve",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_reserve" "', argument " "1"" of type '" "casadi::Matrix< double > *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->reserve(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_reserve'."
      "  Prototype:\n"
      "    RESERVE(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_reserve__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  casadi_int arg2 ;
  casadi_int arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DM_reserve",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_reserve" "', argument " "1"" of type '" "casadi::Matrix< double > *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->reserve(arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_reserve'."
      "  Prototype:\n"
      "    RESERVE(self,int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_reserve(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_double_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_DM_reserve__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_double_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          return _wrap_DM_reserve__SWIG_1(resc,resv,argc,argv);
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_reserve'."
    "  Possible prototypes are:\n"
    "    RESERVE(self,int)\n"
    "    RESERVE(self,int,int)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_DM_erase__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg2 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg3 = 0 ;
  bool arg4 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< casadi_int > m2 ;
  std::vector< casadi_int > m3 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DM_erase",argc,4,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_erase" "', argument " "1"" of type '" "casadi::Matrix< double > *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "[" "int" "]" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "[" "int" "]" "'.");
  if (3<argc) {
    if (!casadi::to_val(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->erase((std::vector< casadi_int,std::allocator< casadi_int > > const &)*arg2,(std::vector< casadi_int,std::allocator< casadi_int > > const &)*arg3,arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_erase'."
      "  Prototype:\n"
      "    ERASE(self,[int],[int],bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_erase__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg2 = 0 ;
  bool arg3 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< casadi_int > m2 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DM_erase",argc,3,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_erase" "', argument " "1"" of type '" "casadi::Matrix< double > *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "[" "int" "]" "'.");
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->erase((std::vector< casadi_int,std::allocator< casadi_int > > const &)*arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_erase'."
      "  Prototype:\n"
      "    ERASE(self,[int],bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_erase(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 2) && (argc <= 3)) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_double_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<casadi_int> **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_DM_erase__SWIG_1(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< bool **>(0));
        if (_v) {
          return _wrap_DM_erase__SWIG_1(resc,resv,argc,argv);
        }
      }
    }
  }
  if ((argc >= 3) && (argc <= 4)) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_double_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<casadi_int> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::vector<casadi_int> **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_DM_erase__SWIG_0(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< bool **>(0));
          if (_v) {
            return _wrap_DM_erase__SWIG_0(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_erase'."
    "  Possible prototypes are:\n"
    "    ERASE(self,[int],bool)\n"
    "    ERASE(self,[int],[int],bool)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_DM_remove(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg2 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< casadi_int > m2 ;
  std::vector< casadi_int > m3 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DM_remove",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_remove" "', argument " "1"" of type '" "casadi::Matrix< double > *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "[" "int" "]" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "[" "int" "]" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->remove((std::vector< casadi_int,std::allocator< casadi_int > > const &)*arg2,(std::vector< casadi_int,std::allocator< casadi_int > > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_remove'."
      "  Prototype:\n"
      "    REMOVE(self,[int],[int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_enlarge(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  casadi_int arg2 ;
  casadi_int arg3 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg4 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg5 = 0 ;
  bool arg6 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< casadi_int > m4 ;
  std::vector< casadi_int > m5 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DM_enlarge",argc,6,5,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_enlarge" "', argument " "1"" of type '" "casadi::Matrix< double > *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "[" "int" "]" "'.");
  arg5 = &m5;
  if (!casadi::to_ptr(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "[" "int" "]" "'.");
  if (5<argc) {
    if (!casadi::to_val(argv[5], &arg6)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 6 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->enlarge(arg2,arg3,(std::vector< casadi_int,std::allocator< casadi_int > > const &)*arg4,(std::vector< casadi_int,std::allocator< casadi_int > > const &)*arg5,arg6);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_enlarge'."
      "  Prototype:\n"
      "    ENLARGE(self,int,int,[int],[int],bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_sparsity(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("DM_sparsity",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_sparsity" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Matrix< double > const *)arg1)->get_sparsity();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_sparsity'."
      "  Prototype:\n"
      "    SPARSITY(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_triplet__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< casadi_int,std::allocator< casadi_int > > *arg1 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg2 = 0 ;
  casadi::Matrix< double > *arg3 = 0 ;
  std::vector< casadi_int > m1 ;
  std::vector< casadi_int > m2 ;
  casadi::Matrix< double > m3 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("DM_triplet",argc,3,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "[" "int" "]" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "[" "int" "]" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "DM" "'.");
  {
    try {
      result = casadi::Matrix< double >::SWIGTEMPLATEDISAMBIGUATOR triplet((std::vector< long long,std::allocator< long long > > const &)*arg1,(std::vector< long long,std::allocator< long long > > const &)*arg2,(casadi::Matrix< double > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_triplet'."
      "  Prototype:\n"
      "    TRIPLET([int],[int],DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_triplet__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< casadi_int,std::allocator< casadi_int > > *arg1 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg2 = 0 ;
  casadi::Matrix< double > *arg3 = 0 ;
  casadi_int arg4 ;
  casadi_int arg5 ;
  std::vector< casadi_int > m1 ;
  std::vector< casadi_int > m2 ;
  casadi::Matrix< double > m3 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("DM_triplet",argc,5,5,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "[" "int" "]" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "[" "int" "]" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "DM" "'.");
  if (!casadi::to_val(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "int" "'.");
  if (!casadi::to_val(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "int" "'.");
  {
    try {
      result = casadi::Matrix< double >::SWIGTEMPLATEDISAMBIGUATOR triplet((std::vector< long long,std::allocator< long long > > const &)*arg1,(std::vector< long long,std::allocator< long long > > const &)*arg2,(casadi::Matrix< double > const &)*arg3,arg4,arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_triplet'."
      "  Prototype:\n"
      "    TRIPLET([int],[int],DM,int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_triplet__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< casadi_int,std::allocator< casadi_int > > *arg1 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg2 = 0 ;
  casadi::Matrix< double > *arg3 = 0 ;
  std::pair< casadi_int,casadi_int > *arg4 = 0 ;
  std::vector< casadi_int > m1 ;
  std::vector< casadi_int > m2 ;
  casadi::Matrix< double > m3 ;
  std::pair< casadi_int,casadi_int > m4 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("DM_triplet",argc,4,4,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "[" "int" "]" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "[" "int" "]" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "DM" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "[int,int]" "'.");
  {
    try {
      result = casadi::Matrix< double >::SWIGTEMPLATEDISAMBIGUATOR triplet((std::vector< long long,std::allocator< long long > > const &)*arg1,(std::vector< long long,std::allocator< long long > > const &)*arg2,(casadi::Matrix< double > const &)*arg3,(std::pair< long long,long long > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_triplet'."
      "  Prototype:\n"
      "    TRIPLET([int],[int],DM,[int,int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_triplet(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 3) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::vector<casadi_int> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<casadi_int> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<double> **>(0));
        if (_v) {
          return _wrap_DM_triplet__SWIG_0(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::vector<casadi_int> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<casadi_int> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<double> **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< std::pair<casadi_int,casadi_int> **>(0));
          if (_v) {
            return _wrap_DM_triplet__SWIG_2(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if (argc == 5) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::vector<casadi_int> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<casadi_int> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<double> **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi_int **>(0));
          if (_v) {
            _v = casadi::to_ptr(argv[4], static_cast< casadi_int **>(0));
            if (_v) {
              return _wrap_DM_triplet__SWIG_1(resc,resv,argc,argv);
            }
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_triplet'."
    "  Possible prototypes are:\n"
    "    TRIPLET([int],[int],DM)\n"
    "    TRIPLET([int],[int],DM,[int,int])\n"
    "    TRIPLET([int],[int],DM,int,int)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_DM_inf__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = 0 ;
  casadi::Sparsity m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("DM_inf",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Sparsity" "'.");
  {
    try {
      result = casadi::Matrix< double >::SWIGTEMPLATEDISAMBIGUATOR inf((casadi::Sparsity const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_inf'."
      "  Prototype:\n"
      "    INF(Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_inf__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 = (casadi_int) 1 ;
  casadi_int arg2 = (casadi_int) 1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("DM_inf",argc,2,0,0)) {
    SWIG_fail;
  }
  if (0<argc) {
    if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  }
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  }
  {
    try {
      result = casadi::Matrix< double >::SWIGTEMPLATEDISAMBIGUATOR inf(arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_inf'."
      "  Prototype:\n"
      "    INF(int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_inf__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::pair< casadi_int,casadi_int > *arg1 = 0 ;
  std::pair< casadi_int,casadi_int > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("DM_inf",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "[int,int]" "'.");
  {
    try {
      result = casadi::Matrix< double >::SWIGTEMPLATEDISAMBIGUATOR inf((std::pair< long long,long long > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_inf'."
      "  Prototype:\n"
      "    INF([int,int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_inf(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 0) && (argc <= 2)) {
    int _v;
    if (argc <= 0) {
      return _wrap_DM_inf__SWIG_1(resc,resv,argc,argv);
    }
    _v = casadi::to_ptr(argv[0], static_cast< casadi_int **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_DM_inf__SWIG_1(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_DM_inf__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::pair<casadi_int,casadi_int> **>(0));
    if (_v) {
      return _wrap_DM_inf__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Sparsity **>(0));
    if (_v) {
      return _wrap_DM_inf__SWIG_0(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_inf'."
    "  Possible prototypes are:\n"
    "    INF(int,int)\n"
    "    INF([int,int])\n"
    "    INF(Sparsity)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_DM_nan__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = 0 ;
  casadi::Sparsity m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("DM_nan",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Sparsity" "'.");
  {
    try {
      result = casadi::Matrix< double >::SWIGTEMPLATEDISAMBIGUATOR nan((casadi::Sparsity const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_nan'."
      "  Prototype:\n"
      "    NAN(Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_nan__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 = (casadi_int) 1 ;
  casadi_int arg2 = (casadi_int) 1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("DM_nan",argc,2,0,0)) {
    SWIG_fail;
  }
  if (0<argc) {
    if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  }
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  }
  {
    try {
      result = casadi::Matrix< double >::SWIGTEMPLATEDISAMBIGUATOR nan(arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_nan'."
      "  Prototype:\n"
      "    NAN(int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_nan__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::pair< casadi_int,casadi_int > *arg1 = 0 ;
  std::pair< casadi_int,casadi_int > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("DM_nan",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "[int,int]" "'.");
  {
    try {
      result = casadi::Matrix< double >::SWIGTEMPLATEDISAMBIGUATOR nan((std::pair< long long,long long > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_nan'."
      "  Prototype:\n"
      "    NAN([int,int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_nan(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 0) && (argc <= 2)) {
    int _v;
    if (argc <= 0) {
      return _wrap_DM_nan__SWIG_1(resc,resv,argc,argv);
    }
    _v = casadi::to_ptr(argv[0], static_cast< casadi_int **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_DM_nan__SWIG_1(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_DM_nan__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::pair<casadi_int,casadi_int> **>(0));
    if (_v) {
      return _wrap_DM_nan__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Sparsity **>(0));
    if (_v) {
      return _wrap_DM_nan__SWIG_0(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_nan'."
    "  Possible prototypes are:\n"
    "    NAN(int,int)\n"
    "    NAN([int,int])\n"
    "    NAN(Sparsity)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_DM_eye(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("DM_eye",argc,1,1,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  {
    try {
      result = casadi::Matrix< double >::SWIGTEMPLATEDISAMBIGUATOR eye(arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_eye'."
      "  Prototype:\n"
      "    EYE(int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_element_hash(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("DM_element_hash",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_element_hash" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::Matrix< double > const *)arg1)->element_hash();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_element_hash'."
      "  Prototype:\n"
      "    ELEMENT_HASH(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_is_regular(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("DM_is_regular",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_is_regular" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Matrix< double > const *)arg1)->is_regular();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_is_regular'."
      "  Prototype:\n"
      "    IS_REGULAR(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_is_smooth(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("DM_is_smooth",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_is_smooth" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Matrix< double > const *)arg1)->is_smooth();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_is_smooth'."
      "  Prototype:\n"
      "    IS_SMOOTH(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_is_leaf(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("DM_is_leaf",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_is_leaf" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Matrix< double > const *)arg1)->is_leaf();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_is_leaf'."
      "  Prototype:\n"
      "    IS_LEAF(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_is_commutative(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("DM_is_commutative",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_is_commutative" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Matrix< double > const *)arg1)->is_commutative();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_is_commutative'."
      "  Prototype:\n"
      "    IS_COMMUTATIVE(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_is_symbolic(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("DM_is_symbolic",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_is_symbolic" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Matrix< double > const *)arg1)->is_symbolic();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_is_symbolic'."
      "  Prototype:\n"
      "    IS_SYMBOLIC(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_is_valid_input(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("DM_is_valid_input",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_is_valid_input" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Matrix< double > const *)arg1)->is_valid_input();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_is_valid_input'."
      "  Prototype:\n"
      "    IS_VALID_INPUT(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_has_duplicates(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("DM_has_duplicates",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_has_duplicates" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Matrix< double > const *)arg1)->has_duplicates();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_has_duplicates'."
      "  Prototype:\n"
      "    HAS_DUPLICATES(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_reset_input(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DM_reset_input",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_reset_input" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Matrix< double > const *)arg1)->reset_input();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_reset_input'."
      "  Prototype:\n"
      "    RESET_INPUT(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_is_constant(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("DM_is_constant",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_is_constant" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Matrix< double > const *)arg1)->is_constant();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_is_constant'."
      "  Prototype:\n"
      "    IS_CONSTANT(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_is_integer(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("DM_is_integer",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_is_integer" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Matrix< double > const *)arg1)->is_integer();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_is_integer'."
      "  Prototype:\n"
      "    IS_INTEGER(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_is_zero(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("DM_is_zero",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_is_zero" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Matrix< double > const *)arg1)->is_zero();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_is_zero'."
      "  Prototype:\n"
      "    IS_ZERO(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_is_one(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("DM_is_one",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_is_one" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Matrix< double > const *)arg1)->is_one();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_is_one'."
      "  Prototype:\n"
      "    IS_ONE(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_is_minus_one(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("DM_is_minus_one",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_is_minus_one" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Matrix< double > const *)arg1)->is_minus_one();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_is_minus_one'."
      "  Prototype:\n"
      "    IS_MINUS_ONE(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_is_eye(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("DM_is_eye",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_is_eye" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Matrix< double > const *)arg1)->is_eye();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_is_eye'."
      "  Prototype:\n"
      "    IS_EYE(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_op(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("DM_op",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_op" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::Matrix< double > const *)arg1)->op();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_op'."
      "  Prototype:\n"
      "    OP(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_is_op(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  casadi_int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("DM_is_op",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_is_op" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Matrix< double > const *)arg1)->is_op(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_is_op'."
      "  Prototype:\n"
      "    IS_OP(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_has_zeros(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("DM_has_zeros",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_has_zeros" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Matrix< double > const *)arg1)->has_zeros();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_has_zeros'."
      "  Prototype:\n"
      "    HAS_ZEROS(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_nonzeros(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< double,std::allocator< double > > result;
  
  if (!SWIG_check_num_args("DM_nonzeros",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_nonzeros" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Matrix< double > const *)arg1)->get_nonzeros();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[" "double" "]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_nonzeros'."
      "  Prototype:\n"
      "    NONZEROS(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_elements(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< double,std::allocator< double > > result;
  
  if (!SWIG_check_num_args("DM_elements",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_elements" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Matrix< double > const *)arg1)->get_elements();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[" "double" "]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_elements'."
      "  Prototype:\n"
      "    ELEMENTS(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_to_double(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  double result;
  
  if (!SWIG_check_num_args("DM_to_double",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_to_double" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (double)((casadi::Matrix< double > const *)arg1)->operator double();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "double" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_to_double'."
      "  Prototype:\n"
      "    TO_DOUBLE(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_to_int(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("DM_to_int",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_to_int" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::Matrix< double > const *)arg1)->operator casadi_int();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_to_int'."
      "  Prototype:\n"
      "    TO_INT(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_name(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("DM_name",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_name" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Matrix< double > const *)arg1)->name();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_name'."
      "  Prototype:\n"
      "    NAME(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_dep(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  casadi_int arg2 = (casadi_int) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("DM_dep",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_dep" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Matrix< double > const *)arg1)->dep(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_dep'."
      "  Prototype:\n"
      "    DEP(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_n_dep(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("DM_n_dep",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_n_dep" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::Matrix< double > const *)arg1)->n_dep();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_n_dep'."
      "  Prototype:\n"
      "    N_DEP(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_set_precision(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DM_set_precision",argc,1,1,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  {
    try {
      casadi::Matrix< double >::SWIGTEMPLATEDISAMBIGUATOR set_precision(arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_set_precision'."
      "  Prototype:\n"
      "    SET_PRECISION(int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_set_width(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DM_set_width",argc,1,1,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  {
    try {
      casadi::Matrix< double >::SWIGTEMPLATEDISAMBIGUATOR set_width(arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_set_width'."
      "  Prototype:\n"
      "    SET_WIDTH(int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_set_scientific(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  bool arg1 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DM_set_scientific",argc,1,1,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "bool" "'.");
  {
    try {
      casadi::Matrix< double >::SWIGTEMPLATEDISAMBIGUATOR set_scientific(arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_set_scientific'."
      "  Prototype:\n"
      "    SET_SCIENTIFIC(bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_rng(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DM_rng",argc,1,1,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  {
    try {
      casadi::Matrix< double >::SWIGTEMPLATEDISAMBIGUATOR rng(arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_rng'."
      "  Prototype:\n"
      "    RNG(int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_rand__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 = (casadi_int) 1 ;
  casadi_int arg2 = (casadi_int) 1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("DM_rand",argc,2,0,0)) {
    SWIG_fail;
  }
  if (0<argc) {
    if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  }
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  }
  {
    try {
      result = casadi::Matrix< double >::SWIGTEMPLATEDISAMBIGUATOR rand(arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_rand'."
      "  Prototype:\n"
      "    RAND(int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_rand__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = 0 ;
  casadi::Sparsity m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("DM_rand",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Sparsity" "'.");
  {
    try {
      result = casadi::Matrix< double >::SWIGTEMPLATEDISAMBIGUATOR rand((casadi::Sparsity const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_rand'."
      "  Prototype:\n"
      "    RAND(Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_rand__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::pair< casadi_int,casadi_int > *arg1 = 0 ;
  std::pair< casadi_int,casadi_int > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("DM_rand",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "[int,int]" "'.");
  {
    try {
      result = casadi::Matrix< double >::SWIGTEMPLATEDISAMBIGUATOR rand((std::pair< long long,long long > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_rand'."
      "  Prototype:\n"
      "    RAND([int,int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_rand(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 0) && (argc <= 2)) {
    int _v;
    if (argc <= 0) {
      return _wrap_DM_rand__SWIG_0(resc,resv,argc,argv);
    }
    _v = casadi::to_ptr(argv[0], static_cast< casadi_int **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_DM_rand__SWIG_0(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_DM_rand__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::pair<casadi_int,casadi_int> **>(0));
    if (_v) {
      return _wrap_DM_rand__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Sparsity **>(0));
    if (_v) {
      return _wrap_DM_rand__SWIG_1(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_rand'."
    "  Possible prototypes are:\n"
    "    RAND(int,int)\n"
    "    RAND([int,int])\n"
    "    RAND(Sparsity)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_DM_export_code(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  std::string *arg2 = 0 ;
  std::ostream &arg3_defvalue = casadi::uout() ;
  std::ostream *arg3 = (std::ostream *) &arg3_defvalue ;
  casadi::Dict const &arg4_defvalue = casadi::Dict() ;
  casadi::Dict *arg4 = (casadi::Dict *) &arg4_defvalue ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  std::map< std::string,casadi::GenericType > m4 ;
  mxArray * _out;
  
  arg3 = &casadi::uout();
  if (!SWIG_check_num_args("DM_export_code",argc,3,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_export_code" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  if (2<argc) {
    arg4 = &m4;
    if (!casadi::to_ptr(argv[2], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "struct" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Matrix< double > const *)arg1)->export_code((std::string const &)*arg2,*arg3,(casadi::Dict const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  *arg3 << "\n" << std::flush;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_export_code'."
      "  Prototype:\n"
      "    EXPORT_CODE(self,char,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_info(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Dict result;
  
  if (!SWIG_check_num_args("DM_info",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_info" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Matrix< double > const *)arg1)->info();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "struct" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_info'."
      "  Prototype:\n"
      "    INFO(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_serialize__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("DM_serialize",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_serialize" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Matrix< double > const *)arg1)->serialize();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_serialize'."
      "  Prototype:\n"
      "    SERIALIZE(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_deserialize__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::istream *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("DM_deserialize",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_std__istream,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_deserialize" "', argument " "1"" of type '" "std::istream &""'"); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "DM_deserialize" "', argument " "1"" of type '" "std::istream &""'"); 
  }
  arg1 = reinterpret_cast< std::istream * >(argp1);
  {
    try {
      result = casadi::Matrix< double >::SWIGTEMPLATEDISAMBIGUATOR deserialize(*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_deserialize'."
      "  Prototype:\n"
      "    DESERIALIZE(std::istream &)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_deserialize__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("DM_deserialize",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  {
    try {
      result = casadi::Matrix< double >::SWIGTEMPLATEDISAMBIGUATOR deserialize((std::string const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_deserialize'."
      "  Prototype:\n"
      "    DESERIALIZE(char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_serialize__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  casadi::SerializingStream *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DM_serialize",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_serialize" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  res2 = SWIG_ConvertPtr(argv[1], &argp2, SWIGTYPE_p_casadi__SerializingStream,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "DM_serialize" "', argument " "2"" of type '" "casadi::SerializingStream &""'"); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "DM_serialize" "', argument " "2"" of type '" "casadi::SerializingStream &""'"); 
  }
  arg2 = reinterpret_cast< casadi::SerializingStream * >(argp2);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Matrix< double > const *)arg1)->serialize(*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_serialize'."
      "  Prototype:\n"
      "    SERIALIZE(self,casadi::SerializingStream &)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_serialize(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_double_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_DM_serialize__SWIG_0(resc,resv,argc,argv);
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_double_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_casadi__SerializingStream, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap_DM_serialize__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_serialize'."
    "  Possible prototypes are:\n"
    "    SERIALIZE(self)\n"
    "    SERIALIZE(self,casadi::SerializingStream &)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_DM_deserialize__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DeserializingStream *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("DM_deserialize",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_casadi__DeserializingStream,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_deserialize" "', argument " "1"" of type '" "casadi::DeserializingStream &""'"); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "DM_deserialize" "', argument " "1"" of type '" "casadi::DeserializingStream &""'"); 
  }
  arg1 = reinterpret_cast< casadi::DeserializingStream * >(argp1);
  {
    try {
      result = casadi::Matrix< double >::SWIGTEMPLATEDISAMBIGUATOR deserialize(*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_deserialize'."
      "  Prototype:\n"
      "    DESERIALIZE(casadi::DeserializingStream &)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_deserialize(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_std__istream, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_DM_deserialize__SWIG_0(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__DeserializingStream, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_DM_deserialize__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::string **>(0));
    if (_v) {
      return _wrap_DM_deserialize__SWIG_1(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_deserialize'."
    "  Possible prototypes are:\n"
    "    DESERIALIZE(std::istream &)\n"
    "    DESERIALIZE(casadi::DeserializingStream &)\n"
    "    DESERIALIZE(char)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_DM_to_file(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  std::string *arg2 = 0 ;
  std::string const &arg3_defvalue = "" ;
  std::string *arg3 = (std::string *) &arg3_defvalue ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  std::string m3 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DM_to_file",argc,3,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_to_file" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  if (2<argc) {
    arg3 = &m3;
    if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "char" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Matrix< double > const *)arg1)->to_file((std::string const &)*arg2,(std::string const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_to_file'."
      "  Prototype:\n"
      "    TO_FILE(self,char,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_from_file(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string const &arg2_defvalue = "" ;
  std::string *arg2 = (std::string *) &arg2_defvalue ;
  std::string m1 ;
  std::string m2 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("DM_from_file",argc,2,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  if (1<argc) {
    arg2 = &m2;
    if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  }
  {
    try {
      result = casadi::Matrix< double >::SWIGTEMPLATEDISAMBIGUATOR from_file((std::string const &)*arg1,(std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_from_file'."
      "  Prototype:\n"
      "    FROM_FILE(char,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_DM__SWIG_6(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< double > *result = 0 ;
  
  if (!SWIG_check_num_args("new_DM",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = (casadi::Matrix< double > *)new casadi::Matrix< double >((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__MatrixT_double_t, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_DM'."
      "  Prototype:\n"
      "    DM(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_DM(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 0) {
    return _wrap_new_DM__SWIG_0(resc,resv,argc,argv);
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Sparsity **>(0));
    if (_v) {
      return _wrap_new_DM__SWIG_3(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< double **>(0));
    if (_v) {
      return _wrap_new_DM__SWIG_5(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_new_DM__SWIG_1(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_new_DM__SWIG_6(resc,resv,argc,argv);
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi_int **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_new_DM__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Sparsity **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        return _wrap_new_DM__SWIG_4(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_DM'."
    "  Possible prototypes are:\n"
    "    DM()\n"
    "    DM(Sparsity)\n"
    "    DM(double)\n"
    "    DM(DM)\n"
    "    DM(SX)\n"
    "    DM(int,int)\n"
    "    DM(Sparsity,DM)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_DM_assign(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< double > m2 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DM_assign",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_assign" "', argument " "1"" of type '" "casadi::Matrix< double > *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      casadi_Matrix_Sl_double_Sg__assign(arg1,(casadi::Matrix< double > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_assign'."
      "  Prototype:\n"
      "    ASSIGN(self,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_paren__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  char arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  char val2 ;
  int ecode2 = 0 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("DM_paren",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_paren" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  ecode2 = SWIG_AsVal_char(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DM_paren" "', argument " "2"" of type '" "char""'");
  } 
  arg2 = static_cast< char >(val2);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = casadi_Matrix_Sl_double_Sg__paren__SWIG_0((casadi::Matrix< double > const *)arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_paren'."
      "  Prototype:\n"
      "    PAREN(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_paren__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  casadi::Matrix< casadi_int > *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< casadi_int > m2 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("DM_paren",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_paren" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "IM" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = casadi_Matrix_Sl_double_Sg__paren__SWIG_1((casadi::Matrix< double > const *)arg1,(casadi::Matrix< long long > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_paren'."
      "  Prototype:\n"
      "    PAREN(self,IM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_paren__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  casadi::Sparsity *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Sparsity m2 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("DM_paren",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_paren" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "Sparsity" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = casadi_Matrix_Sl_double_Sg__paren__SWIG_2((casadi::Matrix< double > const *)arg1,(casadi::Sparsity const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_paren'."
      "  Prototype:\n"
      "    PAREN(self,Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_paren__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  char arg2 ;
  char arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  char val2 ;
  int ecode2 = 0 ;
  char val3 ;
  int ecode3 = 0 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("DM_paren",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_paren" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  ecode2 = SWIG_AsVal_char(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DM_paren" "', argument " "2"" of type '" "char""'");
  } 
  arg2 = static_cast< char >(val2);
  ecode3 = SWIG_AsVal_char(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "DM_paren" "', argument " "3"" of type '" "char""'");
  } 
  arg3 = static_cast< char >(val3);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = casadi_Matrix_Sl_double_Sg__paren__SWIG_3((casadi::Matrix< double > const *)arg1,arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_paren'."
      "  Prototype:\n"
      "    PAREN(self,char,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_paren__SWIG_4(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  char arg2 ;
  casadi::Matrix< casadi_int > *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  char val2 ;
  int ecode2 = 0 ;
  casadi::Matrix< casadi_int > m3 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("DM_paren",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_paren" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  ecode2 = SWIG_AsVal_char(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DM_paren" "', argument " "2"" of type '" "char""'");
  } 
  arg2 = static_cast< char >(val2);
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "IM" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = casadi_Matrix_Sl_double_Sg__paren__SWIG_4((casadi::Matrix< double > const *)arg1,arg2,(casadi::Matrix< long long > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_paren'."
      "  Prototype:\n"
      "    PAREN(self,char,IM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_paren__SWIG_5(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  casadi::Matrix< casadi_int > *arg2 = 0 ;
  char arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< casadi_int > m2 ;
  char val3 ;
  int ecode3 = 0 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("DM_paren",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_paren" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "IM" "'.");
  ecode3 = SWIG_AsVal_char(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "DM_paren" "', argument " "3"" of type '" "char""'");
  } 
  arg3 = static_cast< char >(val3);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = casadi_Matrix_Sl_double_Sg__paren__SWIG_5((casadi::Matrix< double > const *)arg1,(casadi::Matrix< long long > const &)*arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_paren'."
      "  Prototype:\n"
      "    PAREN(self,IM,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_paren__SWIG_6(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  casadi::Matrix< casadi_int > *arg2 = 0 ;
  casadi::Matrix< casadi_int > *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< casadi_int > m2 ;
  casadi::Matrix< casadi_int > m3 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("DM_paren",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_paren" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "IM" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "IM" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = casadi_Matrix_Sl_double_Sg__paren__SWIG_6((casadi::Matrix< double > const *)arg1,(casadi::Matrix< long long > const &)*arg2,(casadi::Matrix< long long > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_paren'."
      "  Prototype:\n"
      "    PAREN(self,IM,IM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_paren(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_double_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Sparsity **>(0));
      if (_v) {
        return _wrap_DM_paren__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_double_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi_int> **>(0));
      if (_v) {
        return _wrap_DM_paren__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_double_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_char(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_DM_paren__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_double_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi_int> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<casadi_int> **>(0));
        if (_v) {
          return _wrap_DM_paren__SWIG_6(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_double_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi_int> **>(0));
      if (_v) {
        {
          int res = SWIG_AsVal_char(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_DM_paren__SWIG_5(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_double_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_char(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<casadi_int> **>(0));
        if (_v) {
          return _wrap_DM_paren__SWIG_4(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_double_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_char(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        {
          int res = SWIG_AsVal_char(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_DM_paren__SWIG_3(resc,resv,argc,argv);
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_paren'."
    "  Possible prototypes are:\n"
    "    PAREN(self,Sparsity)\n"
    "    PAREN(self,IM)\n"
    "    PAREN(self,char)\n"
    "    PAREN(self,IM,IM)\n"
    "    PAREN(self,IM,char)\n"
    "    PAREN(self,char,IM)\n"
    "    PAREN(self,char,char)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_DM_paren_asgn__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  char arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< double > m2 ;
  char val3 ;
  int ecode3 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DM_paren_asgn",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_paren_asgn" "', argument " "1"" of type '" "casadi::Matrix< double > *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  ecode3 = SWIG_AsVal_char(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "DM_paren_asgn" "', argument " "3"" of type '" "char""'");
  } 
  arg3 = static_cast< char >(val3);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      casadi_Matrix_Sl_double_Sg__paren_asgn__SWIG_0(arg1,(casadi::Matrix< double > const &)*arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_paren_asgn'."
      "  Prototype:\n"
      "    PAREN_ASGN(self,DM,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_paren_asgn__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< casadi_int > *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< double > m2 ;
  casadi::Matrix< casadi_int > m3 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DM_paren_asgn",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_paren_asgn" "', argument " "1"" of type '" "casadi::Matrix< double > *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "IM" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      casadi_Matrix_Sl_double_Sg__paren_asgn__SWIG_1(arg1,(casadi::Matrix< double > const &)*arg2,(casadi::Matrix< long long > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_paren_asgn'."
      "  Prototype:\n"
      "    PAREN_ASGN(self,DM,IM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_paren_asgn__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Sparsity *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< double > m2 ;
  casadi::Sparsity m3 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DM_paren_asgn",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_paren_asgn" "', argument " "1"" of type '" "casadi::Matrix< double > *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "Sparsity" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      casadi_Matrix_Sl_double_Sg__paren_asgn__SWIG_2(arg1,(casadi::Matrix< double > const &)*arg2,(casadi::Sparsity const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_paren_asgn'."
      "  Prototype:\n"
      "    PAREN_ASGN(self,DM,Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_paren_asgn__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  char arg3 ;
  char arg4 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< double > m2 ;
  char val3 ;
  int ecode3 = 0 ;
  char val4 ;
  int ecode4 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DM_paren_asgn",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_paren_asgn" "', argument " "1"" of type '" "casadi::Matrix< double > *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  ecode3 = SWIG_AsVal_char(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "DM_paren_asgn" "', argument " "3"" of type '" "char""'");
  } 
  arg3 = static_cast< char >(val3);
  ecode4 = SWIG_AsVal_char(argv[3], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "DM_paren_asgn" "', argument " "4"" of type '" "char""'");
  } 
  arg4 = static_cast< char >(val4);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      casadi_Matrix_Sl_double_Sg__paren_asgn__SWIG_3(arg1,(casadi::Matrix< double > const &)*arg2,arg3,arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_paren_asgn'."
      "  Prototype:\n"
      "    PAREN_ASGN(self,DM,char,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_paren_asgn__SWIG_4(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  char arg3 ;
  casadi::Matrix< casadi_int > *arg4 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< double > m2 ;
  char val3 ;
  int ecode3 = 0 ;
  casadi::Matrix< casadi_int > m4 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DM_paren_asgn",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_paren_asgn" "', argument " "1"" of type '" "casadi::Matrix< double > *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  ecode3 = SWIG_AsVal_char(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "DM_paren_asgn" "', argument " "3"" of type '" "char""'");
  } 
  arg3 = static_cast< char >(val3);
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "IM" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      casadi_Matrix_Sl_double_Sg__paren_asgn__SWIG_4(arg1,(casadi::Matrix< double > const &)*arg2,arg3,(casadi::Matrix< long long > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_paren_asgn'."
      "  Prototype:\n"
      "    PAREN_ASGN(self,DM,char,IM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_paren_asgn__SWIG_5(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< casadi_int > *arg3 = 0 ;
  char arg4 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< double > m2 ;
  casadi::Matrix< casadi_int > m3 ;
  char val4 ;
  int ecode4 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DM_paren_asgn",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_paren_asgn" "', argument " "1"" of type '" "casadi::Matrix< double > *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "IM" "'.");
  ecode4 = SWIG_AsVal_char(argv[3], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "DM_paren_asgn" "', argument " "4"" of type '" "char""'");
  } 
  arg4 = static_cast< char >(val4);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      casadi_Matrix_Sl_double_Sg__paren_asgn__SWIG_5(arg1,(casadi::Matrix< double > const &)*arg2,(casadi::Matrix< long long > const &)*arg3,arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_paren_asgn'."
      "  Prototype:\n"
      "    PAREN_ASGN(self,DM,IM,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_paren_asgn__SWIG_6(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< casadi_int > *arg3 = 0 ;
  casadi::Matrix< casadi_int > *arg4 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< double > m2 ;
  casadi::Matrix< casadi_int > m3 ;
  casadi::Matrix< casadi_int > m4 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DM_paren_asgn",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_paren_asgn" "', argument " "1"" of type '" "casadi::Matrix< double > *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "IM" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "IM" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      casadi_Matrix_Sl_double_Sg__paren_asgn__SWIG_6(arg1,(casadi::Matrix< double > const &)*arg2,(casadi::Matrix< long long > const &)*arg3,(casadi::Matrix< long long > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_paren_asgn'."
      "  Prototype:\n"
      "    PAREN_ASGN(self,DM,IM,IM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_paren_asgn(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_double_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Sparsity **>(0));
        if (_v) {
          return _wrap_DM_paren_asgn__SWIG_2(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_double_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<casadi_int> **>(0));
        if (_v) {
          return _wrap_DM_paren_asgn__SWIG_1(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_double_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        {
          int res = SWIG_AsVal_char(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_DM_paren_asgn__SWIG_0(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_double_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<casadi_int> **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::Matrix<casadi_int> **>(0));
          if (_v) {
            return _wrap_DM_paren_asgn__SWIG_6(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_double_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<casadi_int> **>(0));
        if (_v) {
          {
            int res = SWIG_AsVal_char(argv[3], NULL);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            return _wrap_DM_paren_asgn__SWIG_5(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_double_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        {
          int res = SWIG_AsVal_char(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::Matrix<casadi_int> **>(0));
          if (_v) {
            return _wrap_DM_paren_asgn__SWIG_4(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_double_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        {
          int res = SWIG_AsVal_char(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          {
            int res = SWIG_AsVal_char(argv[3], NULL);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            return _wrap_DM_paren_asgn__SWIG_3(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_paren_asgn'."
    "  Possible prototypes are:\n"
    "    PAREN_ASGN(self,DM,Sparsity)\n"
    "    PAREN_ASGN(self,DM,IM)\n"
    "    PAREN_ASGN(self,DM,char)\n"
    "    PAREN_ASGN(self,DM,IM,IM)\n"
    "    PAREN_ASGN(self,DM,IM,char)\n"
    "    PAREN_ASGN(self,DM,char,IM)\n"
    "    PAREN_ASGN(self,DM,char,char)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_DM_brace__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  char arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  char val2 ;
  int ecode2 = 0 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("DM_brace",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_brace" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  ecode2 = SWIG_AsVal_char(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DM_brace" "', argument " "2"" of type '" "char""'");
  } 
  arg2 = static_cast< char >(val2);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = casadi_Matrix_Sl_double_Sg__brace__SWIG_0((casadi::Matrix< double > const *)arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_brace'."
      "  Prototype:\n"
      "    BRACE(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_brace__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  casadi::Matrix< casadi_int > *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< casadi_int > m2 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("DM_brace",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_brace" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "IM" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = casadi_Matrix_Sl_double_Sg__brace__SWIG_1((casadi::Matrix< double > const *)arg1,(casadi::Matrix< long long > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_brace'."
      "  Prototype:\n"
      "    BRACE(self,IM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_brace(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_double_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi_int> **>(0));
      if (_v) {
        return _wrap_DM_brace__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_double_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_char(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_DM_brace__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_brace'."
    "  Possible prototypes are:\n"
    "    BRACE(self,IM)\n"
    "    BRACE(self,char)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_DM_setbrace__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  char arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< double > m2 ;
  char val3 ;
  int ecode3 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DM_setbrace",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_setbrace" "', argument " "1"" of type '" "casadi::Matrix< double > *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  ecode3 = SWIG_AsVal_char(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "DM_setbrace" "', argument " "3"" of type '" "char""'");
  } 
  arg3 = static_cast< char >(val3);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      casadi_Matrix_Sl_double_Sg__setbrace__SWIG_0(arg1,(casadi::Matrix< double > const &)*arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_setbrace'."
      "  Prototype:\n"
      "    SETBRACE(self,DM,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_setbrace__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< casadi_int > *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< double > m2 ;
  casadi::Matrix< casadi_int > m3 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DM_setbrace",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_setbrace" "', argument " "1"" of type '" "casadi::Matrix< double > *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "IM" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      casadi_Matrix_Sl_double_Sg__setbrace__SWIG_1(arg1,(casadi::Matrix< double > const &)*arg2,(casadi::Matrix< long long > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_setbrace'."
      "  Prototype:\n"
      "    SETBRACE(self,DM,IM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_setbrace(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_double_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<casadi_int> **>(0));
        if (_v) {
          return _wrap_DM_setbrace__SWIG_1(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_double_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        {
          int res = SWIG_AsVal_char(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_DM_setbrace__SWIG_0(resc,resv,argc,argv);
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_setbrace'."
    "  Possible prototypes are:\n"
    "    SETBRACE(self,DM,IM)\n"
    "    SETBRACE(self,DM,char)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_DM_end(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  casadi_int arg2 ;
  casadi_int arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("DM_end",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_end" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)casadi_Matrix_Sl_double_Sg__end((casadi::Matrix< double > const *)arg1,arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_end'."
      "  Prototype:\n"
      "    END(self,int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_numel__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  casadi_int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("DM_numel",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_numel" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)casadi_Matrix_Sl_double_Sg__numel__SWIG_0((casadi::Matrix< double > const *)arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_numel'."
      "  Prototype:\n"
      "    NUMEL(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_numel__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  char arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  char val2 ;
  int ecode2 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("DM_numel",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_numel" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  ecode2 = SWIG_AsVal_char(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DM_numel" "', argument " "2"" of type '" "char""'");
  } 
  arg2 = static_cast< char >(val2);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)casadi_Matrix_Sl_double_Sg__numel__SWIG_1((casadi::Matrix< double > const *)arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_numel'."
      "  Prototype:\n"
      "    NUMEL(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_numel__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< casadi_int > m2 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("DM_numel",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_numel" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "[" "int" "]" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)casadi_Matrix_Sl_double_Sg__numel__SWIG_2((casadi::Matrix< double > const *)arg1,(std::vector< long long,std::allocator< long long > > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_numel'."
      "  Prototype:\n"
      "    NUMEL(self,[int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_numel__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("DM_numel",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_numel" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)casadi_Matrix_Sl_double_Sg__numel__SWIG_3((casadi::Matrix< double > const *)arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_numel'."
      "  Prototype:\n"
      "    NUMEL(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_numel(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_double_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_DM_numel__SWIG_3(resc,resv,argc,argv);
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_double_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_DM_numel__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_double_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<casadi_int> **>(0));
      if (_v) {
        return _wrap_DM_numel__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_double_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_char(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_DM_numel__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_numel'."
    "  Possible prototypes are:\n"
    "    NUMEL(self)\n"
    "    NUMEL(self,int)\n"
    "    NUMEL(self,[int])\n"
    "    NUMEL(self,char)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_DM_ctranspose(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("DM_ctranspose",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_ctranspose" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = casadi_Matrix_Sl_double_Sg__ctranspose((casadi::Matrix< double > const *)arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_ctranspose'."
      "  Prototype:\n"
      "    CTRANSPOSE(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_full(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  mxArray *result = 0 ;
  
  if (!SWIG_check_num_args("DM_full",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_full" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (mxArray *)casadi_Matrix_Sl_double_Sg__full((casadi::Matrix< double > const *)arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = result;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_full'."
      "  Prototype:\n"
      "    FULL(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DM_sparse(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  mxArray *result = 0 ;
  
  if (!SWIG_check_num_args("DM_sparse",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DM_sparse" "', argument " "1"" of type '" "casadi::Matrix< double > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (mxArray *)casadi_Matrix_Sl_double_Sg__sparse((casadi::Matrix< double > const *)arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = result;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DM_sparse'."
      "  Prototype:\n"
      "    SPARSE(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_delete_DM(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = (casadi::Matrix< double > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  int is_owned;
  if (!SWIG_check_num_args("delete_DM",argc,1,1,0)) {
    SWIG_fail;
  }
  is_owned = SWIG_Matlab_isOwned(argv[0]);
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_double_t, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_DM" "', argument " "1"" of type '" "casadi::Matrix< double > *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< double > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  if (is_owned) {
    {
      delete arg1;
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'delete_DM'."
      "  Prototype:\n"
      "    DM(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_SXElem__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  casadi::SXElem *result = 0 ;
  
  if (!SWIG_check_num_args("new_SXElem",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    result = (casadi::SXElem *)new casadi::SXElem();
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__SXElem, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_SXElem'."
      "  Prototype:\n"
      "    SXELEM()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_SXElem__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::SXElem *arg1 = 0 ;
  casadi::SXElem m1 ;
  mxArray * _out;
  casadi::SXElem *result = 0 ;
  
  if (!SWIG_check_num_args("new_SXElem",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SXElem" "'.");
  {
    result = (casadi::SXElem *)new casadi::SXElem((casadi::SXElem const &)*arg1);
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__SXElem, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_SXElem'."
      "  Prototype:\n"
      "    SXELEM(SXElem)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_SXElem(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 0) {
    return _wrap_new_SXElem__SWIG_0(resc,resv,argc,argv);
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::SXElem **>(0));
    if (_v) {
      return _wrap_new_SXElem__SWIG_1(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_SXElem'."
    "  Possible prototypes are:\n"
    "    SXELEM()\n"
    "    SXELEM(SXElem)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_delete_SXElem(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::SXElem *arg1 = (casadi::SXElem *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  int is_owned;
  if (!SWIG_check_num_args("delete_SXElem",argc,1,1,0)) {
    SWIG_fail;
  }
  is_owned = SWIG_Matlab_isOwned(argv[0]);
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__SXElem, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_SXElem" "', argument " "1"" of type '" "casadi::SXElem *""'"); 
  }
  arg1 = reinterpret_cast< casadi::SXElem * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  if (is_owned) {
    {
      delete arg1;
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'delete_SXElem'."
      "  Prototype:\n"
      "    SXELEM(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_SX__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > *result = 0 ;
  
  if (!SWIG_check_num_args("new_SX",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      result = (casadi::Matrix< casadi::SXElem > *)new casadi::Matrix< casadi::SXElem >();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_SX'."
      "  Prototype:\n"
      "    SX()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_SX__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > *result = 0 ;
  
  if (!SWIG_check_num_args("new_SX",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  {
    try {
      result = (casadi::Matrix< casadi::SXElem > *)new casadi::Matrix< casadi::SXElem >((casadi::Matrix< casadi::SXElem > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_SX'."
      "  Prototype:\n"
      "    SX(SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_SX__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 ;
  casadi_int arg2 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > *result = 0 ;
  
  if (!SWIG_check_num_args("new_SX",argc,2,2,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  {
    try {
      result = (casadi::Matrix< casadi::SXElem > *)new casadi::Matrix< casadi::SXElem >(arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_SX'."
      "  Prototype:\n"
      "    SX(int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_SX__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = 0 ;
  casadi::Sparsity m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > *result = 0 ;
  
  if (!SWIG_check_num_args("new_SX",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Sparsity" "'.");
  {
    try {
      result = (casadi::Matrix< casadi::SXElem > *)new casadi::Matrix< casadi::SXElem >((casadi::Sparsity const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_SX'."
      "  Prototype:\n"
      "    SX(Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_SX__SWIG_4(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Sparsity m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > *result = 0 ;
  
  if (!SWIG_check_num_args("new_SX",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Sparsity" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  {
    try {
      result = (casadi::Matrix< casadi::SXElem > *)new casadi::Matrix< casadi::SXElem >((casadi::Sparsity const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_SX'."
      "  Prototype:\n"
      "    SX(Sparsity,SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_SX__SWIG_5(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  double arg1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > *result = 0 ;
  
  if (!SWIG_check_num_args("new_SX",argc,1,1,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "double" "'.");
  {
    try {
      result = (casadi::Matrix< casadi::SXElem > *)new casadi::Matrix< casadi::SXElem >(arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_SX'."
      "  Prototype:\n"
      "    SX(double)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_has_nz(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  casadi_int arg2 ;
  casadi_int arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("SX_has_nz",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_has_nz" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Matrix< casadi::SXElem > const *)arg1)->has_nz(arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_has_nz'."
      "  Prototype:\n"
      "    HAS_NZ(self,int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_nonzero(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("SX_nonzero",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_nonzero" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Matrix< casadi::SXElem > const *)arg1)->__nonzero__();
    } catch (const std::exception& e) {
      SWIG_exception(SWIG_TypeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_nonzero'."
      "  Prototype:\n"
      "    NONZERO(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_get__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  bool arg3 ;
  casadi::Slice *arg4 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  casadi::Slice m4 ;
  mxArray * _out;
  
  arg2 = &m2;
  if (!SWIG_check_num_args("SX_get",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_get" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  if (!casadi::to_val(argv[1], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[2], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "Slice" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Matrix< casadi::SXElem > const *)arg1)->get(*arg2,arg3,(casadi::Slice const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_get'."
      "  Prototype:\n"
      "    GET(self,bool,Slice)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_get__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  bool arg3 ;
  casadi::Matrix< casadi_int > *arg4 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  casadi::Matrix< casadi_int > m4 ;
  mxArray * _out;
  
  arg2 = &m2;
  if (!SWIG_check_num_args("SX_get",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_get" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  if (!casadi::to_val(argv[1], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[2], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "IM" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Matrix< casadi::SXElem > const *)arg1)->get(*arg2,arg3,(casadi::Matrix< casadi_int > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_get'."
      "  Prototype:\n"
      "    GET(self,bool,IM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_get__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  bool arg3 ;
  casadi::Sparsity *arg4 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  casadi::Sparsity m4 ;
  mxArray * _out;
  
  arg2 = &m2;
  if (!SWIG_check_num_args("SX_get",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_get" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  if (!casadi::to_val(argv[1], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[2], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "Sparsity" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Matrix< casadi::SXElem > const *)arg1)->get(*arg2,arg3,(casadi::Sparsity const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_get'."
      "  Prototype:\n"
      "    GET(self,bool,Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_get__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  bool arg3 ;
  casadi::Slice *arg4 = 0 ;
  casadi::Slice *arg5 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  casadi::Slice m4 ;
  casadi::Slice m5 ;
  mxArray * _out;
  
  arg2 = &m2;
  if (!SWIG_check_num_args("SX_get",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_get" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  if (!casadi::to_val(argv[1], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[2], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "Slice" "'.");
  arg5 = &m5;
  if (!casadi::to_ptr(argv[3], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "Slice" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Matrix< casadi::SXElem > const *)arg1)->get(*arg2,arg3,(casadi::Slice const &)*arg4,(casadi::Slice const &)*arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_get'."
      "  Prototype:\n"
      "    GET(self,bool,Slice,Slice)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_get__SWIG_4(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  bool arg3 ;
  casadi::Slice *arg4 = 0 ;
  casadi::Matrix< casadi_int > *arg5 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  casadi::Slice m4 ;
  casadi::Matrix< casadi_int > m5 ;
  mxArray * _out;
  
  arg2 = &m2;
  if (!SWIG_check_num_args("SX_get",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_get" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  if (!casadi::to_val(argv[1], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[2], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "Slice" "'.");
  arg5 = &m5;
  if (!casadi::to_ptr(argv[3], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "IM" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Matrix< casadi::SXElem > const *)arg1)->get(*arg2,arg3,(casadi::Slice const &)*arg4,(casadi::Matrix< casadi_int > const &)*arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_get'."
      "  Prototype:\n"
      "    GET(self,bool,Slice,IM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_get__SWIG_5(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  bool arg3 ;
  casadi::Matrix< casadi_int > *arg4 = 0 ;
  casadi::Slice *arg5 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  casadi::Matrix< casadi_int > m4 ;
  casadi::Slice m5 ;
  mxArray * _out;
  
  arg2 = &m2;
  if (!SWIG_check_num_args("SX_get",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_get" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  if (!casadi::to_val(argv[1], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[2], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "IM" "'.");
  arg5 = &m5;
  if (!casadi::to_ptr(argv[3], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "Slice" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Matrix< casadi::SXElem > const *)arg1)->get(*arg2,arg3,(casadi::Matrix< casadi_int > const &)*arg4,(casadi::Slice const &)*arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_get'."
      "  Prototype:\n"
      "    GET(self,bool,IM,Slice)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_get__SWIG_6(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  bool arg3 ;
  casadi::Matrix< casadi_int > *arg4 = 0 ;
  casadi::Matrix< casadi_int > *arg5 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  casadi::Matrix< casadi_int > m4 ;
  casadi::Matrix< casadi_int > m5 ;
  mxArray * _out;
  
  arg2 = &m2;
  if (!SWIG_check_num_args("SX_get",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_get" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  if (!casadi::to_val(argv[1], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[2], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "IM" "'.");
  arg5 = &m5;
  if (!casadi::to_ptr(argv[3], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "IM" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Matrix< casadi::SXElem > const *)arg1)->get(*arg2,arg3,(casadi::Matrix< casadi_int > const &)*arg4,(casadi::Matrix< casadi_int > const &)*arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_get'."
      "  Prototype:\n"
      "    GET(self,bool,IM,IM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_get(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< bool **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Sparsity **>(0));
        if (_v) {
          return _wrap_SX_get__SWIG_2(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< bool **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Slice **>(0));
        if (_v) {
          return _wrap_SX_get__SWIG_0(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< bool **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<casadi_int> **>(0));
        if (_v) {
          return _wrap_SX_get__SWIG_1(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< bool **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Slice **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::Slice **>(0));
          if (_v) {
            return _wrap_SX_get__SWIG_3(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< bool **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Slice **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::Matrix<casadi_int> **>(0));
          if (_v) {
            return _wrap_SX_get__SWIG_4(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< bool **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<casadi_int> **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::Slice **>(0));
          if (_v) {
            return _wrap_SX_get__SWIG_5(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< bool **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<casadi_int> **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::Matrix<casadi_int> **>(0));
          if (_v) {
            return _wrap_SX_get__SWIG_6(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_get'."
    "  Possible prototypes are:\n"
    "    GET(self,bool,Sparsity)\n"
    "    GET(self,bool,Slice)\n"
    "    GET(self,bool,IM)\n"
    "    GET(self,bool,Slice,Slice)\n"
    "    GET(self,bool,Slice,IM)\n"
    "    GET(self,bool,IM,Slice)\n"
    "    GET(self,bool,IM,IM)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_SX_set__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  bool arg3 ;
  casadi::Slice *arg4 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  casadi::Slice m4 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("SX_set",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_set" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "Slice" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->set((casadi::Matrix< casadi::SXElem > const &)*arg2,arg3,(casadi::Slice const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_set'."
      "  Prototype:\n"
      "    SET(self,SX,bool,Slice)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_set__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  bool arg3 ;
  casadi::Matrix< casadi_int > *arg4 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  casadi::Matrix< casadi_int > m4 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("SX_set",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_set" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "IM" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->set((casadi::Matrix< casadi::SXElem > const &)*arg2,arg3,(casadi::Matrix< casadi_int > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_set'."
      "  Prototype:\n"
      "    SET(self,SX,bool,IM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_set__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  bool arg3 ;
  casadi::Sparsity *arg4 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  casadi::Sparsity m4 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("SX_set",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_set" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "Sparsity" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->set((casadi::Matrix< casadi::SXElem > const &)*arg2,arg3,(casadi::Sparsity const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_set'."
      "  Prototype:\n"
      "    SET(self,SX,bool,Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_set__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  bool arg3 ;
  casadi::Slice *arg4 = 0 ;
  casadi::Slice *arg5 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  casadi::Slice m4 ;
  casadi::Slice m5 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("SX_set",argc,5,5,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_set" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "Slice" "'.");
  arg5 = &m5;
  if (!casadi::to_ptr(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "Slice" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->set((casadi::Matrix< casadi::SXElem > const &)*arg2,arg3,(casadi::Slice const &)*arg4,(casadi::Slice const &)*arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_set'."
      "  Prototype:\n"
      "    SET(self,SX,bool,Slice,Slice)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_set__SWIG_4(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  bool arg3 ;
  casadi::Slice *arg4 = 0 ;
  casadi::Matrix< casadi_int > *arg5 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  casadi::Slice m4 ;
  casadi::Matrix< casadi_int > m5 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("SX_set",argc,5,5,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_set" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "Slice" "'.");
  arg5 = &m5;
  if (!casadi::to_ptr(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "IM" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->set((casadi::Matrix< casadi::SXElem > const &)*arg2,arg3,(casadi::Slice const &)*arg4,(casadi::Matrix< casadi_int > const &)*arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_set'."
      "  Prototype:\n"
      "    SET(self,SX,bool,Slice,IM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_set__SWIG_5(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  bool arg3 ;
  casadi::Matrix< casadi_int > *arg4 = 0 ;
  casadi::Slice *arg5 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  casadi::Matrix< casadi_int > m4 ;
  casadi::Slice m5 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("SX_set",argc,5,5,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_set" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "IM" "'.");
  arg5 = &m5;
  if (!casadi::to_ptr(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "Slice" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->set((casadi::Matrix< casadi::SXElem > const &)*arg2,arg3,(casadi::Matrix< casadi_int > const &)*arg4,(casadi::Slice const &)*arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_set'."
      "  Prototype:\n"
      "    SET(self,SX,bool,IM,Slice)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_set__SWIG_6(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  bool arg3 ;
  casadi::Matrix< casadi_int > *arg4 = 0 ;
  casadi::Matrix< casadi_int > *arg5 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  casadi::Matrix< casadi_int > m4 ;
  casadi::Matrix< casadi_int > m5 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("SX_set",argc,5,5,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_set" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "IM" "'.");
  arg5 = &m5;
  if (!casadi::to_ptr(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "IM" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->set((casadi::Matrix< casadi::SXElem > const &)*arg2,arg3,(casadi::Matrix< casadi_int > const &)*arg4,(casadi::Matrix< casadi_int > const &)*arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_set'."
      "  Prototype:\n"
      "    SET(self,SX,bool,IM,IM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_set(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< bool **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::Sparsity **>(0));
          if (_v) {
            return _wrap_SX_set__SWIG_2(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< bool **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::Slice **>(0));
          if (_v) {
            return _wrap_SX_set__SWIG_0(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< bool **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::Matrix<casadi_int> **>(0));
          if (_v) {
            return _wrap_SX_set__SWIG_1(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if (argc == 5) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< bool **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::Slice **>(0));
          if (_v) {
            _v = casadi::to_ptr(argv[4], static_cast< casadi::Slice **>(0));
            if (_v) {
              return _wrap_SX_set__SWIG_3(resc,resv,argc,argv);
            }
          }
        }
      }
    }
  }
  if (argc == 5) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< bool **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::Slice **>(0));
          if (_v) {
            _v = casadi::to_ptr(argv[4], static_cast< casadi::Matrix<casadi_int> **>(0));
            if (_v) {
              return _wrap_SX_set__SWIG_4(resc,resv,argc,argv);
            }
          }
        }
      }
    }
  }
  if (argc == 5) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< bool **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::Matrix<casadi_int> **>(0));
          if (_v) {
            _v = casadi::to_ptr(argv[4], static_cast< casadi::Slice **>(0));
            if (_v) {
              return _wrap_SX_set__SWIG_5(resc,resv,argc,argv);
            }
          }
        }
      }
    }
  }
  if (argc == 5) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< bool **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::Matrix<casadi_int> **>(0));
          if (_v) {
            _v = casadi::to_ptr(argv[4], static_cast< casadi::Matrix<casadi_int> **>(0));
            if (_v) {
              return _wrap_SX_set__SWIG_6(resc,resv,argc,argv);
            }
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_set'."
    "  Possible prototypes are:\n"
    "    SET(self,SX,bool,Sparsity)\n"
    "    SET(self,SX,bool,Slice)\n"
    "    SET(self,SX,bool,IM)\n"
    "    SET(self,SX,bool,Slice,Slice)\n"
    "    SET(self,SX,bool,Slice,IM)\n"
    "    SET(self,SX,bool,IM,Slice)\n"
    "    SET(self,SX,bool,IM,IM)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_SX_get_nz__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  bool arg3 ;
  casadi::Slice *arg4 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  casadi::Slice m4 ;
  mxArray * _out;
  
  arg2 = &m2;
  if (!SWIG_check_num_args("SX_get_nz",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_get_nz" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  if (!casadi::to_val(argv[1], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[2], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "Slice" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Matrix< casadi::SXElem > const *)arg1)->get_nz(*arg2,arg3,(casadi::Slice const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_get_nz'."
      "  Prototype:\n"
      "    GET_NZ(self,bool,Slice)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_get_nz__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  bool arg3 ;
  casadi::Matrix< casadi_int > *arg4 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  casadi::Matrix< casadi_int > m4 ;
  mxArray * _out;
  
  arg2 = &m2;
  if (!SWIG_check_num_args("SX_get_nz",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_get_nz" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  if (!casadi::to_val(argv[1], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[2], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "IM" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Matrix< casadi::SXElem > const *)arg1)->get_nz(*arg2,arg3,(casadi::Matrix< casadi_int > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_get_nz'."
      "  Prototype:\n"
      "    GET_NZ(self,bool,IM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_get_nz(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< bool **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Slice **>(0));
        if (_v) {
          return _wrap_SX_get_nz__SWIG_0(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< bool **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<casadi_int> **>(0));
        if (_v) {
          return _wrap_SX_get_nz__SWIG_1(resc,resv,argc,argv);
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_get_nz'."
    "  Possible prototypes are:\n"
    "    GET_NZ(self,bool,Slice)\n"
    "    GET_NZ(self,bool,IM)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_SX_set_nz__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  bool arg3 ;
  casadi::Slice *arg4 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  casadi::Slice m4 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("SX_set_nz",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_set_nz" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "Slice" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->set_nz((casadi::Matrix< casadi::SXElem > const &)*arg2,arg3,(casadi::Slice const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_set_nz'."
      "  Prototype:\n"
      "    SET_NZ(self,SX,bool,Slice)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_set_nz__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  bool arg3 ;
  casadi::Matrix< casadi_int > *arg4 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  casadi::Matrix< casadi_int > m4 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("SX_set_nz",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_set_nz" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "IM" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->set_nz((casadi::Matrix< casadi::SXElem > const &)*arg2,arg3,(casadi::Matrix< casadi_int > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_set_nz'."
      "  Prototype:\n"
      "    SET_NZ(self,SX,bool,IM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_set_nz(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< bool **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::Slice **>(0));
          if (_v) {
            return _wrap_SX_set_nz__SWIG_0(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< bool **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::Matrix<casadi_int> **>(0));
          if (_v) {
            return _wrap_SX_set_nz__SWIG_1(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_set_nz'."
    "  Possible prototypes are:\n"
    "    SET_NZ(self,SX,bool,Slice)\n"
    "    SET_NZ(self,SX,bool,IM)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_SX_uplus(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("SX_uplus",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_uplus" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Matrix< casadi::SXElem > const *)arg1)->operator +();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_uplus'."
      "  Prototype:\n"
      "    UPLUS(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_uminus(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("SX_uminus",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_uminus" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Matrix< casadi::SXElem > const *)arg1)->operator -();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_uminus'."
      "  Prototype:\n"
      "    UMINUS(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_binary(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg3 = 0 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  casadi::Matrix< casadi::SXElem > m3 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("SX_binary",argc,3,3,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "SX" "'.");
  {
    try {
      result = casadi::Matrix< casadi::SXElem >::SWIGTEMPLATEDISAMBIGUATOR binary(arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2,(casadi::Matrix< casadi::SXElem > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_binary'."
      "  Prototype:\n"
      "    BINARY(int,SX,SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_unary(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("SX_unary",argc,2,2,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  {
    try {
      result = casadi::Matrix< casadi::SXElem >::SWIGTEMPLATEDISAMBIGUATOR unary(arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_unary'."
      "  Prototype:\n"
      "    UNARY(int,SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_scalar_matrix(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg3 = 0 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  casadi::Matrix< casadi::SXElem > m3 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("SX_scalar_matrix",argc,3,3,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "SX" "'.");
  {
    try {
      result = casadi::Matrix< casadi::SXElem >::SWIGTEMPLATEDISAMBIGUATOR scalar_matrix(arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2,(casadi::Matrix< casadi::SXElem > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_scalar_matrix'."
      "  Prototype:\n"
      "    SCALAR_MATRIX(int,SX,SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_matrix_scalar(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg3 = 0 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  casadi::Matrix< casadi::SXElem > m3 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("SX_matrix_scalar",argc,3,3,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "SX" "'.");
  {
    try {
      result = casadi::Matrix< casadi::SXElem >::SWIGTEMPLATEDISAMBIGUATOR matrix_scalar(arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2,(casadi::Matrix< casadi::SXElem > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_matrix_scalar'."
      "  Prototype:\n"
      "    MATRIX_SCALAR(int,SX,SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_matrix_matrix(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg3 = 0 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  casadi::Matrix< casadi::SXElem > m3 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("SX_matrix_matrix",argc,3,3,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "SX" "'.");
  {
    try {
      result = casadi::Matrix< casadi::SXElem >::SWIGTEMPLATEDISAMBIGUATOR matrix_matrix(arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2,(casadi::Matrix< casadi::SXElem > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_matrix_matrix'."
      "  Prototype:\n"
      "    MATRIX_MATRIX(int,SX,SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_printme(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("SX_printme",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_printme" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Matrix< casadi::SXElem > const *)arg1)->printme((casadi::Matrix< casadi::SXElem > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_printme'."
      "  Prototype:\n"
      "    PRINTME(self,SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_T(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("SX_T",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_T" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Matrix< casadi::SXElem > const *)arg1)->T();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_T'."
      "  Prototype:\n"
      "    T(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_set_max_depth(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 = (casadi_int) 1 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("SX_set_max_depth",argc,1,0,0)) {
    SWIG_fail;
  }
  if (0<argc) {
    if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  }
  {
    try {
      casadi::Matrix< casadi::SXElem >::SWIGTEMPLATEDISAMBIGUATOR set_max_depth(arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_set_max_depth'."
      "  Prototype:\n"
      "    SET_MAX_DEPTH(int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_get_max_depth(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("SX_get_max_depth",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      result = (casadi_int)casadi::Matrix< casadi::SXElem >::SWIGTEMPLATEDISAMBIGUATOR get_max_depth();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_get_max_depth'."
      "  Prototype:\n"
      "    GET_MAX_DEPTH()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_get_input(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = 0 ;
  casadi::Function m1 ;
  mxArray * _out;
  std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > result;
  
  if (!SWIG_check_num_args("SX_get_input",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Function" "'.");
  {
    try {
      result = casadi::Matrix< casadi::SXElem >::SWIGTEMPLATEDISAMBIGUATOR get_input((casadi::Function const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "SX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_get_input'."
      "  Prototype:\n"
      "    GET_INPUT(Function)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_get_free(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = 0 ;
  casadi::Function m1 ;
  mxArray * _out;
  std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > result;
  
  if (!SWIG_check_num_args("SX_get_free",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Function" "'.");
  {
    try {
      result = casadi::Matrix< casadi::SXElem >::SWIGTEMPLATEDISAMBIGUATOR get_free((casadi::Function const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "SX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_get_free'."
      "  Prototype:\n"
      "    GET_FREE(Function)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_type_name(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("SX_type_name",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      result = casadi::Matrix< casadi::SXElem >::SWIGTEMPLATEDISAMBIGUATOR type_name();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_type_name'."
      "  Prototype:\n"
      "    TYPE_NAME()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_print_split(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg2 = 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< std::string > m2 ;
  std::vector< std::string > m3 ;
  mxArray * _out;
  
  arg2 = &m2;
  arg3 = &m3;
  if (!SWIG_check_num_args("SX_print_split",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_print_split" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Matrix< casadi::SXElem > const *)arg1)->print_split(*arg2,*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg3);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_print_split'."
      "  Prototype:\n"
      "    PRINT_SPLIT(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_disp(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  std::ostream *arg2 = 0 ;
  bool arg3 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  arg2 = &casadi::uout();
  if (!SWIG_check_num_args("SX_disp",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_disp" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Matrix< casadi::SXElem > const *)arg1)->disp(*arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  *arg2 << "\n" << std::flush;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_disp'."
      "  Prototype:\n"
      "    DISP(self,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_str(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  bool arg2 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("SX_str",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_str" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Matrix< casadi::SXElem > const *)arg1)->get_str(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_str'."
      "  Prototype:\n"
      "    STR(self,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_print_scalar(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  std::ostream *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  arg2 = &casadi::uout();
  if (!SWIG_check_num_args("SX_print_scalar",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_print_scalar" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Matrix< casadi::SXElem > const *)arg1)->print_scalar(*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  *arg2 << "\n" << std::flush;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_print_scalar'."
      "  Prototype:\n"
      "    PRINT_SCALAR(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_print_vector(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  std::ostream *arg2 = 0 ;
  bool arg3 = (bool) true ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  arg2 = &casadi::uout();
  if (!SWIG_check_num_args("SX_print_vector",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_print_vector" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Matrix< casadi::SXElem > const *)arg1)->print_vector(*arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  *arg2 << "\n" << std::flush;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_print_vector'."
      "  Prototype:\n"
      "    PRINT_VECTOR(self,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_print_dense(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  std::ostream *arg2 = 0 ;
  bool arg3 = (bool) true ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  arg2 = &casadi::uout();
  if (!SWIG_check_num_args("SX_print_dense",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_print_dense" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Matrix< casadi::SXElem > const *)arg1)->print_dense(*arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  *arg2 << "\n" << std::flush;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_print_dense'."
      "  Prototype:\n"
      "    PRINT_DENSE(self,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_print_sparse(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  std::ostream *arg2 = 0 ;
  bool arg3 = (bool) true ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  arg2 = &casadi::uout();
  if (!SWIG_check_num_args("SX_print_sparse",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_print_sparse" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Matrix< casadi::SXElem > const *)arg1)->print_sparse(*arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  *arg2 << "\n" << std::flush;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_print_sparse'."
      "  Prototype:\n"
      "    PRINT_SPARSE(self,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_clear(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("SX_clear",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_clear" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->clear();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_clear'."
      "  Prototype:\n"
      "    CLEAR(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_resize(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  casadi_int arg2 ;
  casadi_int arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("SX_resize",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_resize" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->resize(arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_resize'."
      "  Prototype:\n"
      "    RESIZE(self,int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_reserve__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  casadi_int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("SX_reserve",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_reserve" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->reserve(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_reserve'."
      "  Prototype:\n"
      "    RESERVE(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_reserve__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  casadi_int arg2 ;
  casadi_int arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("SX_reserve",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_reserve" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->reserve(arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_reserve'."
      "  Prototype:\n"
      "    RESERVE(self,int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_reserve(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_SX_reserve__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          return _wrap_SX_reserve__SWIG_1(resc,resv,argc,argv);
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_reserve'."
    "  Possible prototypes are:\n"
    "    RESERVE(self,int)\n"
    "    RESERVE(self,int,int)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_SX_erase__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg2 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg3 = 0 ;
  bool arg4 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< casadi_int > m2 ;
  std::vector< casadi_int > m3 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("SX_erase",argc,4,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_erase" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "[" "int" "]" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "[" "int" "]" "'.");
  if (3<argc) {
    if (!casadi::to_val(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->erase((std::vector< casadi_int,std::allocator< casadi_int > > const &)*arg2,(std::vector< casadi_int,std::allocator< casadi_int > > const &)*arg3,arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_erase'."
      "  Prototype:\n"
      "    ERASE(self,[int],[int],bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_erase__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg2 = 0 ;
  bool arg3 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< casadi_int > m2 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("SX_erase",argc,3,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_erase" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "[" "int" "]" "'.");
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->erase((std::vector< casadi_int,std::allocator< casadi_int > > const &)*arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_erase'."
      "  Prototype:\n"
      "    ERASE(self,[int],bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_erase(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 2) && (argc <= 3)) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<casadi_int> **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_SX_erase__SWIG_1(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< bool **>(0));
        if (_v) {
          return _wrap_SX_erase__SWIG_1(resc,resv,argc,argv);
        }
      }
    }
  }
  if ((argc >= 3) && (argc <= 4)) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<casadi_int> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::vector<casadi_int> **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_SX_erase__SWIG_0(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< bool **>(0));
          if (_v) {
            return _wrap_SX_erase__SWIG_0(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_erase'."
    "  Possible prototypes are:\n"
    "    ERASE(self,[int],bool)\n"
    "    ERASE(self,[int],[int],bool)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_SX_remove(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg2 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< casadi_int > m2 ;
  std::vector< casadi_int > m3 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("SX_remove",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_remove" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "[" "int" "]" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "[" "int" "]" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->remove((std::vector< casadi_int,std::allocator< casadi_int > > const &)*arg2,(std::vector< casadi_int,std::allocator< casadi_int > > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_remove'."
      "  Prototype:\n"
      "    REMOVE(self,[int],[int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_enlarge(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  casadi_int arg2 ;
  casadi_int arg3 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg4 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg5 = 0 ;
  bool arg6 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< casadi_int > m4 ;
  std::vector< casadi_int > m5 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("SX_enlarge",argc,6,5,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_enlarge" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "[" "int" "]" "'.");
  arg5 = &m5;
  if (!casadi::to_ptr(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "[" "int" "]" "'.");
  if (5<argc) {
    if (!casadi::to_val(argv[5], &arg6)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 6 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->enlarge(arg2,arg3,(std::vector< casadi_int,std::allocator< casadi_int > > const &)*arg4,(std::vector< casadi_int,std::allocator< casadi_int > > const &)*arg5,arg6);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_enlarge'."
      "  Prototype:\n"
      "    ENLARGE(self,int,int,[int],[int],bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_sparsity(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("SX_sparsity",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_sparsity" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Matrix< casadi::SXElem > const *)arg1)->get_sparsity();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_sparsity'."
      "  Prototype:\n"
      "    SPARSITY(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_triplet__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< casadi_int,std::allocator< casadi_int > > *arg1 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg3 = 0 ;
  std::vector< casadi_int > m1 ;
  std::vector< casadi_int > m2 ;
  casadi::Matrix< casadi::SXElem > m3 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("SX_triplet",argc,3,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "[" "int" "]" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "[" "int" "]" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "SX" "'.");
  {
    try {
      result = casadi::Matrix< casadi::SXElem >::SWIGTEMPLATEDISAMBIGUATOR triplet((std::vector< long long,std::allocator< long long > > const &)*arg1,(std::vector< long long,std::allocator< long long > > const &)*arg2,(casadi::Matrix< casadi::SXElem > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_triplet'."
      "  Prototype:\n"
      "    TRIPLET([int],[int],SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_triplet__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< casadi_int,std::allocator< casadi_int > > *arg1 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg3 = 0 ;
  casadi_int arg4 ;
  casadi_int arg5 ;
  std::vector< casadi_int > m1 ;
  std::vector< casadi_int > m2 ;
  casadi::Matrix< casadi::SXElem > m3 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("SX_triplet",argc,5,5,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "[" "int" "]" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "[" "int" "]" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "SX" "'.");
  if (!casadi::to_val(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "int" "'.");
  if (!casadi::to_val(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "int" "'.");
  {
    try {
      result = casadi::Matrix< casadi::SXElem >::SWIGTEMPLATEDISAMBIGUATOR triplet((std::vector< long long,std::allocator< long long > > const &)*arg1,(std::vector< long long,std::allocator< long long > > const &)*arg2,(casadi::Matrix< casadi::SXElem > const &)*arg3,arg4,arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_triplet'."
      "  Prototype:\n"
      "    TRIPLET([int],[int],SX,int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_triplet__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< casadi_int,std::allocator< casadi_int > > *arg1 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg3 = 0 ;
  std::pair< casadi_int,casadi_int > *arg4 = 0 ;
  std::vector< casadi_int > m1 ;
  std::vector< casadi_int > m2 ;
  casadi::Matrix< casadi::SXElem > m3 ;
  std::pair< casadi_int,casadi_int > m4 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("SX_triplet",argc,4,4,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "[" "int" "]" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "[" "int" "]" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "SX" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "[int,int]" "'.");
  {
    try {
      result = casadi::Matrix< casadi::SXElem >::SWIGTEMPLATEDISAMBIGUATOR triplet((std::vector< long long,std::allocator< long long > > const &)*arg1,(std::vector< long long,std::allocator< long long > > const &)*arg2,(casadi::Matrix< casadi::SXElem > const &)*arg3,(std::pair< long long,long long > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_triplet'."
      "  Prototype:\n"
      "    TRIPLET([int],[int],SX,[int,int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_triplet(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 3) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::vector<casadi_int> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<casadi_int> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
        if (_v) {
          return _wrap_SX_triplet__SWIG_0(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::vector<casadi_int> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<casadi_int> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< std::pair<casadi_int,casadi_int> **>(0));
          if (_v) {
            return _wrap_SX_triplet__SWIG_2(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if (argc == 5) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::vector<casadi_int> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<casadi_int> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi_int **>(0));
          if (_v) {
            _v = casadi::to_ptr(argv[4], static_cast< casadi_int **>(0));
            if (_v) {
              return _wrap_SX_triplet__SWIG_1(resc,resv,argc,argv);
            }
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_triplet'."
    "  Possible prototypes are:\n"
    "    TRIPLET([int],[int],SX)\n"
    "    TRIPLET([int],[int],SX,[int,int])\n"
    "    TRIPLET([int],[int],SX,int,int)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_SX_inf__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = 0 ;
  casadi::Sparsity m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("SX_inf",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Sparsity" "'.");
  {
    try {
      result = casadi::Matrix< casadi::SXElem >::SWIGTEMPLATEDISAMBIGUATOR inf((casadi::Sparsity const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_inf'."
      "  Prototype:\n"
      "    INF(Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_inf__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 = (casadi_int) 1 ;
  casadi_int arg2 = (casadi_int) 1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("SX_inf",argc,2,0,0)) {
    SWIG_fail;
  }
  if (0<argc) {
    if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  }
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  }
  {
    try {
      result = casadi::Matrix< casadi::SXElem >::SWIGTEMPLATEDISAMBIGUATOR inf(arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_inf'."
      "  Prototype:\n"
      "    INF(int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_inf__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::pair< casadi_int,casadi_int > *arg1 = 0 ;
  std::pair< casadi_int,casadi_int > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("SX_inf",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "[int,int]" "'.");
  {
    try {
      result = casadi::Matrix< casadi::SXElem >::SWIGTEMPLATEDISAMBIGUATOR inf((std::pair< long long,long long > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_inf'."
      "  Prototype:\n"
      "    INF([int,int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_inf(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 0) && (argc <= 2)) {
    int _v;
    if (argc <= 0) {
      return _wrap_SX_inf__SWIG_1(resc,resv,argc,argv);
    }
    _v = casadi::to_ptr(argv[0], static_cast< casadi_int **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_SX_inf__SWIG_1(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_SX_inf__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::pair<casadi_int,casadi_int> **>(0));
    if (_v) {
      return _wrap_SX_inf__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Sparsity **>(0));
    if (_v) {
      return _wrap_SX_inf__SWIG_0(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_inf'."
    "  Possible prototypes are:\n"
    "    INF(int,int)\n"
    "    INF([int,int])\n"
    "    INF(Sparsity)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_SX_nan__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = 0 ;
  casadi::Sparsity m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("SX_nan",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Sparsity" "'.");
  {
    try {
      result = casadi::Matrix< casadi::SXElem >::SWIGTEMPLATEDISAMBIGUATOR nan((casadi::Sparsity const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_nan'."
      "  Prototype:\n"
      "    NAN(Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_nan__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 = (casadi_int) 1 ;
  casadi_int arg2 = (casadi_int) 1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("SX_nan",argc,2,0,0)) {
    SWIG_fail;
  }
  if (0<argc) {
    if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  }
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  }
  {
    try {
      result = casadi::Matrix< casadi::SXElem >::SWIGTEMPLATEDISAMBIGUATOR nan(arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_nan'."
      "  Prototype:\n"
      "    NAN(int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_nan__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::pair< casadi_int,casadi_int > *arg1 = 0 ;
  std::pair< casadi_int,casadi_int > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("SX_nan",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "[int,int]" "'.");
  {
    try {
      result = casadi::Matrix< casadi::SXElem >::SWIGTEMPLATEDISAMBIGUATOR nan((std::pair< long long,long long > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_nan'."
      "  Prototype:\n"
      "    NAN([int,int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_nan(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 0) && (argc <= 2)) {
    int _v;
    if (argc <= 0) {
      return _wrap_SX_nan__SWIG_1(resc,resv,argc,argv);
    }
    _v = casadi::to_ptr(argv[0], static_cast< casadi_int **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_SX_nan__SWIG_1(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_SX_nan__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::pair<casadi_int,casadi_int> **>(0));
    if (_v) {
      return _wrap_SX_nan__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Sparsity **>(0));
    if (_v) {
      return _wrap_SX_nan__SWIG_0(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_nan'."
    "  Possible prototypes are:\n"
    "    NAN(int,int)\n"
    "    NAN([int,int])\n"
    "    NAN(Sparsity)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_SX_eye(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("SX_eye",argc,1,1,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  {
    try {
      result = casadi::Matrix< casadi::SXElem >::SWIGTEMPLATEDISAMBIGUATOR eye(arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_eye'."
      "  Prototype:\n"
      "    EYE(int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_element_hash(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("SX_element_hash",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_element_hash" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::Matrix< casadi::SXElem > const *)arg1)->element_hash();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_element_hash'."
      "  Prototype:\n"
      "    ELEMENT_HASH(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_is_regular(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("SX_is_regular",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_is_regular" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Matrix< casadi::SXElem > const *)arg1)->is_regular();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_is_regular'."
      "  Prototype:\n"
      "    IS_REGULAR(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_is_smooth(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("SX_is_smooth",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_is_smooth" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Matrix< casadi::SXElem > const *)arg1)->is_smooth();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_is_smooth'."
      "  Prototype:\n"
      "    IS_SMOOTH(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_is_leaf(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("SX_is_leaf",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_is_leaf" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Matrix< casadi::SXElem > const *)arg1)->is_leaf();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_is_leaf'."
      "  Prototype:\n"
      "    IS_LEAF(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_is_commutative(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("SX_is_commutative",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_is_commutative" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Matrix< casadi::SXElem > const *)arg1)->is_commutative();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_is_commutative'."
      "  Prototype:\n"
      "    IS_COMMUTATIVE(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_is_symbolic(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("SX_is_symbolic",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_is_symbolic" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Matrix< casadi::SXElem > const *)arg1)->is_symbolic();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_is_symbolic'."
      "  Prototype:\n"
      "    IS_SYMBOLIC(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_is_valid_input(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("SX_is_valid_input",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_is_valid_input" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Matrix< casadi::SXElem > const *)arg1)->is_valid_input();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_is_valid_input'."
      "  Prototype:\n"
      "    IS_VALID_INPUT(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_has_duplicates(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("SX_has_duplicates",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_has_duplicates" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Matrix< casadi::SXElem > const *)arg1)->has_duplicates();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_has_duplicates'."
      "  Prototype:\n"
      "    HAS_DUPLICATES(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_reset_input(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("SX_reset_input",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_reset_input" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Matrix< casadi::SXElem > const *)arg1)->reset_input();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_reset_input'."
      "  Prototype:\n"
      "    RESET_INPUT(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_is_constant(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("SX_is_constant",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_is_constant" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Matrix< casadi::SXElem > const *)arg1)->is_constant();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_is_constant'."
      "  Prototype:\n"
      "    IS_CONSTANT(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_is_integer(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("SX_is_integer",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_is_integer" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Matrix< casadi::SXElem > const *)arg1)->is_integer();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_is_integer'."
      "  Prototype:\n"
      "    IS_INTEGER(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_is_zero(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("SX_is_zero",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_is_zero" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Matrix< casadi::SXElem > const *)arg1)->is_zero();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_is_zero'."
      "  Prototype:\n"
      "    IS_ZERO(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_is_one(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("SX_is_one",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_is_one" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Matrix< casadi::SXElem > const *)arg1)->is_one();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_is_one'."
      "  Prototype:\n"
      "    IS_ONE(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_is_minus_one(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("SX_is_minus_one",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_is_minus_one" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Matrix< casadi::SXElem > const *)arg1)->is_minus_one();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_is_minus_one'."
      "  Prototype:\n"
      "    IS_MINUS_ONE(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_is_eye(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("SX_is_eye",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_is_eye" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Matrix< casadi::SXElem > const *)arg1)->is_eye();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_is_eye'."
      "  Prototype:\n"
      "    IS_EYE(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_op(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("SX_op",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_op" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::Matrix< casadi::SXElem > const *)arg1)->op();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_op'."
      "  Prototype:\n"
      "    OP(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_is_op(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  casadi_int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("SX_is_op",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_is_op" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Matrix< casadi::SXElem > const *)arg1)->is_op(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_is_op'."
      "  Prototype:\n"
      "    IS_OP(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_has_zeros(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("SX_has_zeros",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_has_zeros" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Matrix< casadi::SXElem > const *)arg1)->has_zeros();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_has_zeros'."
      "  Prototype:\n"
      "    HAS_ZEROS(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_nonzeros(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi::SXElem,std::allocator< casadi::SXElem > > result;
  
  if (!SWIG_check_num_args("SX_nonzeros",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_nonzeros" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Matrix< casadi::SXElem > const *)arg1)->get_nonzeros();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "SXElem" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_nonzeros'."
      "  Prototype:\n"
      "    NONZEROS(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_elements(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi::SXElem,std::allocator< casadi::SXElem > > result;
  
  if (!SWIG_check_num_args("SX_elements",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_elements" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Matrix< casadi::SXElem > const *)arg1)->get_elements();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "SXElem" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_elements'."
      "  Prototype:\n"
      "    ELEMENTS(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_to_double(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  double result;
  
  if (!SWIG_check_num_args("SX_to_double",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_to_double" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (double)((casadi::Matrix< casadi::SXElem > const *)arg1)->operator double();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "double" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_to_double'."
      "  Prototype:\n"
      "    TO_DOUBLE(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_to_int(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("SX_to_int",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_to_int" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::Matrix< casadi::SXElem > const *)arg1)->operator casadi_int();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_to_int'."
      "  Prototype:\n"
      "    TO_INT(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_name(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("SX_name",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_name" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Matrix< casadi::SXElem > const *)arg1)->name();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_name'."
      "  Prototype:\n"
      "    NAME(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_dep(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  casadi_int arg2 = (casadi_int) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("SX_dep",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_dep" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Matrix< casadi::SXElem > const *)arg1)->dep(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_dep'."
      "  Prototype:\n"
      "    DEP(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_n_dep(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("SX_n_dep",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_n_dep" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::Matrix< casadi::SXElem > const *)arg1)->n_dep();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_n_dep'."
      "  Prototype:\n"
      "    N_DEP(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_set_precision(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("SX_set_precision",argc,1,1,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  {
    try {
      casadi::Matrix< casadi::SXElem >::SWIGTEMPLATEDISAMBIGUATOR set_precision(arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_set_precision'."
      "  Prototype:\n"
      "    SET_PRECISION(int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_set_width(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("SX_set_width",argc,1,1,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  {
    try {
      casadi::Matrix< casadi::SXElem >::SWIGTEMPLATEDISAMBIGUATOR set_width(arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_set_width'."
      "  Prototype:\n"
      "    SET_WIDTH(int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_set_scientific(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  bool arg1 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("SX_set_scientific",argc,1,1,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "bool" "'.");
  {
    try {
      casadi::Matrix< casadi::SXElem >::SWIGTEMPLATEDISAMBIGUATOR set_scientific(arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_set_scientific'."
      "  Prototype:\n"
      "    SET_SCIENTIFIC(bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_rng(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("SX_rng",argc,1,1,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  {
    try {
      casadi::Matrix< casadi::SXElem >::SWIGTEMPLATEDISAMBIGUATOR rng(arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_rng'."
      "  Prototype:\n"
      "    RNG(int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_rand__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 = (casadi_int) 1 ;
  casadi_int arg2 = (casadi_int) 1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("SX_rand",argc,2,0,0)) {
    SWIG_fail;
  }
  if (0<argc) {
    if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  }
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  }
  {
    try {
      result = casadi::Matrix< casadi::SXElem >::SWIGTEMPLATEDISAMBIGUATOR rand(arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_rand'."
      "  Prototype:\n"
      "    RAND(int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_rand__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = 0 ;
  casadi::Sparsity m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("SX_rand",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Sparsity" "'.");
  {
    try {
      result = casadi::Matrix< casadi::SXElem >::SWIGTEMPLATEDISAMBIGUATOR rand((casadi::Sparsity const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_rand'."
      "  Prototype:\n"
      "    RAND(Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_rand__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::pair< casadi_int,casadi_int > *arg1 = 0 ;
  std::pair< casadi_int,casadi_int > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("SX_rand",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "[int,int]" "'.");
  {
    try {
      result = casadi::Matrix< casadi::SXElem >::SWIGTEMPLATEDISAMBIGUATOR rand((std::pair< long long,long long > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_rand'."
      "  Prototype:\n"
      "    RAND([int,int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_rand(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 0) && (argc <= 2)) {
    int _v;
    if (argc <= 0) {
      return _wrap_SX_rand__SWIG_0(resc,resv,argc,argv);
    }
    _v = casadi::to_ptr(argv[0], static_cast< casadi_int **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_SX_rand__SWIG_0(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_SX_rand__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::pair<casadi_int,casadi_int> **>(0));
    if (_v) {
      return _wrap_SX_rand__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Sparsity **>(0));
    if (_v) {
      return _wrap_SX_rand__SWIG_1(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_rand'."
    "  Possible prototypes are:\n"
    "    RAND(int,int)\n"
    "    RAND([int,int])\n"
    "    RAND(Sparsity)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_SX_export_code(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  std::string *arg2 = 0 ;
  std::ostream &arg3_defvalue = casadi::uout() ;
  std::ostream *arg3 = (std::ostream *) &arg3_defvalue ;
  casadi::Dict const &arg4_defvalue = casadi::Dict() ;
  casadi::Dict *arg4 = (casadi::Dict *) &arg4_defvalue ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  std::map< std::string,casadi::GenericType > m4 ;
  mxArray * _out;
  
  arg3 = &casadi::uout();
  if (!SWIG_check_num_args("SX_export_code",argc,3,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_export_code" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  if (2<argc) {
    arg4 = &m4;
    if (!casadi::to_ptr(argv[2], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "struct" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Matrix< casadi::SXElem > const *)arg1)->export_code((std::string const &)*arg2,*arg3,(casadi::Dict const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  *arg3 << "\n" << std::flush;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_export_code'."
      "  Prototype:\n"
      "    EXPORT_CODE(self,char,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_info(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Dict result;
  
  if (!SWIG_check_num_args("SX_info",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_info" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Matrix< casadi::SXElem > const *)arg1)->info();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "struct" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_info'."
      "  Prototype:\n"
      "    INFO(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_serialize__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("SX_serialize",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_serialize" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Matrix< casadi::SXElem > const *)arg1)->serialize();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_serialize'."
      "  Prototype:\n"
      "    SERIALIZE(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_deserialize__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::istream *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("SX_deserialize",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_std__istream,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_deserialize" "', argument " "1"" of type '" "std::istream &""'"); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "SX_deserialize" "', argument " "1"" of type '" "std::istream &""'"); 
  }
  arg1 = reinterpret_cast< std::istream * >(argp1);
  {
    try {
      result = casadi::Matrix< casadi::SXElem >::SWIGTEMPLATEDISAMBIGUATOR deserialize(*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_deserialize'."
      "  Prototype:\n"
      "    DESERIALIZE(std::istream &)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_deserialize__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("SX_deserialize",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  {
    try {
      result = casadi::Matrix< casadi::SXElem >::SWIGTEMPLATEDISAMBIGUATOR deserialize((std::string const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_deserialize'."
      "  Prototype:\n"
      "    DESERIALIZE(char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_serialize__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  casadi::SerializingStream *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("SX_serialize",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_serialize" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  res2 = SWIG_ConvertPtr(argv[1], &argp2, SWIGTYPE_p_casadi__SerializingStream,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SX_serialize" "', argument " "2"" of type '" "casadi::SerializingStream &""'"); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "SX_serialize" "', argument " "2"" of type '" "casadi::SerializingStream &""'"); 
  }
  arg2 = reinterpret_cast< casadi::SerializingStream * >(argp2);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Matrix< casadi::SXElem > const *)arg1)->serialize(*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_serialize'."
      "  Prototype:\n"
      "    SERIALIZE(self,casadi::SerializingStream &)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_serialize(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_SX_serialize__SWIG_0(resc,resv,argc,argv);
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_casadi__SerializingStream, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap_SX_serialize__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_serialize'."
    "  Possible prototypes are:\n"
    "    SERIALIZE(self)\n"
    "    SERIALIZE(self,casadi::SerializingStream &)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_SX_deserialize__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DeserializingStream *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("SX_deserialize",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_casadi__DeserializingStream,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_deserialize" "', argument " "1"" of type '" "casadi::DeserializingStream &""'"); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "SX_deserialize" "', argument " "1"" of type '" "casadi::DeserializingStream &""'"); 
  }
  arg1 = reinterpret_cast< casadi::DeserializingStream * >(argp1);
  {
    try {
      result = casadi::Matrix< casadi::SXElem >::SWIGTEMPLATEDISAMBIGUATOR deserialize(*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_deserialize'."
      "  Prototype:\n"
      "    DESERIALIZE(casadi::DeserializingStream &)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_deserialize(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_std__istream, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_SX_deserialize__SWIG_0(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__DeserializingStream, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_SX_deserialize__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::string **>(0));
    if (_v) {
      return _wrap_SX_deserialize__SWIG_1(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_deserialize'."
    "  Possible prototypes are:\n"
    "    DESERIALIZE(std::istream &)\n"
    "    DESERIALIZE(casadi::DeserializingStream &)\n"
    "    DESERIALIZE(char)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_SX_to_file(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  std::string *arg2 = 0 ;
  std::string const &arg3_defvalue = "" ;
  std::string *arg3 = (std::string *) &arg3_defvalue ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  std::string m3 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("SX_to_file",argc,3,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_to_file" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  if (2<argc) {
    arg3 = &m3;
    if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "char" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Matrix< casadi::SXElem > const *)arg1)->to_file((std::string const &)*arg2,(std::string const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_to_file'."
      "  Prototype:\n"
      "    TO_FILE(self,char,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_from_file(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string const &arg2_defvalue = "" ;
  std::string *arg2 = (std::string *) &arg2_defvalue ;
  std::string m1 ;
  std::string m2 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("SX_from_file",argc,2,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  if (1<argc) {
    arg2 = &m2;
    if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  }
  {
    try {
      result = casadi::Matrix< casadi::SXElem >::SWIGTEMPLATEDISAMBIGUATOR from_file((std::string const &)*arg1,(std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_from_file'."
      "  Prototype:\n"
      "    FROM_FILE(char,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_paren__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  char arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  char val2 ;
  int ecode2 = 0 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("SX_paren",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_paren" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  ecode2 = SWIG_AsVal_char(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SX_paren" "', argument " "2"" of type '" "char""'");
  } 
  arg2 = static_cast< char >(val2);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = casadi_Matrix_Sl_casadi_SXElem_Sg__paren__SWIG_0((casadi::Matrix< casadi::SXElem > const *)arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_paren'."
      "  Prototype:\n"
      "    PAREN(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_paren__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  casadi::Matrix< casadi_int > *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< casadi_int > m2 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("SX_paren",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_paren" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "IM" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = casadi_Matrix_Sl_casadi_SXElem_Sg__paren__SWIG_1((casadi::Matrix< casadi::SXElem > const *)arg1,(casadi::Matrix< long long > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_paren'."
      "  Prototype:\n"
      "    PAREN(self,IM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_paren__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  casadi::Sparsity *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Sparsity m2 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("SX_paren",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_paren" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "Sparsity" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = casadi_Matrix_Sl_casadi_SXElem_Sg__paren__SWIG_2((casadi::Matrix< casadi::SXElem > const *)arg1,(casadi::Sparsity const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_paren'."
      "  Prototype:\n"
      "    PAREN(self,Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_paren__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  char arg2 ;
  char arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  char val2 ;
  int ecode2 = 0 ;
  char val3 ;
  int ecode3 = 0 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("SX_paren",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_paren" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  ecode2 = SWIG_AsVal_char(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SX_paren" "', argument " "2"" of type '" "char""'");
  } 
  arg2 = static_cast< char >(val2);
  ecode3 = SWIG_AsVal_char(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "SX_paren" "', argument " "3"" of type '" "char""'");
  } 
  arg3 = static_cast< char >(val3);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = casadi_Matrix_Sl_casadi_SXElem_Sg__paren__SWIG_3((casadi::Matrix< casadi::SXElem > const *)arg1,arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_paren'."
      "  Prototype:\n"
      "    PAREN(self,char,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_paren__SWIG_4(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  char arg2 ;
  casadi::Matrix< casadi_int > *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  char val2 ;
  int ecode2 = 0 ;
  casadi::Matrix< casadi_int > m3 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("SX_paren",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_paren" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  ecode2 = SWIG_AsVal_char(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SX_paren" "', argument " "2"" of type '" "char""'");
  } 
  arg2 = static_cast< char >(val2);
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "IM" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = casadi_Matrix_Sl_casadi_SXElem_Sg__paren__SWIG_4((casadi::Matrix< casadi::SXElem > const *)arg1,arg2,(casadi::Matrix< long long > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_paren'."
      "  Prototype:\n"
      "    PAREN(self,char,IM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_paren__SWIG_5(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  casadi::Matrix< casadi_int > *arg2 = 0 ;
  char arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< casadi_int > m2 ;
  char val3 ;
  int ecode3 = 0 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("SX_paren",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_paren" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "IM" "'.");
  ecode3 = SWIG_AsVal_char(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "SX_paren" "', argument " "3"" of type '" "char""'");
  } 
  arg3 = static_cast< char >(val3);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = casadi_Matrix_Sl_casadi_SXElem_Sg__paren__SWIG_5((casadi::Matrix< casadi::SXElem > const *)arg1,(casadi::Matrix< long long > const &)*arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_paren'."
      "  Prototype:\n"
      "    PAREN(self,IM,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_paren__SWIG_6(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  casadi::Matrix< casadi_int > *arg2 = 0 ;
  casadi::Matrix< casadi_int > *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< casadi_int > m2 ;
  casadi::Matrix< casadi_int > m3 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("SX_paren",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_paren" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "IM" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "IM" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = casadi_Matrix_Sl_casadi_SXElem_Sg__paren__SWIG_6((casadi::Matrix< casadi::SXElem > const *)arg1,(casadi::Matrix< long long > const &)*arg2,(casadi::Matrix< long long > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_paren'."
      "  Prototype:\n"
      "    PAREN(self,IM,IM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_paren(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Sparsity **>(0));
      if (_v) {
        return _wrap_SX_paren__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi_int> **>(0));
      if (_v) {
        return _wrap_SX_paren__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_char(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_SX_paren__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi_int> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<casadi_int> **>(0));
        if (_v) {
          return _wrap_SX_paren__SWIG_6(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi_int> **>(0));
      if (_v) {
        {
          int res = SWIG_AsVal_char(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_SX_paren__SWIG_5(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_char(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<casadi_int> **>(0));
        if (_v) {
          return _wrap_SX_paren__SWIG_4(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_char(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        {
          int res = SWIG_AsVal_char(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_SX_paren__SWIG_3(resc,resv,argc,argv);
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_paren'."
    "  Possible prototypes are:\n"
    "    PAREN(self,Sparsity)\n"
    "    PAREN(self,IM)\n"
    "    PAREN(self,char)\n"
    "    PAREN(self,IM,IM)\n"
    "    PAREN(self,IM,char)\n"
    "    PAREN(self,char,IM)\n"
    "    PAREN(self,char,char)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_SX_paren_asgn__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  char arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  char val3 ;
  int ecode3 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("SX_paren_asgn",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_paren_asgn" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  ecode3 = SWIG_AsVal_char(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "SX_paren_asgn" "', argument " "3"" of type '" "char""'");
  } 
  arg3 = static_cast< char >(val3);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      casadi_Matrix_Sl_casadi_SXElem_Sg__paren_asgn__SWIG_0(arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_paren_asgn'."
      "  Prototype:\n"
      "    PAREN_ASGN(self,SX,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_paren_asgn__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi_int > *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  casadi::Matrix< casadi_int > m3 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("SX_paren_asgn",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_paren_asgn" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "IM" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      casadi_Matrix_Sl_casadi_SXElem_Sg__paren_asgn__SWIG_1(arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2,(casadi::Matrix< long long > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_paren_asgn'."
      "  Prototype:\n"
      "    PAREN_ASGN(self,SX,IM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_paren_asgn__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Sparsity *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  casadi::Sparsity m3 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("SX_paren_asgn",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_paren_asgn" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "Sparsity" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      casadi_Matrix_Sl_casadi_SXElem_Sg__paren_asgn__SWIG_2(arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2,(casadi::Sparsity const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_paren_asgn'."
      "  Prototype:\n"
      "    PAREN_ASGN(self,SX,Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_paren_asgn__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  char arg3 ;
  char arg4 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  char val3 ;
  int ecode3 = 0 ;
  char val4 ;
  int ecode4 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("SX_paren_asgn",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_paren_asgn" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  ecode3 = SWIG_AsVal_char(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "SX_paren_asgn" "', argument " "3"" of type '" "char""'");
  } 
  arg3 = static_cast< char >(val3);
  ecode4 = SWIG_AsVal_char(argv[3], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "SX_paren_asgn" "', argument " "4"" of type '" "char""'");
  } 
  arg4 = static_cast< char >(val4);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      casadi_Matrix_Sl_casadi_SXElem_Sg__paren_asgn__SWIG_3(arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2,arg3,arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_paren_asgn'."
      "  Prototype:\n"
      "    PAREN_ASGN(self,SX,char,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_paren_asgn__SWIG_4(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  char arg3 ;
  casadi::Matrix< casadi_int > *arg4 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  char val3 ;
  int ecode3 = 0 ;
  casadi::Matrix< casadi_int > m4 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("SX_paren_asgn",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_paren_asgn" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  ecode3 = SWIG_AsVal_char(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "SX_paren_asgn" "', argument " "3"" of type '" "char""'");
  } 
  arg3 = static_cast< char >(val3);
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "IM" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      casadi_Matrix_Sl_casadi_SXElem_Sg__paren_asgn__SWIG_4(arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2,arg3,(casadi::Matrix< long long > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_paren_asgn'."
      "  Prototype:\n"
      "    PAREN_ASGN(self,SX,char,IM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_paren_asgn__SWIG_5(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi_int > *arg3 = 0 ;
  char arg4 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  casadi::Matrix< casadi_int > m3 ;
  char val4 ;
  int ecode4 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("SX_paren_asgn",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_paren_asgn" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "IM" "'.");
  ecode4 = SWIG_AsVal_char(argv[3], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "SX_paren_asgn" "', argument " "4"" of type '" "char""'");
  } 
  arg4 = static_cast< char >(val4);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      casadi_Matrix_Sl_casadi_SXElem_Sg__paren_asgn__SWIG_5(arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2,(casadi::Matrix< long long > const &)*arg3,arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_paren_asgn'."
      "  Prototype:\n"
      "    PAREN_ASGN(self,SX,IM,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_paren_asgn__SWIG_6(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi_int > *arg3 = 0 ;
  casadi::Matrix< casadi_int > *arg4 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  casadi::Matrix< casadi_int > m3 ;
  casadi::Matrix< casadi_int > m4 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("SX_paren_asgn",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_paren_asgn" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "IM" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "IM" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      casadi_Matrix_Sl_casadi_SXElem_Sg__paren_asgn__SWIG_6(arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2,(casadi::Matrix< long long > const &)*arg3,(casadi::Matrix< long long > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_paren_asgn'."
      "  Prototype:\n"
      "    PAREN_ASGN(self,SX,IM,IM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_paren_asgn(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Sparsity **>(0));
        if (_v) {
          return _wrap_SX_paren_asgn__SWIG_2(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<casadi_int> **>(0));
        if (_v) {
          return _wrap_SX_paren_asgn__SWIG_1(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        {
          int res = SWIG_AsVal_char(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_SX_paren_asgn__SWIG_0(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<casadi_int> **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::Matrix<casadi_int> **>(0));
          if (_v) {
            return _wrap_SX_paren_asgn__SWIG_6(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<casadi_int> **>(0));
        if (_v) {
          {
            int res = SWIG_AsVal_char(argv[3], NULL);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            return _wrap_SX_paren_asgn__SWIG_5(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        {
          int res = SWIG_AsVal_char(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::Matrix<casadi_int> **>(0));
          if (_v) {
            return _wrap_SX_paren_asgn__SWIG_4(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        {
          int res = SWIG_AsVal_char(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          {
            int res = SWIG_AsVal_char(argv[3], NULL);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            return _wrap_SX_paren_asgn__SWIG_3(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_paren_asgn'."
    "  Possible prototypes are:\n"
    "    PAREN_ASGN(self,SX,Sparsity)\n"
    "    PAREN_ASGN(self,SX,IM)\n"
    "    PAREN_ASGN(self,SX,char)\n"
    "    PAREN_ASGN(self,SX,IM,IM)\n"
    "    PAREN_ASGN(self,SX,IM,char)\n"
    "    PAREN_ASGN(self,SX,char,IM)\n"
    "    PAREN_ASGN(self,SX,char,char)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_SX_brace__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  char arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  char val2 ;
  int ecode2 = 0 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("SX_brace",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_brace" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  ecode2 = SWIG_AsVal_char(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SX_brace" "', argument " "2"" of type '" "char""'");
  } 
  arg2 = static_cast< char >(val2);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = casadi_Matrix_Sl_casadi_SXElem_Sg__brace__SWIG_0((casadi::Matrix< casadi::SXElem > const *)arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_brace'."
      "  Prototype:\n"
      "    BRACE(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_brace__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  casadi::Matrix< casadi_int > *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< casadi_int > m2 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("SX_brace",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_brace" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "IM" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = casadi_Matrix_Sl_casadi_SXElem_Sg__brace__SWIG_1((casadi::Matrix< casadi::SXElem > const *)arg1,(casadi::Matrix< long long > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_brace'."
      "  Prototype:\n"
      "    BRACE(self,IM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_brace(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi_int> **>(0));
      if (_v) {
        return _wrap_SX_brace__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_char(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_SX_brace__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_brace'."
    "  Possible prototypes are:\n"
    "    BRACE(self,IM)\n"
    "    BRACE(self,char)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_SX_setbrace__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  char arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  char val3 ;
  int ecode3 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("SX_setbrace",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_setbrace" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  ecode3 = SWIG_AsVal_char(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "SX_setbrace" "', argument " "3"" of type '" "char""'");
  } 
  arg3 = static_cast< char >(val3);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      casadi_Matrix_Sl_casadi_SXElem_Sg__setbrace__SWIG_0(arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_setbrace'."
      "  Prototype:\n"
      "    SETBRACE(self,SX,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_setbrace__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi_int > *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  casadi::Matrix< casadi_int > m3 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("SX_setbrace",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_setbrace" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "IM" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      casadi_Matrix_Sl_casadi_SXElem_Sg__setbrace__SWIG_1(arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2,(casadi::Matrix< long long > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_setbrace'."
      "  Prototype:\n"
      "    SETBRACE(self,SX,IM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_setbrace(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<casadi_int> **>(0));
        if (_v) {
          return _wrap_SX_setbrace__SWIG_1(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        {
          int res = SWIG_AsVal_char(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_SX_setbrace__SWIG_0(resc,resv,argc,argv);
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_setbrace'."
    "  Possible prototypes are:\n"
    "    SETBRACE(self,SX,IM)\n"
    "    SETBRACE(self,SX,char)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_SX_end(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  casadi_int arg2 ;
  casadi_int arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("SX_end",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_end" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)casadi_Matrix_Sl_casadi_SXElem_Sg__end((casadi::Matrix< casadi::SXElem > const *)arg1,arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_end'."
      "  Prototype:\n"
      "    END(self,int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_numel__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  casadi_int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("SX_numel",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_numel" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)casadi_Matrix_Sl_casadi_SXElem_Sg__numel__SWIG_0((casadi::Matrix< casadi::SXElem > const *)arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_numel'."
      "  Prototype:\n"
      "    NUMEL(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_numel__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  char arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  char val2 ;
  int ecode2 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("SX_numel",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_numel" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  ecode2 = SWIG_AsVal_char(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SX_numel" "', argument " "2"" of type '" "char""'");
  } 
  arg2 = static_cast< char >(val2);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)casadi_Matrix_Sl_casadi_SXElem_Sg__numel__SWIG_1((casadi::Matrix< casadi::SXElem > const *)arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_numel'."
      "  Prototype:\n"
      "    NUMEL(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_numel__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< casadi_int > m2 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("SX_numel",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_numel" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "[" "int" "]" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)casadi_Matrix_Sl_casadi_SXElem_Sg__numel__SWIG_2((casadi::Matrix< casadi::SXElem > const *)arg1,(std::vector< long long,std::allocator< long long > > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_numel'."
      "  Prototype:\n"
      "    NUMEL(self,[int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_numel__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("SX_numel",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_numel" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)casadi_Matrix_Sl_casadi_SXElem_Sg__numel__SWIG_3((casadi::Matrix< casadi::SXElem > const *)arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_numel'."
      "  Prototype:\n"
      "    NUMEL(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SX_numel(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_SX_numel__SWIG_3(resc,resv,argc,argv);
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_SX_numel__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<casadi_int> **>(0));
      if (_v) {
        return _wrap_SX_numel__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_char(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_SX_numel__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_numel'."
    "  Possible prototypes are:\n"
    "    NUMEL(self)\n"
    "    NUMEL(self,int)\n"
    "    NUMEL(self,[int])\n"
    "    NUMEL(self,char)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_SX_ctranspose(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("SX_ctranspose",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SX_ctranspose" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = casadi_Matrix_Sl_casadi_SXElem_Sg__ctranspose((casadi::Matrix< casadi::SXElem > const *)arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SX_ctranspose'."
      "  Prototype:\n"
      "    CTRANSPOSE(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_SX__SWIG_6(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > *result = 0 ;
  
  if (!SWIG_check_num_args("new_SX",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = (casadi::Matrix< casadi::SXElem > *)new casadi::Matrix< casadi::SXElem >((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_SX'."
      "  Prototype:\n"
      "    SX(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_SX(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 0) {
    return _wrap_new_SX__SWIG_0(resc,resv,argc,argv);
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Sparsity **>(0));
    if (_v) {
      return _wrap_new_SX__SWIG_3(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< double **>(0));
    if (_v) {
      return _wrap_new_SX__SWIG_5(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_new_SX__SWIG_6(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      return _wrap_new_SX__SWIG_1(resc,resv,argc,argv);
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi_int **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_new_SX__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Sparsity **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        return _wrap_new_SX__SWIG_4(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_SX'."
    "  Possible prototypes are:\n"
    "    SX()\n"
    "    SX(Sparsity)\n"
    "    SX(double)\n"
    "    SX(DM)\n"
    "    SX(SX)\n"
    "    SX(int,int)\n"
    "    SX(Sparsity,SX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_delete_SX(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = (casadi::Matrix< casadi::SXElem > *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  int is_owned;
  if (!SWIG_check_num_args("delete_SX",argc,1,1,0)) {
    SWIG_fail;
  }
  is_owned = SWIG_Matlab_isOwned(argv[0]);
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MatrixT_casadi__SXElem_t, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_SX" "', argument " "1"" of type '" "casadi::Matrix< casadi::SXElem > *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Matrix< casadi::SXElem > * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  if (is_owned) {
    {
      delete arg1;
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'delete_SX'."
      "  Prototype:\n"
      "    SX(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_type_name(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("MX_type_name",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      result = casadi::MX::type_name();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_type_name'."
      "  Prototype:\n"
      "    TYPE_NAME()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_MX__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  casadi::MX *result = 0 ;
  
  if (!SWIG_check_num_args("new_MX",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      result = (casadi::MX *)new casadi::MX();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__MX, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_MX'."
      "  Prototype:\n"
      "    MX()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_MX__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 ;
  casadi_int arg2 ;
  mxArray * _out;
  casadi::MX *result = 0 ;
  
  if (!SWIG_check_num_args("new_MX",argc,2,2,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  {
    try {
      result = (casadi::MX *)new casadi::MX(arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__MX, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_MX'."
      "  Prototype:\n"
      "    MX(int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_MX__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = 0 ;
  casadi::Sparsity m1 ;
  mxArray * _out;
  casadi::MX *result = 0 ;
  
  if (!SWIG_check_num_args("new_MX",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Sparsity" "'.");
  {
    try {
      result = (casadi::MX *)new casadi::MX((casadi::Sparsity const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__MX, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_MX'."
      "  Prototype:\n"
      "    MX(Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_MX__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::Sparsity m1 ;
  casadi::MX m2 ;
  mxArray * _out;
  casadi::MX *result = 0 ;
  
  if (!SWIG_check_num_args("new_MX",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Sparsity" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  {
    try {
      result = (casadi::MX *)new casadi::MX((casadi::Sparsity const &)*arg1,(casadi::MX const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__MX, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_MX'."
      "  Prototype:\n"
      "    MX(Sparsity,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_MX__SWIG_4(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = 0 ;
  std::string *arg2 = 0 ;
  casadi::Sparsity m1 ;
  std::string m2 ;
  mxArray * _out;
  casadi::MX *result = 0 ;
  
  if (!SWIG_check_num_args("new_MX",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Sparsity" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  {
    try {
      result = (casadi::MX *)new casadi::MX((casadi::Sparsity const &)*arg1,(std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__MX, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_MX'."
      "  Prototype:\n"
      "    MX(Sparsity,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_MX__SWIG_5(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  double arg1 ;
  mxArray * _out;
  casadi::MX *result = 0 ;
  
  if (!SWIG_check_num_args("new_MX",argc,1,1,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "double" "'.");
  {
    try {
      result = (casadi::MX *)new casadi::MX(arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__MX, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_MX'."
      "  Prototype:\n"
      "    MX(double)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_MX__SWIG_6(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > m1 ;
  mxArray * _out;
  casadi::MX *result = 0 ;
  
  if (!SWIG_check_num_args("new_MX",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  {
    try {
      result = (casadi::MX *)new casadi::MX((casadi::Matrix< double > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__MX, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_MX'."
      "  Prototype:\n"
      "    MX(DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_delete_MX(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  int is_owned;
  if (!SWIG_check_num_args("delete_MX",argc,1,1,0)) {
    SWIG_fail;
  }
  is_owned = SWIG_Matlab_isOwned(argv[0]);
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_MX" "', argument " "1"" of type '" "casadi::MX *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  if (is_owned) {
    {
      try {
        delete arg1;
      } catch(const std::exception& e) {
        SWIG_exception(SWIG_RuntimeError, e.what());
      }
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'delete_MX'."
      "  Prototype:\n"
      "    MX(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_nonzero(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("MX_nonzero",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_nonzero" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::MX const *)arg1)->__nonzero__();
    } catch (const std::exception& e) {
      SWIG_exception(SWIG_TypeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_nonzero'."
      "  Prototype:\n"
      "    NONZERO(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_sparsity(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("MX_sparsity",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_sparsity" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::MX const *)arg1)->get_sparsity();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_sparsity'."
      "  Prototype:\n"
      "    SPARSITY(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_erase__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg2 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg3 = 0 ;
  bool arg4 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< casadi_int > m2 ;
  std::vector< casadi_int > m3 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("MX_erase",argc,4,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_erase" "', argument " "1"" of type '" "casadi::MX *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "[" "int" "]" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "[" "int" "]" "'.");
  if (3<argc) {
    if (!casadi::to_val(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->erase((std::vector< casadi_int,std::allocator< casadi_int > > const &)*arg2,(std::vector< casadi_int,std::allocator< casadi_int > > const &)*arg3,arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_erase'."
      "  Prototype:\n"
      "    ERASE(self,[int],[int],bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_erase__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg2 = 0 ;
  bool arg3 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< casadi_int > m2 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("MX_erase",argc,3,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_erase" "', argument " "1"" of type '" "casadi::MX *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "[" "int" "]" "'.");
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->erase((std::vector< casadi_int,std::allocator< casadi_int > > const &)*arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_erase'."
      "  Prototype:\n"
      "    ERASE(self,[int],bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_erase(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 2) && (argc <= 3)) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MX, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<casadi_int> **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_MX_erase__SWIG_1(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< bool **>(0));
        if (_v) {
          return _wrap_MX_erase__SWIG_1(resc,resv,argc,argv);
        }
      }
    }
  }
  if ((argc >= 3) && (argc <= 4)) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MX, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<casadi_int> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::vector<casadi_int> **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_MX_erase__SWIG_0(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< bool **>(0));
          if (_v) {
            return _wrap_MX_erase__SWIG_0(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_erase'."
    "  Possible prototypes are:\n"
    "    ERASE(self,[int],bool)\n"
    "    ERASE(self,[int],[int],bool)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_MX_enlarge(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  casadi_int arg2 ;
  casadi_int arg3 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg4 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg5 = 0 ;
  bool arg6 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< casadi_int > m4 ;
  std::vector< casadi_int > m5 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("MX_enlarge",argc,6,5,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_enlarge" "', argument " "1"" of type '" "casadi::MX *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "[" "int" "]" "'.");
  arg5 = &m5;
  if (!casadi::to_ptr(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "[" "int" "]" "'.");
  if (5<argc) {
    if (!casadi::to_val(argv[5], &arg6)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 6 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->enlarge(arg2,arg3,(std::vector< casadi_int,std::allocator< casadi_int > > const &)*arg4,(std::vector< casadi_int,std::allocator< casadi_int > > const &)*arg5,arg6);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_enlarge'."
      "  Prototype:\n"
      "    ENLARGE(self,int,int,[int],[int],bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_uminus(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("MX_uminus",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_uminus" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::MX const *)arg1)->operator -();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_uminus'."
      "  Prototype:\n"
      "    UMINUS(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_dep(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  casadi_int arg2 = (casadi_int) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("MX_dep",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_dep" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::MX const *)arg1)->dep(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_dep'."
      "  Prototype:\n"
      "    DEP(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_n_out(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("MX_n_out",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_n_out" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::MX const *)arg1)->n_out();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_n_out'."
      "  Prototype:\n"
      "    N_OUT(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_get_output(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  casadi_int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("MX_get_output",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_get_output" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::MX const *)arg1)->get_output(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_get_output'."
      "  Prototype:\n"
      "    GET_OUTPUT(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_n_dep(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("MX_n_dep",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_n_dep" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::MX const *)arg1)->n_dep();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_n_dep'."
      "  Prototype:\n"
      "    N_DEP(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_name(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("MX_name",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_name" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::MX const *)arg1)->name();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_name'."
      "  Prototype:\n"
      "    NAME(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_to_double(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  double result;
  
  if (!SWIG_check_num_args("MX_to_double",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_to_double" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (double)((casadi::MX const *)arg1)->operator double();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "double" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_to_double'."
      "  Prototype:\n"
      "    TO_DOUBLE(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_to_DM(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("MX_to_DM",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_to_DM" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::MX const *)arg1)->operator casadi::Matrix<double>();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_to_DM'."
      "  Prototype:\n"
      "    TO_DM(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_is_symbolic(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("MX_is_symbolic",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_is_symbolic" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::MX const *)arg1)->is_symbolic();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_is_symbolic'."
      "  Prototype:\n"
      "    IS_SYMBOLIC(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_is_constant(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("MX_is_constant",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_is_constant" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::MX const *)arg1)->is_constant();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_is_constant'."
      "  Prototype:\n"
      "    IS_CONSTANT(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_is_call(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("MX_is_call",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_is_call" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::MX const *)arg1)->is_call();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_is_call'."
      "  Prototype:\n"
      "    IS_CALL(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_which_function(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("MX_which_function",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_which_function" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::MX const *)arg1)->which_function();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_which_function'."
      "  Prototype:\n"
      "    WHICH_FUNCTION(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_is_output(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("MX_is_output",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_is_output" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::MX const *)arg1)->is_output();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_is_output'."
      "  Prototype:\n"
      "    IS_OUTPUT(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_which_output(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("MX_which_output",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_which_output" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::MX const *)arg1)->which_output();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_which_output'."
      "  Prototype:\n"
      "    WHICH_OUTPUT(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_is_op(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  casadi_int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("MX_is_op",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_is_op" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::MX const *)arg1)->is_op(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_is_op'."
      "  Prototype:\n"
      "    IS_OP(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_is_multiplication(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("MX_is_multiplication",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_is_multiplication" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::MX const *)arg1)->is_multiplication();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_is_multiplication'."
      "  Prototype:\n"
      "    IS_MULTIPLICATION(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_is_commutative(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("MX_is_commutative",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_is_commutative" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::MX const *)arg1)->is_commutative();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_is_commutative'."
      "  Prototype:\n"
      "    IS_COMMUTATIVE(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_is_norm(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("MX_is_norm",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_is_norm" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::MX const *)arg1)->is_norm();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_is_norm'."
      "  Prototype:\n"
      "    IS_NORM(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_is_valid_input(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("MX_is_valid_input",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_is_valid_input" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::MX const *)arg1)->is_valid_input();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_is_valid_input'."
      "  Prototype:\n"
      "    IS_VALID_INPUT(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_n_primitives(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("MX_n_primitives",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_n_primitives" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::MX const *)arg1)->n_primitives();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_n_primitives'."
      "  Prototype:\n"
      "    N_PRIMITIVES(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_primitives(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi::MX,std::allocator< casadi::MX > > result;
  
  if (!SWIG_check_num_args("MX_primitives",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_primitives" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::MX const *)arg1)->primitives();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "MX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_primitives'."
      "  Prototype:\n"
      "    PRIMITIVES(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_split_primitives(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  casadi::MX *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  mxArray * _out;
  std::vector< casadi::MX,std::allocator< casadi::MX > > result;
  
  if (!SWIG_check_num_args("MX_split_primitives",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_split_primitives" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::MX const *)arg1)->split_primitives((casadi::MX const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "MX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_split_primitives'."
      "  Prototype:\n"
      "    SPLIT_PRIMITIVES(self,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_join_primitives(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  std::vector< casadi::MX,std::allocator< casadi::MX > > *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< casadi::MX > m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("MX_join_primitives",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_join_primitives" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "MX" "}" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::MX const *)arg1)->join_primitives((std::vector< casadi::MX,std::allocator< casadi::MX > > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_join_primitives'."
      "  Prototype:\n"
      "    JOIN_PRIMITIVES(self,{MX})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_has_duplicates(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("MX_has_duplicates",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_has_duplicates" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::MX const *)arg1)->has_duplicates();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_has_duplicates'."
      "  Prototype:\n"
      "    HAS_DUPLICATES(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_reset_input(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("MX_reset_input",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_reset_input" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::MX const *)arg1)->reset_input();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_reset_input'."
      "  Prototype:\n"
      "    RESET_INPUT(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_is_eye(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("MX_is_eye",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_is_eye" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::MX const *)arg1)->is_eye();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_is_eye'."
      "  Prototype:\n"
      "    IS_EYE(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_is_zero(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("MX_is_zero",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_is_zero" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::MX const *)arg1)->is_zero();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_is_zero'."
      "  Prototype:\n"
      "    IS_ZERO(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_is_one(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("MX_is_one",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_is_one" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::MX const *)arg1)->is_one();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_is_one'."
      "  Prototype:\n"
      "    IS_ONE(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_is_minus_one(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("MX_is_minus_one",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_is_minus_one" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::MX const *)arg1)->is_minus_one();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_is_minus_one'."
      "  Prototype:\n"
      "    IS_MINUS_ONE(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_is_transpose(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("MX_is_transpose",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_is_transpose" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::MX const *)arg1)->is_transpose();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_is_transpose'."
      "  Prototype:\n"
      "    IS_TRANSPOSE(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_is_regular(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("MX_is_regular",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_is_regular" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::MX const *)arg1)->is_regular();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_is_regular'."
      "  Prototype:\n"
      "    IS_REGULAR(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_is_binary(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("MX_is_binary",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_is_binary" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::MX const *)arg1)->is_binary();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_is_binary'."
      "  Prototype:\n"
      "    IS_BINARY(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_is_unary(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("MX_is_unary",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_is_unary" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::MX const *)arg1)->is_unary();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_is_unary'."
      "  Prototype:\n"
      "    IS_UNARY(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_op(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("MX_op",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_op" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::MX const *)arg1)->op();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_op'."
      "  Prototype:\n"
      "    OP(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_info(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Dict result;
  
  if (!SWIG_check_num_args("MX_info",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_info" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::MX const *)arg1)->info();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "struct" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_info'."
      "  Prototype:\n"
      "    INFO(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_serialize(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  casadi::SerializingStream *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("MX_serialize",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_serialize" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  res2 = SWIG_ConvertPtr(argv[1], &argp2, SWIGTYPE_p_casadi__SerializingStream,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "MX_serialize" "', argument " "2"" of type '" "casadi::SerializingStream &""'"); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "MX_serialize" "', argument " "2"" of type '" "casadi::SerializingStream &""'"); 
  }
  arg2 = reinterpret_cast< casadi::SerializingStream * >(argp2);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::MX const *)arg1)->serialize(*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_serialize'."
      "  Prototype:\n"
      "    SERIALIZE(self,casadi::SerializingStream &)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_deserialize(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DeserializingStream *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("MX_deserialize",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_casadi__DeserializingStream,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_deserialize" "', argument " "1"" of type '" "casadi::DeserializingStream &""'"); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "MX_deserialize" "', argument " "1"" of type '" "casadi::DeserializingStream &""'"); 
  }
  arg1 = reinterpret_cast< casadi::DeserializingStream * >(argp1);
  {
    try {
      result = casadi::MX::deserialize(*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_deserialize'."
      "  Prototype:\n"
      "    DESERIALIZE(casadi::DeserializingStream &)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_get_temp(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("MX_get_temp",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_get_temp" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::MX const *)arg1)->get_temp();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_get_temp'."
      "  Prototype:\n"
      "    GET_TEMP(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_set_temp(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  casadi_int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("MX_set_temp",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_set_temp" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::MX const *)arg1)->set_temp(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_set_temp'."
      "  Prototype:\n"
      "    SET_TEMP(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_binary(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 ;
  casadi::MX *arg2 = 0 ;
  casadi::MX *arg3 = 0 ;
  casadi::MX m2 ;
  casadi::MX m3 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("MX_binary",argc,3,3,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "MX" "'.");
  {
    try {
      result = casadi::MX::binary(arg1,(casadi::MX const &)*arg2,(casadi::MX const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_binary'."
      "  Prototype:\n"
      "    BINARY(int,MX,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_unary(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 ;
  casadi::MX *arg2 = 0 ;
  casadi::MX m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("MX_unary",argc,2,2,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  {
    try {
      result = casadi::MX::unary(arg1,(casadi::MX const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_unary'."
      "  Prototype:\n"
      "    UNARY(int,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_inf__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = 0 ;
  casadi::Sparsity m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("MX_inf",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Sparsity" "'.");
  {
    try {
      result = casadi::MX::inf((casadi::Sparsity const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_inf'."
      "  Prototype:\n"
      "    INF(Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_inf__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 = (casadi_int) 1 ;
  casadi_int arg2 = (casadi_int) 1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("MX_inf",argc,2,0,0)) {
    SWIG_fail;
  }
  if (0<argc) {
    if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  }
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  }
  {
    try {
      result = casadi::MX::inf(arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_inf'."
      "  Prototype:\n"
      "    INF(int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_inf__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::pair< casadi_int,casadi_int > *arg1 = 0 ;
  std::pair< casadi_int,casadi_int > m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("MX_inf",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "[int,int]" "'.");
  {
    try {
      result = casadi::MX::inf((std::pair< long long,long long > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_inf'."
      "  Prototype:\n"
      "    INF([int,int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_inf(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 0) && (argc <= 2)) {
    int _v;
    if (argc <= 0) {
      return _wrap_MX_inf__SWIG_1(resc,resv,argc,argv);
    }
    _v = casadi::to_ptr(argv[0], static_cast< casadi_int **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_MX_inf__SWIG_1(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_MX_inf__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::pair<casadi_int,casadi_int> **>(0));
    if (_v) {
      return _wrap_MX_inf__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Sparsity **>(0));
    if (_v) {
      return _wrap_MX_inf__SWIG_0(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_inf'."
    "  Possible prototypes are:\n"
    "    INF(int,int)\n"
    "    INF([int,int])\n"
    "    INF(Sparsity)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_MX_nan__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Sparsity *arg1 = 0 ;
  casadi::Sparsity m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("MX_nan",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Sparsity" "'.");
  {
    try {
      result = casadi::MX::nan((casadi::Sparsity const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_nan'."
      "  Prototype:\n"
      "    NAN(Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_nan__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 = (casadi_int) 1 ;
  casadi_int arg2 = (casadi_int) 1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("MX_nan",argc,2,0,0)) {
    SWIG_fail;
  }
  if (0<argc) {
    if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  }
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  }
  {
    try {
      result = casadi::MX::nan(arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_nan'."
      "  Prototype:\n"
      "    NAN(int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_nan__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::pair< casadi_int,casadi_int > *arg1 = 0 ;
  std::pair< casadi_int,casadi_int > m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("MX_nan",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "[int,int]" "'.");
  {
    try {
      result = casadi::MX::nan((std::pair< long long,long long > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_nan'."
      "  Prototype:\n"
      "    NAN([int,int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_nan(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 0) && (argc <= 2)) {
    int _v;
    if (argc <= 0) {
      return _wrap_MX_nan__SWIG_1(resc,resv,argc,argv);
    }
    _v = casadi::to_ptr(argv[0], static_cast< casadi_int **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_MX_nan__SWIG_1(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_MX_nan__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::pair<casadi_int,casadi_int> **>(0));
    if (_v) {
      return _wrap_MX_nan__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Sparsity **>(0));
    if (_v) {
      return _wrap_MX_nan__SWIG_0(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_nan'."
    "  Possible prototypes are:\n"
    "    NAN(int,int)\n"
    "    NAN([int,int])\n"
    "    NAN(Sparsity)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_MX_eye(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("MX_eye",argc,1,1,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  {
    try {
      result = casadi::MX::eye(arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_eye'."
      "  Prototype:\n"
      "    EYE(int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_get__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  casadi::MX *arg2 = 0 ;
  bool arg3 ;
  casadi::Slice *arg4 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  casadi::Slice m4 ;
  mxArray * _out;
  
  arg2 = &m2;
  if (!SWIG_check_num_args("MX_get",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_get" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  if (!casadi::to_val(argv[1], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[2], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "Slice" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::MX const *)arg1)->get(*arg2,arg3,(casadi::Slice const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_get'."
      "  Prototype:\n"
      "    GET(self,bool,Slice)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_get__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  casadi::MX *arg2 = 0 ;
  bool arg3 ;
  casadi::Matrix< casadi_int > *arg4 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  casadi::Matrix< casadi_int > m4 ;
  mxArray * _out;
  
  arg2 = &m2;
  if (!SWIG_check_num_args("MX_get",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_get" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  if (!casadi::to_val(argv[1], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[2], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "IM" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::MX const *)arg1)->get(*arg2,arg3,(casadi::Matrix< casadi_int > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_get'."
      "  Prototype:\n"
      "    GET(self,bool,IM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_get__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  casadi::MX *arg2 = 0 ;
  bool arg3 ;
  casadi::Sparsity *arg4 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  casadi::Sparsity m4 ;
  mxArray * _out;
  
  arg2 = &m2;
  if (!SWIG_check_num_args("MX_get",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_get" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  if (!casadi::to_val(argv[1], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[2], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "Sparsity" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::MX const *)arg1)->get(*arg2,arg3,(casadi::Sparsity const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_get'."
      "  Prototype:\n"
      "    GET(self,bool,Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_get__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  casadi::MX *arg2 = 0 ;
  bool arg3 ;
  casadi::MX *arg4 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  casadi::MX m4 ;
  mxArray * _out;
  
  arg2 = &m2;
  if (!SWIG_check_num_args("MX_get",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_get" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  if (!casadi::to_val(argv[1], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[2], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "MX" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::MX const *)arg1)->get(*arg2,arg3,(casadi::MX const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_get'."
      "  Prototype:\n"
      "    GET(self,bool,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_get__SWIG_4(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  casadi::MX *arg2 = 0 ;
  bool arg3 ;
  casadi_int arg4 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  mxArray * _out;
  
  arg2 = &m2;
  if (!SWIG_check_num_args("MX_get",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_get" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  if (!casadi::to_val(argv[1], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  if (!casadi::to_val(argv[2], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::MX const *)arg1)->get(*arg2,arg3,arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_get'."
      "  Prototype:\n"
      "    GET(self,bool,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_get__SWIG_5(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  casadi::MX *arg2 = 0 ;
  bool arg3 ;
  casadi::Slice *arg4 = 0 ;
  casadi::Slice *arg5 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  casadi::Slice m4 ;
  casadi::Slice m5 ;
  mxArray * _out;
  
  arg2 = &m2;
  if (!SWIG_check_num_args("MX_get",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_get" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  if (!casadi::to_val(argv[1], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[2], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "Slice" "'.");
  arg5 = &m5;
  if (!casadi::to_ptr(argv[3], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "Slice" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::MX const *)arg1)->get(*arg2,arg3,(casadi::Slice const &)*arg4,(casadi::Slice const &)*arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_get'."
      "  Prototype:\n"
      "    GET(self,bool,Slice,Slice)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_get__SWIG_6(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  casadi::MX *arg2 = 0 ;
  bool arg3 ;
  casadi::Slice *arg4 = 0 ;
  casadi::Matrix< casadi_int > *arg5 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  casadi::Slice m4 ;
  casadi::Matrix< casadi_int > m5 ;
  mxArray * _out;
  
  arg2 = &m2;
  if (!SWIG_check_num_args("MX_get",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_get" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  if (!casadi::to_val(argv[1], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[2], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "Slice" "'.");
  arg5 = &m5;
  if (!casadi::to_ptr(argv[3], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "IM" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::MX const *)arg1)->get(*arg2,arg3,(casadi::Slice const &)*arg4,(casadi::Matrix< casadi_int > const &)*arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_get'."
      "  Prototype:\n"
      "    GET(self,bool,Slice,IM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_get__SWIG_7(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  casadi::MX *arg2 = 0 ;
  bool arg3 ;
  casadi::Slice *arg4 = 0 ;
  casadi_int arg5 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  casadi::Slice m4 ;
  mxArray * _out;
  
  arg2 = &m2;
  if (!SWIG_check_num_args("MX_get",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_get" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  if (!casadi::to_val(argv[1], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[2], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "Slice" "'.");
  if (!casadi::to_val(argv[3], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::MX const *)arg1)->get(*arg2,arg3,(casadi::Slice const &)*arg4,arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_get'."
      "  Prototype:\n"
      "    GET(self,bool,Slice,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_get__SWIG_8(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  casadi::MX *arg2 = 0 ;
  bool arg3 ;
  casadi::Matrix< casadi_int > *arg4 = 0 ;
  casadi::Slice *arg5 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  casadi::Matrix< casadi_int > m4 ;
  casadi::Slice m5 ;
  mxArray * _out;
  
  arg2 = &m2;
  if (!SWIG_check_num_args("MX_get",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_get" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  if (!casadi::to_val(argv[1], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[2], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "IM" "'.");
  arg5 = &m5;
  if (!casadi::to_ptr(argv[3], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "Slice" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::MX const *)arg1)->get(*arg2,arg3,(casadi::Matrix< casadi_int > const &)*arg4,(casadi::Slice const &)*arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_get'."
      "  Prototype:\n"
      "    GET(self,bool,IM,Slice)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_get__SWIG_9(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  casadi::MX *arg2 = 0 ;
  bool arg3 ;
  casadi_int arg4 ;
  casadi::Slice *arg5 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  casadi::Slice m5 ;
  mxArray * _out;
  
  arg2 = &m2;
  if (!SWIG_check_num_args("MX_get",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_get" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  if (!casadi::to_val(argv[1], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  if (!casadi::to_val(argv[2], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "int" "'.");
  arg5 = &m5;
  if (!casadi::to_ptr(argv[3], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "Slice" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::MX const *)arg1)->get(*arg2,arg3,arg4,(casadi::Slice const &)*arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_get'."
      "  Prototype:\n"
      "    GET(self,bool,int,Slice)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_get__SWIG_10(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  casadi::MX *arg2 = 0 ;
  bool arg3 ;
  casadi::Matrix< casadi_int > *arg4 = 0 ;
  casadi::Matrix< casadi_int > *arg5 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  casadi::Matrix< casadi_int > m4 ;
  casadi::Matrix< casadi_int > m5 ;
  mxArray * _out;
  
  arg2 = &m2;
  if (!SWIG_check_num_args("MX_get",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_get" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  if (!casadi::to_val(argv[1], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[2], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "IM" "'.");
  arg5 = &m5;
  if (!casadi::to_ptr(argv[3], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "IM" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::MX const *)arg1)->get(*arg2,arg3,(casadi::Matrix< casadi_int > const &)*arg4,(casadi::Matrix< casadi_int > const &)*arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_get'."
      "  Prototype:\n"
      "    GET(self,bool,IM,IM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_get__SWIG_11(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  casadi::MX *arg2 = 0 ;
  bool arg3 ;
  casadi_int arg4 ;
  casadi_int arg5 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  mxArray * _out;
  
  arg2 = &m2;
  if (!SWIG_check_num_args("MX_get",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_get" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  if (!casadi::to_val(argv[1], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  if (!casadi::to_val(argv[2], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "int" "'.");
  if (!casadi::to_val(argv[3], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::MX const *)arg1)->get(*arg2,arg3,arg4,arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_get'."
      "  Prototype:\n"
      "    GET(self,bool,int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_get__SWIG_12(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  casadi::MX *arg2 = 0 ;
  bool arg3 ;
  casadi::MX *arg4 = 0 ;
  casadi::Slice *arg5 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  casadi::MX m4 ;
  casadi::Slice m5 ;
  mxArray * _out;
  
  arg2 = &m2;
  if (!SWIG_check_num_args("MX_get",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_get" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  if (!casadi::to_val(argv[1], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[2], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "MX" "'.");
  arg5 = &m5;
  if (!casadi::to_ptr(argv[3], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "Slice" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::MX const *)arg1)->get(*arg2,arg3,(casadi::MX const &)*arg4,(casadi::Slice const &)*arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_get'."
      "  Prototype:\n"
      "    GET(self,bool,MX,Slice)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_get__SWIG_13(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  casadi::MX *arg2 = 0 ;
  bool arg3 ;
  casadi::Slice *arg4 = 0 ;
  casadi::MX *arg5 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  casadi::Slice m4 ;
  casadi::MX m5 ;
  mxArray * _out;
  
  arg2 = &m2;
  if (!SWIG_check_num_args("MX_get",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_get" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  if (!casadi::to_val(argv[1], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[2], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "Slice" "'.");
  arg5 = &m5;
  if (!casadi::to_ptr(argv[3], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "MX" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::MX const *)arg1)->get(*arg2,arg3,(casadi::Slice const &)*arg4,(casadi::MX const &)*arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_get'."
      "  Prototype:\n"
      "    GET(self,bool,Slice,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_get__SWIG_14(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  casadi::MX *arg2 = 0 ;
  bool arg3 ;
  casadi::MX *arg4 = 0 ;
  casadi::MX *arg5 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  casadi::MX m4 ;
  casadi::MX m5 ;
  mxArray * _out;
  
  arg2 = &m2;
  if (!SWIG_check_num_args("MX_get",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_get" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  if (!casadi::to_val(argv[1], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[2], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "MX" "'.");
  arg5 = &m5;
  if (!casadi::to_ptr(argv[3], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "MX" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::MX const *)arg1)->get(*arg2,arg3,(casadi::MX const &)*arg4,(casadi::MX const &)*arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_get'."
      "  Prototype:\n"
      "    GET(self,bool,MX,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_get(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MX, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< bool **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          return _wrap_MX_get__SWIG_4(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MX, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< bool **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Sparsity **>(0));
        if (_v) {
          return _wrap_MX_get__SWIG_2(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MX, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< bool **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Slice **>(0));
        if (_v) {
          return _wrap_MX_get__SWIG_0(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MX, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< bool **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<casadi_int> **>(0));
        if (_v) {
          return _wrap_MX_get__SWIG_1(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MX, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< bool **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::MX **>(0));
        if (_v) {
          return _wrap_MX_get__SWIG_3(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MX, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< bool **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi_int **>(0));
          if (_v) {
            return _wrap_MX_get__SWIG_11(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MX, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< bool **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::Slice **>(0));
          if (_v) {
            return _wrap_MX_get__SWIG_9(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MX, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< bool **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Slice **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi_int **>(0));
          if (_v) {
            return _wrap_MX_get__SWIG_7(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MX, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< bool **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Slice **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::Slice **>(0));
          if (_v) {
            return _wrap_MX_get__SWIG_5(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MX, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< bool **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Slice **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::Matrix<casadi_int> **>(0));
          if (_v) {
            return _wrap_MX_get__SWIG_6(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MX, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< bool **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Slice **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::MX **>(0));
          if (_v) {
            return _wrap_MX_get__SWIG_13(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MX, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< bool **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<casadi_int> **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::Slice **>(0));
          if (_v) {
            return _wrap_MX_get__SWIG_8(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MX, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< bool **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<casadi_int> **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::Matrix<casadi_int> **>(0));
          if (_v) {
            return _wrap_MX_get__SWIG_10(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MX, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< bool **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::MX **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::Slice **>(0));
          if (_v) {
            return _wrap_MX_get__SWIG_12(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MX, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< bool **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::MX **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::MX **>(0));
          if (_v) {
            return _wrap_MX_get__SWIG_14(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_get'."
    "  Possible prototypes are:\n"
    "    GET(self,bool,int)\n"
    "    GET(self,bool,Sparsity)\n"
    "    GET(self,bool,Slice)\n"
    "    GET(self,bool,IM)\n"
    "    GET(self,bool,MX)\n"
    "    GET(self,bool,int,int)\n"
    "    GET(self,bool,int,Slice)\n"
    "    GET(self,bool,Slice,int)\n"
    "    GET(self,bool,Slice,Slice)\n"
    "    GET(self,bool,Slice,IM)\n"
    "    GET(self,bool,Slice,MX)\n"
    "    GET(self,bool,IM,Slice)\n"
    "    GET(self,bool,IM,IM)\n"
    "    GET(self,bool,MX,Slice)\n"
    "    GET(self,bool,MX,MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_MX_set__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  casadi::MX *arg2 = 0 ;
  bool arg3 ;
  casadi::Slice *arg4 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  casadi::Slice m4 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("MX_set",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_set" "', argument " "1"" of type '" "casadi::MX *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "Slice" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->set((casadi::MX const &)*arg2,arg3,(casadi::Slice const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_set'."
      "  Prototype:\n"
      "    SET(self,MX,bool,Slice)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_set__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  casadi::MX *arg2 = 0 ;
  bool arg3 ;
  casadi::Matrix< casadi_int > *arg4 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  casadi::Matrix< casadi_int > m4 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("MX_set",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_set" "', argument " "1"" of type '" "casadi::MX *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "IM" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->set((casadi::MX const &)*arg2,arg3,(casadi::Matrix< casadi_int > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_set'."
      "  Prototype:\n"
      "    SET(self,MX,bool,IM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_set__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  casadi::MX *arg2 = 0 ;
  bool arg3 ;
  casadi::Sparsity *arg4 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  casadi::Sparsity m4 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("MX_set",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_set" "', argument " "1"" of type '" "casadi::MX *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "Sparsity" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->set((casadi::MX const &)*arg2,arg3,(casadi::Sparsity const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_set'."
      "  Prototype:\n"
      "    SET(self,MX,bool,Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_set__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  casadi::MX *arg2 = 0 ;
  bool arg3 ;
  casadi::Slice *arg4 = 0 ;
  casadi::Slice *arg5 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  casadi::Slice m4 ;
  casadi::Slice m5 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("MX_set",argc,5,5,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_set" "', argument " "1"" of type '" "casadi::MX *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "Slice" "'.");
  arg5 = &m5;
  if (!casadi::to_ptr(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "Slice" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->set((casadi::MX const &)*arg2,arg3,(casadi::Slice const &)*arg4,(casadi::Slice const &)*arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_set'."
      "  Prototype:\n"
      "    SET(self,MX,bool,Slice,Slice)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_set__SWIG_4(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  casadi::MX *arg2 = 0 ;
  bool arg3 ;
  casadi::Slice *arg4 = 0 ;
  casadi::Matrix< casadi_int > *arg5 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  casadi::Slice m4 ;
  casadi::Matrix< casadi_int > m5 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("MX_set",argc,5,5,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_set" "', argument " "1"" of type '" "casadi::MX *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "Slice" "'.");
  arg5 = &m5;
  if (!casadi::to_ptr(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "IM" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->set((casadi::MX const &)*arg2,arg3,(casadi::Slice const &)*arg4,(casadi::Matrix< casadi_int > const &)*arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_set'."
      "  Prototype:\n"
      "    SET(self,MX,bool,Slice,IM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_set__SWIG_5(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  casadi::MX *arg2 = 0 ;
  bool arg3 ;
  casadi::Matrix< casadi_int > *arg4 = 0 ;
  casadi::Slice *arg5 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  casadi::Matrix< casadi_int > m4 ;
  casadi::Slice m5 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("MX_set",argc,5,5,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_set" "', argument " "1"" of type '" "casadi::MX *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "IM" "'.");
  arg5 = &m5;
  if (!casadi::to_ptr(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "Slice" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->set((casadi::MX const &)*arg2,arg3,(casadi::Matrix< casadi_int > const &)*arg4,(casadi::Slice const &)*arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_set'."
      "  Prototype:\n"
      "    SET(self,MX,bool,IM,Slice)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_set__SWIG_6(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  casadi::MX *arg2 = 0 ;
  bool arg3 ;
  casadi::Matrix< casadi_int > *arg4 = 0 ;
  casadi::Matrix< casadi_int > *arg5 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  casadi::Matrix< casadi_int > m4 ;
  casadi::Matrix< casadi_int > m5 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("MX_set",argc,5,5,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_set" "', argument " "1"" of type '" "casadi::MX *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "IM" "'.");
  arg5 = &m5;
  if (!casadi::to_ptr(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "IM" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->set((casadi::MX const &)*arg2,arg3,(casadi::Matrix< casadi_int > const &)*arg4,(casadi::Matrix< casadi_int > const &)*arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_set'."
      "  Prototype:\n"
      "    SET(self,MX,bool,IM,IM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_set(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MX, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< bool **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::Sparsity **>(0));
          if (_v) {
            return _wrap_MX_set__SWIG_2(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MX, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< bool **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::Slice **>(0));
          if (_v) {
            return _wrap_MX_set__SWIG_0(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MX, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< bool **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::Matrix<casadi_int> **>(0));
          if (_v) {
            return _wrap_MX_set__SWIG_1(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if (argc == 5) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MX, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< bool **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::Slice **>(0));
          if (_v) {
            _v = casadi::to_ptr(argv[4], static_cast< casadi::Slice **>(0));
            if (_v) {
              return _wrap_MX_set__SWIG_3(resc,resv,argc,argv);
            }
          }
        }
      }
    }
  }
  if (argc == 5) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MX, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< bool **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::Slice **>(0));
          if (_v) {
            _v = casadi::to_ptr(argv[4], static_cast< casadi::Matrix<casadi_int> **>(0));
            if (_v) {
              return _wrap_MX_set__SWIG_4(resc,resv,argc,argv);
            }
          }
        }
      }
    }
  }
  if (argc == 5) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MX, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< bool **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::Matrix<casadi_int> **>(0));
          if (_v) {
            _v = casadi::to_ptr(argv[4], static_cast< casadi::Slice **>(0));
            if (_v) {
              return _wrap_MX_set__SWIG_5(resc,resv,argc,argv);
            }
          }
        }
      }
    }
  }
  if (argc == 5) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MX, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< bool **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::Matrix<casadi_int> **>(0));
          if (_v) {
            _v = casadi::to_ptr(argv[4], static_cast< casadi::Matrix<casadi_int> **>(0));
            if (_v) {
              return _wrap_MX_set__SWIG_6(resc,resv,argc,argv);
            }
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_set'."
    "  Possible prototypes are:\n"
    "    SET(self,MX,bool,Sparsity)\n"
    "    SET(self,MX,bool,Slice)\n"
    "    SET(self,MX,bool,IM)\n"
    "    SET(self,MX,bool,Slice,Slice)\n"
    "    SET(self,MX,bool,Slice,IM)\n"
    "    SET(self,MX,bool,IM,Slice)\n"
    "    SET(self,MX,bool,IM,IM)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_MX_get_nz__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  casadi::MX *arg2 = 0 ;
  bool arg3 ;
  casadi::Slice *arg4 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  casadi::Slice m4 ;
  mxArray * _out;
  
  arg2 = &m2;
  if (!SWIG_check_num_args("MX_get_nz",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_get_nz" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  if (!casadi::to_val(argv[1], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[2], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "Slice" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::MX const *)arg1)->get_nz(*arg2,arg3,(casadi::Slice const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_get_nz'."
      "  Prototype:\n"
      "    GET_NZ(self,bool,Slice)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_get_nz__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  casadi::MX *arg2 = 0 ;
  bool arg3 ;
  casadi::Matrix< casadi_int > *arg4 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  casadi::Matrix< casadi_int > m4 ;
  mxArray * _out;
  
  arg2 = &m2;
  if (!SWIG_check_num_args("MX_get_nz",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_get_nz" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  if (!casadi::to_val(argv[1], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[2], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "IM" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::MX const *)arg1)->get_nz(*arg2,arg3,(casadi::Matrix< casadi_int > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_get_nz'."
      "  Prototype:\n"
      "    GET_NZ(self,bool,IM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_get_nz__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  casadi::MX *arg2 = 0 ;
  bool arg3 ;
  casadi::MX *arg4 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  casadi::MX m4 ;
  mxArray * _out;
  
  arg2 = &m2;
  if (!SWIG_check_num_args("MX_get_nz",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_get_nz" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  if (!casadi::to_val(argv[1], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[2], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "MX" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::MX const *)arg1)->get_nz(*arg2,arg3,(casadi::MX const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_get_nz'."
      "  Prototype:\n"
      "    GET_NZ(self,bool,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_get_nz__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  casadi::MX *arg2 = 0 ;
  bool arg3 ;
  casadi_int arg4 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  mxArray * _out;
  
  arg2 = &m2;
  if (!SWIG_check_num_args("MX_get_nz",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_get_nz" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  if (!casadi::to_val(argv[1], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  if (!casadi::to_val(argv[2], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::MX const *)arg1)->get_nz(*arg2,arg3,arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_get_nz'."
      "  Prototype:\n"
      "    GET_NZ(self,bool,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_get_nz__SWIG_4(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  casadi::MX *arg2 = 0 ;
  bool arg3 ;
  casadi::MX *arg4 = 0 ;
  casadi::Slice *arg5 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  casadi::MX m4 ;
  casadi::Slice m5 ;
  mxArray * _out;
  
  arg2 = &m2;
  if (!SWIG_check_num_args("MX_get_nz",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_get_nz" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  if (!casadi::to_val(argv[1], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[2], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "MX" "'.");
  arg5 = &m5;
  if (!casadi::to_ptr(argv[3], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "Slice" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::MX const *)arg1)->get_nz(*arg2,arg3,(casadi::MX const &)*arg4,(casadi::Slice const &)*arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_get_nz'."
      "  Prototype:\n"
      "    GET_NZ(self,bool,MX,Slice)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_get_nz__SWIG_5(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  casadi::MX *arg2 = 0 ;
  bool arg3 ;
  casadi::Slice *arg4 = 0 ;
  casadi::MX *arg5 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  casadi::Slice m4 ;
  casadi::MX m5 ;
  mxArray * _out;
  
  arg2 = &m2;
  if (!SWIG_check_num_args("MX_get_nz",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_get_nz" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  if (!casadi::to_val(argv[1], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[2], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "Slice" "'.");
  arg5 = &m5;
  if (!casadi::to_ptr(argv[3], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "MX" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::MX const *)arg1)->get_nz(*arg2,arg3,(casadi::Slice const &)*arg4,(casadi::MX const &)*arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_get_nz'."
      "  Prototype:\n"
      "    GET_NZ(self,bool,Slice,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_get_nz__SWIG_6(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  casadi::MX *arg2 = 0 ;
  bool arg3 ;
  casadi::MX *arg4 = 0 ;
  casadi::MX *arg5 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  casadi::MX m4 ;
  casadi::MX m5 ;
  mxArray * _out;
  
  arg2 = &m2;
  if (!SWIG_check_num_args("MX_get_nz",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_get_nz" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  if (!casadi::to_val(argv[1], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[2], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "MX" "'.");
  arg5 = &m5;
  if (!casadi::to_ptr(argv[3], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "MX" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::MX const *)arg1)->get_nz(*arg2,arg3,(casadi::MX const &)*arg4,(casadi::MX const &)*arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_get_nz'."
      "  Prototype:\n"
      "    GET_NZ(self,bool,MX,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_get_nz(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MX, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< bool **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          return _wrap_MX_get_nz__SWIG_3(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MX, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< bool **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Slice **>(0));
        if (_v) {
          return _wrap_MX_get_nz__SWIG_0(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MX, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< bool **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<casadi_int> **>(0));
        if (_v) {
          return _wrap_MX_get_nz__SWIG_1(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MX, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< bool **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::MX **>(0));
        if (_v) {
          return _wrap_MX_get_nz__SWIG_2(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MX, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< bool **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Slice **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::MX **>(0));
          if (_v) {
            return _wrap_MX_get_nz__SWIG_5(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MX, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< bool **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::MX **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::Slice **>(0));
          if (_v) {
            return _wrap_MX_get_nz__SWIG_4(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MX, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< bool **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::MX **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::MX **>(0));
          if (_v) {
            return _wrap_MX_get_nz__SWIG_6(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_get_nz'."
    "  Possible prototypes are:\n"
    "    GET_NZ(self,bool,int)\n"
    "    GET_NZ(self,bool,Slice)\n"
    "    GET_NZ(self,bool,IM)\n"
    "    GET_NZ(self,bool,MX)\n"
    "    GET_NZ(self,bool,Slice,MX)\n"
    "    GET_NZ(self,bool,MX,Slice)\n"
    "    GET_NZ(self,bool,MX,MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_MX_set_nz__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  casadi::MX *arg2 = 0 ;
  bool arg3 ;
  casadi::Slice *arg4 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  casadi::Slice m4 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("MX_set_nz",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_set_nz" "', argument " "1"" of type '" "casadi::MX *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "Slice" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->set_nz((casadi::MX const &)*arg2,arg3,(casadi::Slice const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_set_nz'."
      "  Prototype:\n"
      "    SET_NZ(self,MX,bool,Slice)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_set_nz__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  casadi::MX *arg2 = 0 ;
  bool arg3 ;
  casadi::Matrix< casadi_int > *arg4 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  casadi::Matrix< casadi_int > m4 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("MX_set_nz",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_set_nz" "', argument " "1"" of type '" "casadi::MX *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "IM" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->set_nz((casadi::MX const &)*arg2,arg3,(casadi::Matrix< casadi_int > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_set_nz'."
      "  Prototype:\n"
      "    SET_NZ(self,MX,bool,IM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_set_nz__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  casadi::MX *arg2 = 0 ;
  bool arg3 ;
  casadi::MX *arg4 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  casadi::MX m4 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("MX_set_nz",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_set_nz" "', argument " "1"" of type '" "casadi::MX *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "MX" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->set_nz((casadi::MX const &)*arg2,arg3,(casadi::MX const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_set_nz'."
      "  Prototype:\n"
      "    SET_NZ(self,MX,bool,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_set_nz__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  casadi::MX *arg2 = 0 ;
  bool arg3 ;
  casadi_int arg4 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("MX_set_nz",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_set_nz" "', argument " "1"" of type '" "casadi::MX *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  if (!casadi::to_val(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->set_nz((casadi::MX const &)*arg2,arg3,arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_set_nz'."
      "  Prototype:\n"
      "    SET_NZ(self,MX,bool,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_set_nz(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MX, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< bool **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi_int **>(0));
          if (_v) {
            return _wrap_MX_set_nz__SWIG_3(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MX, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< bool **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::Slice **>(0));
          if (_v) {
            return _wrap_MX_set_nz__SWIG_0(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MX, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< bool **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::Matrix<casadi_int> **>(0));
          if (_v) {
            return _wrap_MX_set_nz__SWIG_1(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MX, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< bool **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::MX **>(0));
          if (_v) {
            return _wrap_MX_set_nz__SWIG_2(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_set_nz'."
    "  Possible prototypes are:\n"
    "    SET_NZ(self,MX,bool,int)\n"
    "    SET_NZ(self,MX,bool,Slice)\n"
    "    SET_NZ(self,MX,bool,IM)\n"
    "    SET_NZ(self,MX,bool,MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_MX_einstein__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::MX *arg3 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg4 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg5 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg6 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg7 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg8 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg9 = 0 ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  casadi::MX m3 ;
  std::vector< casadi_int > m4 ;
  std::vector< casadi_int > m5 ;
  std::vector< casadi_int > m6 ;
  std::vector< casadi_int > m7 ;
  std::vector< casadi_int > m8 ;
  std::vector< casadi_int > m9 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("MX_einstein",argc,9,9,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "MX" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "[" "int" "]" "'.");
  arg5 = &m5;
  if (!casadi::to_ptr(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "[" "int" "]" "'.");
  arg6 = &m6;
  if (!casadi::to_ptr(argv[5], &arg6)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 6 to type '" "[" "int" "]" "'.");
  arg7 = &m7;
  if (!casadi::to_ptr(argv[6], &arg7)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 7 to type '" "[" "int" "]" "'.");
  arg8 = &m8;
  if (!casadi::to_ptr(argv[7], &arg8)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 8 to type '" "[" "int" "]" "'.");
  arg9 = &m9;
  if (!casadi::to_ptr(argv[8], &arg9)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 9 to type '" "[" "int" "]" "'.");
  {
    try {
      result = casadi::MX::einstein((casadi::MX const &)*arg1,(casadi::MX const &)*arg2,(casadi::MX const &)*arg3,(std::vector< long long,std::allocator< long long > > const &)*arg4,(std::vector< long long,std::allocator< long long > > const &)*arg5,(std::vector< long long,std::allocator< long long > > const &)*arg6,(std::vector< long long,std::allocator< long long > > const &)*arg7,(std::vector< long long,std::allocator< long long > > const &)*arg8,(std::vector< long long,std::allocator< long long > > const &)*arg9);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_einstein'."
      "  Prototype:\n"
      "    EINSTEIN(MX,MX,MX,[int],[int],[int],[int],[int],[int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_einstein__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg3 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg4 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg5 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg6 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg7 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg8 = 0 ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  std::vector< casadi_int > m3 ;
  std::vector< casadi_int > m4 ;
  std::vector< casadi_int > m5 ;
  std::vector< casadi_int > m6 ;
  std::vector< casadi_int > m7 ;
  std::vector< casadi_int > m8 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("MX_einstein",argc,8,8,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "[" "int" "]" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "[" "int" "]" "'.");
  arg5 = &m5;
  if (!casadi::to_ptr(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "[" "int" "]" "'.");
  arg6 = &m6;
  if (!casadi::to_ptr(argv[5], &arg6)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 6 to type '" "[" "int" "]" "'.");
  arg7 = &m7;
  if (!casadi::to_ptr(argv[6], &arg7)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 7 to type '" "[" "int" "]" "'.");
  arg8 = &m8;
  if (!casadi::to_ptr(argv[7], &arg8)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 8 to type '" "[" "int" "]" "'.");
  {
    try {
      result = casadi::MX::einstein((casadi::MX const &)*arg1,(casadi::MX const &)*arg2,(std::vector< long long,std::allocator< long long > > const &)*arg3,(std::vector< long long,std::allocator< long long > > const &)*arg4,(std::vector< long long,std::allocator< long long > > const &)*arg5,(std::vector< long long,std::allocator< long long > > const &)*arg6,(std::vector< long long,std::allocator< long long > > const &)*arg7,(std::vector< long long,std::allocator< long long > > const &)*arg8);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_einstein'."
      "  Prototype:\n"
      "    EINSTEIN(MX,MX,[int],[int],[int],[int],[int],[int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_einstein(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 8) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::vector<casadi_int> **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< std::vector<casadi_int> **>(0));
          if (_v) {
            _v = casadi::to_ptr(argv[4], static_cast< std::vector<casadi_int> **>(0));
            if (_v) {
              _v = casadi::to_ptr(argv[5], static_cast< std::vector<casadi_int> **>(0));
              if (_v) {
                _v = casadi::to_ptr(argv[6], static_cast< std::vector<casadi_int> **>(0));
                if (_v) {
                  _v = casadi::to_ptr(argv[7], static_cast< std::vector<casadi_int> **>(0));
                  if (_v) {
                    return _wrap_MX_einstein__SWIG_1(resc,resv,argc,argv);
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  if (argc == 9) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::MX **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< std::vector<casadi_int> **>(0));
          if (_v) {
            _v = casadi::to_ptr(argv[4], static_cast< std::vector<casadi_int> **>(0));
            if (_v) {
              _v = casadi::to_ptr(argv[5], static_cast< std::vector<casadi_int> **>(0));
              if (_v) {
                _v = casadi::to_ptr(argv[6], static_cast< std::vector<casadi_int> **>(0));
                if (_v) {
                  _v = casadi::to_ptr(argv[7], static_cast< std::vector<casadi_int> **>(0));
                  if (_v) {
                    _v = casadi::to_ptr(argv[8], static_cast< std::vector<casadi_int> **>(0));
                    if (_v) {
                      return _wrap_MX_einstein__SWIG_0(resc,resv,argc,argv);
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_einstein'."
    "  Possible prototypes are:\n"
    "    EINSTEIN(MX,MX,[int],[int],[int],[int],[int],[int])\n"
    "    EINSTEIN(MX,MX,MX,[int],[int],[int],[int],[int],[int])\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_MX_bspline_dual(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< double,std::allocator< double > > *arg1 = 0 ;
  std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *arg2 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg3 = 0 ;
  casadi::Dict const &arg4_defvalue = casadi::Dict() ;
  casadi::Dict *arg4 = (casadi::Dict *) &arg4_defvalue ;
  std::vector< double > m1 ;
  std::vector< std::vector< double > > m2 ;
  std::vector< casadi_int > m3 ;
  std::map< std::string,casadi::GenericType > m4 ;
  mxArray * _out;
  casadi::DM result;
  
  if (!SWIG_check_num_args("MX_bspline_dual",argc,4,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "[" "double" "]" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "[" "double" "]" "}" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "[" "int" "]" "'.");
  if (3<argc) {
    arg4 = &m4;
    if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi::MX::bspline_dual((std::vector< double,std::allocator< double > > const &)*arg1,(std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > const &)*arg2,(std::vector< long long,std::allocator< long long > > const &)*arg3,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_bspline_dual'."
      "  Prototype:\n"
      "    BSPLINE_DUAL([double],{[double]},[int],struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_interpn_linear(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< casadi::MX,std::allocator< casadi::MX > > *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  std::vector< casadi::MX,std::allocator< casadi::MX > > *arg3 = 0 ;
  casadi::Dict const &arg4_defvalue = casadi::Dict() ;
  casadi::Dict *arg4 = (casadi::Dict *) &arg4_defvalue ;
  std::vector< casadi::MX > m1 ;
  casadi::MX m2 ;
  std::vector< casadi::MX > m3 ;
  std::map< std::string,casadi::GenericType > m4 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("MX_interpn_linear",argc,4,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "{" "MX" "}" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "{" "MX" "}" "'.");
  if (3<argc) {
    arg4 = &m4;
    if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi::MX::interpn_linear((std::vector< casadi::MX,std::allocator< casadi::MX > > const &)*arg1,(casadi::MX const &)*arg2,(std::vector< casadi::MX,std::allocator< casadi::MX > > const &)*arg3,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_interpn_linear'."
      "  Prototype:\n"
      "    INTERPN_LINEAR({MX},MX,{MX},struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_printme(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  casadi::MX *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("MX_printme",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_printme" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::MX const *)arg1)->printme((casadi::MX const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_printme'."
      "  Prototype:\n"
      "    PRINTME(self,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_attachAssert(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  casadi::MX *arg2 = 0 ;
  std::string const &arg3_defvalue = "" ;
  std::string *arg3 = (std::string *) &arg3_defvalue ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  std::string m3 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("MX_attachAssert",argc,3,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_attachAssert" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  if (2<argc) {
    arg3 = &m3;
    if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "char" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::MX const *)arg1)->attachAssert((casadi::MX const &)*arg2,(std::string const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_attachAssert'."
      "  Prototype:\n"
      "    ATTACHASSERT(self,MX,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_monitor(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("MX_monitor",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_monitor" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::MX const *)arg1)->monitor((std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_monitor'."
      "  Prototype:\n"
      "    MONITOR(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_T(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("MX_T",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_T" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::MX const *)arg1)->T();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_T'."
      "  Prototype:\n"
      "    T(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_mapping(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Matrix< casadi_int > result;
  
  if (!SWIG_check_num_args("MX_mapping",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_mapping" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::MX const *)arg1)->mapping();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "IM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_mapping'."
      "  Prototype:\n"
      "    MAPPING(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_set_max_depth(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 = (casadi_int) 1 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("MX_set_max_depth",argc,1,0,0)) {
    SWIG_fail;
  }
  if (0<argc) {
    if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  }
  {
    try {
      casadi::MX::set_max_depth(arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_set_max_depth'."
      "  Prototype:\n"
      "    SET_MAX_DEPTH(int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_get_max_depth(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("MX_get_max_depth",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      result = (casadi_int)casadi::MX::get_max_depth();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_get_max_depth'."
      "  Prototype:\n"
      "    GET_MAX_DEPTH()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_test_cast(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::SharedObjectInternal *arg1 = (casadi::SharedObjectInternal *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("MX_test_cast",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__SharedObjectInternal, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_test_cast" "', argument " "1"" of type '" "casadi::SharedObjectInternal const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::SharedObjectInternal * >(argp1);
  {
    try {
      result = (bool)casadi::MX::test_cast((casadi::SharedObjectInternal const *)arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_test_cast'."
      "  Prototype:\n"
      "    TEST_CAST(casadi::SharedObjectInternal const *)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_get_input(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = 0 ;
  casadi::Function m1 ;
  mxArray * _out;
  std::vector< casadi::MX,std::allocator< casadi::MX > > result;
  
  if (!SWIG_check_num_args("MX_get_input",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Function" "'.");
  {
    try {
      result = casadi::MX::get_input((casadi::Function const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "MX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_get_input'."
      "  Prototype:\n"
      "    GET_INPUT(Function)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_get_free(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = 0 ;
  casadi::Function m1 ;
  mxArray * _out;
  std::vector< casadi::MX,std::allocator< casadi::MX > > result;
  
  if (!SWIG_check_num_args("MX_get_free",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Function" "'.");
  {
    try {
      result = casadi::MX::get_free((casadi::Function const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "MX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_get_free'."
      "  Prototype:\n"
      "    GET_FREE(Function)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_eval_mx(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  std::vector< casadi::MX,std::allocator< casadi::MX > > *arg2 = 0 ;
  std::vector< casadi::MX,std::allocator< casadi::MX > > *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< casadi::MX > m2 ;
  std::vector< casadi::MX > m3 ;
  mxArray * _out;
  
  arg3 = &m3;
  if (!SWIG_check_num_args("MX_eval_mx",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_eval_mx" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "MX" "}" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::MX const *)arg1)->eval_mx((std::vector< casadi::MX,std::allocator< casadi::MX > > const &)*arg2,*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg3);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_eval_mx'."
      "  Prototype:\n"
      "    EVAL_MX(self,{MX})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_paren__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  char arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  char val2 ;
  int ecode2 = 0 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("MX_paren",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_paren" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  ecode2 = SWIG_AsVal_char(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MX_paren" "', argument " "2"" of type '" "char""'");
  } 
  arg2 = static_cast< char >(val2);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = casadi_MX_paren__SWIG_0((casadi::MX const *)arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_paren'."
      "  Prototype:\n"
      "    PAREN(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_paren__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  casadi::Matrix< casadi_int > *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< casadi_int > m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("MX_paren",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_paren" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "IM" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = casadi_MX_paren__SWIG_1((casadi::MX const *)arg1,(casadi::Matrix< long long > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_paren'."
      "  Prototype:\n"
      "    PAREN(self,IM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_paren__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  casadi::Sparsity *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Sparsity m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("MX_paren",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_paren" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "Sparsity" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = casadi_MX_paren__SWIG_2((casadi::MX const *)arg1,(casadi::Sparsity const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_paren'."
      "  Prototype:\n"
      "    PAREN(self,Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_paren__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  char arg2 ;
  char arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  char val2 ;
  int ecode2 = 0 ;
  char val3 ;
  int ecode3 = 0 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("MX_paren",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_paren" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  ecode2 = SWIG_AsVal_char(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MX_paren" "', argument " "2"" of type '" "char""'");
  } 
  arg2 = static_cast< char >(val2);
  ecode3 = SWIG_AsVal_char(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "MX_paren" "', argument " "3"" of type '" "char""'");
  } 
  arg3 = static_cast< char >(val3);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = casadi_MX_paren__SWIG_3((casadi::MX const *)arg1,arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_paren'."
      "  Prototype:\n"
      "    PAREN(self,char,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_paren__SWIG_4(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  char arg2 ;
  casadi::Matrix< casadi_int > *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  char val2 ;
  int ecode2 = 0 ;
  casadi::Matrix< casadi_int > m3 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("MX_paren",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_paren" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  ecode2 = SWIG_AsVal_char(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MX_paren" "', argument " "2"" of type '" "char""'");
  } 
  arg2 = static_cast< char >(val2);
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "IM" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = casadi_MX_paren__SWIG_4((casadi::MX const *)arg1,arg2,(casadi::Matrix< long long > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_paren'."
      "  Prototype:\n"
      "    PAREN(self,char,IM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_paren__SWIG_5(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  casadi::Matrix< casadi_int > *arg2 = 0 ;
  char arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< casadi_int > m2 ;
  char val3 ;
  int ecode3 = 0 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("MX_paren",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_paren" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "IM" "'.");
  ecode3 = SWIG_AsVal_char(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "MX_paren" "', argument " "3"" of type '" "char""'");
  } 
  arg3 = static_cast< char >(val3);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = casadi_MX_paren__SWIG_5((casadi::MX const *)arg1,(casadi::Matrix< long long > const &)*arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_paren'."
      "  Prototype:\n"
      "    PAREN(self,IM,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_paren__SWIG_6(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  casadi::Matrix< casadi_int > *arg2 = 0 ;
  casadi::Matrix< casadi_int > *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< casadi_int > m2 ;
  casadi::Matrix< casadi_int > m3 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("MX_paren",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_paren" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "IM" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "IM" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = casadi_MX_paren__SWIG_6((casadi::MX const *)arg1,(casadi::Matrix< long long > const &)*arg2,(casadi::Matrix< long long > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_paren'."
      "  Prototype:\n"
      "    PAREN(self,IM,IM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_paren_asgn__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  casadi::MX *arg2 = 0 ;
  char arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  char val3 ;
  int ecode3 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("MX_paren_asgn",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_paren_asgn" "', argument " "1"" of type '" "casadi::MX *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  ecode3 = SWIG_AsVal_char(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "MX_paren_asgn" "', argument " "3"" of type '" "char""'");
  } 
  arg3 = static_cast< char >(val3);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      casadi_MX_paren_asgn__SWIG_0(arg1,(casadi::MX const &)*arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_paren_asgn'."
      "  Prototype:\n"
      "    PAREN_ASGN(self,MX,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_paren_asgn__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::Matrix< casadi_int > *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  casadi::Matrix< casadi_int > m3 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("MX_paren_asgn",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_paren_asgn" "', argument " "1"" of type '" "casadi::MX *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "IM" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      casadi_MX_paren_asgn__SWIG_1(arg1,(casadi::MX const &)*arg2,(casadi::Matrix< long long > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_paren_asgn'."
      "  Prototype:\n"
      "    PAREN_ASGN(self,MX,IM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_paren_asgn__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::Sparsity *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  casadi::Sparsity m3 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("MX_paren_asgn",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_paren_asgn" "', argument " "1"" of type '" "casadi::MX *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "Sparsity" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      casadi_MX_paren_asgn__SWIG_2(arg1,(casadi::MX const &)*arg2,(casadi::Sparsity const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_paren_asgn'."
      "  Prototype:\n"
      "    PAREN_ASGN(self,MX,Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_paren_asgn__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  casadi::MX *arg2 = 0 ;
  char arg3 ;
  char arg4 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  char val3 ;
  int ecode3 = 0 ;
  char val4 ;
  int ecode4 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("MX_paren_asgn",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_paren_asgn" "', argument " "1"" of type '" "casadi::MX *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  ecode3 = SWIG_AsVal_char(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "MX_paren_asgn" "', argument " "3"" of type '" "char""'");
  } 
  arg3 = static_cast< char >(val3);
  ecode4 = SWIG_AsVal_char(argv[3], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "MX_paren_asgn" "', argument " "4"" of type '" "char""'");
  } 
  arg4 = static_cast< char >(val4);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      casadi_MX_paren_asgn__SWIG_3(arg1,(casadi::MX const &)*arg2,arg3,arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_paren_asgn'."
      "  Prototype:\n"
      "    PAREN_ASGN(self,MX,char,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_paren_asgn__SWIG_4(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  casadi::MX *arg2 = 0 ;
  char arg3 ;
  casadi::Matrix< casadi_int > *arg4 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  char val3 ;
  int ecode3 = 0 ;
  casadi::Matrix< casadi_int > m4 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("MX_paren_asgn",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_paren_asgn" "', argument " "1"" of type '" "casadi::MX *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  ecode3 = SWIG_AsVal_char(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "MX_paren_asgn" "', argument " "3"" of type '" "char""'");
  } 
  arg3 = static_cast< char >(val3);
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "IM" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      casadi_MX_paren_asgn__SWIG_4(arg1,(casadi::MX const &)*arg2,arg3,(casadi::Matrix< long long > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_paren_asgn'."
      "  Prototype:\n"
      "    PAREN_ASGN(self,MX,char,IM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_paren_asgn__SWIG_5(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::Matrix< casadi_int > *arg3 = 0 ;
  char arg4 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  casadi::Matrix< casadi_int > m3 ;
  char val4 ;
  int ecode4 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("MX_paren_asgn",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_paren_asgn" "', argument " "1"" of type '" "casadi::MX *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "IM" "'.");
  ecode4 = SWIG_AsVal_char(argv[3], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "MX_paren_asgn" "', argument " "4"" of type '" "char""'");
  } 
  arg4 = static_cast< char >(val4);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      casadi_MX_paren_asgn__SWIG_5(arg1,(casadi::MX const &)*arg2,(casadi::Matrix< long long > const &)*arg3,arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_paren_asgn'."
      "  Prototype:\n"
      "    PAREN_ASGN(self,MX,IM,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_paren_asgn__SWIG_6(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::Matrix< casadi_int > *arg3 = 0 ;
  casadi::Matrix< casadi_int > *arg4 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  casadi::Matrix< casadi_int > m3 ;
  casadi::Matrix< casadi_int > m4 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("MX_paren_asgn",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_paren_asgn" "', argument " "1"" of type '" "casadi::MX *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "IM" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "IM" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      casadi_MX_paren_asgn__SWIG_6(arg1,(casadi::MX const &)*arg2,(casadi::Matrix< long long > const &)*arg3,(casadi::Matrix< long long > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_paren_asgn'."
      "  Prototype:\n"
      "    PAREN_ASGN(self,MX,IM,IM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_paren_asgn(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MX, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Sparsity **>(0));
        if (_v) {
          return _wrap_MX_paren_asgn__SWIG_2(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MX, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<casadi_int> **>(0));
        if (_v) {
          return _wrap_MX_paren_asgn__SWIG_1(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MX, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        {
          int res = SWIG_AsVal_char(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_MX_paren_asgn__SWIG_0(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MX, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<casadi_int> **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::Matrix<casadi_int> **>(0));
          if (_v) {
            return _wrap_MX_paren_asgn__SWIG_6(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MX, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<casadi_int> **>(0));
        if (_v) {
          {
            int res = SWIG_AsVal_char(argv[3], NULL);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            return _wrap_MX_paren_asgn__SWIG_5(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MX, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        {
          int res = SWIG_AsVal_char(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::Matrix<casadi_int> **>(0));
          if (_v) {
            return _wrap_MX_paren_asgn__SWIG_4(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MX, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        {
          int res = SWIG_AsVal_char(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          {
            int res = SWIG_AsVal_char(argv[3], NULL);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            return _wrap_MX_paren_asgn__SWIG_3(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_paren_asgn'."
    "  Possible prototypes are:\n"
    "    PAREN_ASGN(self,MX,Sparsity)\n"
    "    PAREN_ASGN(self,MX,IM)\n"
    "    PAREN_ASGN(self,MX,char)\n"
    "    PAREN_ASGN(self,MX,IM,IM)\n"
    "    PAREN_ASGN(self,MX,IM,char)\n"
    "    PAREN_ASGN(self,MX,char,IM)\n"
    "    PAREN_ASGN(self,MX,char,char)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_MX_brace__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  char arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  char val2 ;
  int ecode2 = 0 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("MX_brace",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_brace" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  ecode2 = SWIG_AsVal_char(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MX_brace" "', argument " "2"" of type '" "char""'");
  } 
  arg2 = static_cast< char >(val2);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = casadi_MX_brace__SWIG_0((casadi::MX const *)arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_brace'."
      "  Prototype:\n"
      "    BRACE(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_brace__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  casadi::Matrix< casadi_int > *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< casadi_int > m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("MX_brace",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_brace" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "IM" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = casadi_MX_brace__SWIG_1((casadi::MX const *)arg1,(casadi::Matrix< long long > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_brace'."
      "  Prototype:\n"
      "    BRACE(self,IM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_setbrace__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  casadi::MX *arg2 = 0 ;
  char arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  char val3 ;
  int ecode3 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("MX_setbrace",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_setbrace" "', argument " "1"" of type '" "casadi::MX *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  ecode3 = SWIG_AsVal_char(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "MX_setbrace" "', argument " "3"" of type '" "char""'");
  } 
  arg3 = static_cast< char >(val3);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      casadi_MX_setbrace__SWIG_0(arg1,(casadi::MX const &)*arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_setbrace'."
      "  Prototype:\n"
      "    SETBRACE(self,MX,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_setbrace__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::Matrix< casadi_int > *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  casadi::Matrix< casadi_int > m3 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("MX_setbrace",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_setbrace" "', argument " "1"" of type '" "casadi::MX *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "IM" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      casadi_MX_setbrace__SWIG_1(arg1,(casadi::MX const &)*arg2,(casadi::Matrix< long long > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_setbrace'."
      "  Prototype:\n"
      "    SETBRACE(self,MX,IM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_setbrace(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MX, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<casadi_int> **>(0));
        if (_v) {
          return _wrap_MX_setbrace__SWIG_1(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MX, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        {
          int res = SWIG_AsVal_char(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_MX_setbrace__SWIG_0(resc,resv,argc,argv);
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_setbrace'."
    "  Possible prototypes are:\n"
    "    SETBRACE(self,MX,IM)\n"
    "    SETBRACE(self,MX,char)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_MX_end(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  casadi_int arg2 ;
  casadi_int arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("MX_end",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_end" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)casadi_MX_end((casadi::MX const *)arg1,arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_end'."
      "  Prototype:\n"
      "    END(self,int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_numel__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  casadi_int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("MX_numel",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_numel" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)casadi_MX_numel__SWIG_0((casadi::MX const *)arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_numel'."
      "  Prototype:\n"
      "    NUMEL(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_numel__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  char arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  char val2 ;
  int ecode2 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("MX_numel",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_numel" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  ecode2 = SWIG_AsVal_char(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MX_numel" "', argument " "2"" of type '" "char""'");
  } 
  arg2 = static_cast< char >(val2);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)casadi_MX_numel__SWIG_1((casadi::MX const *)arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_numel'."
      "  Prototype:\n"
      "    NUMEL(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_numel__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< casadi_int > m2 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("MX_numel",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_numel" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "[" "int" "]" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)casadi_MX_numel__SWIG_2((casadi::MX const *)arg1,(std::vector< long long,std::allocator< long long > > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_numel'."
      "  Prototype:\n"
      "    NUMEL(self,[int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_numel__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("MX_numel",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_numel" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)casadi_MX_numel__SWIG_3((casadi::MX const *)arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_numel'."
      "  Prototype:\n"
      "    NUMEL(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_numel(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MX, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_MX_numel__SWIG_3(resc,resv,argc,argv);
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MX, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_MX_numel__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MX, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<casadi_int> **>(0));
      if (_v) {
        return _wrap_MX_numel__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MX, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_char(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_MX_numel__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_numel'."
    "  Possible prototypes are:\n"
    "    NUMEL(self)\n"
    "    NUMEL(self,int)\n"
    "    NUMEL(self,[int])\n"
    "    NUMEL(self,char)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_MX_ctranspose(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("MX_ctranspose",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_ctranspose" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = casadi_MX_ctranspose((casadi::MX const *)arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_ctranspose'."
      "  Prototype:\n"
      "    CTRANSPOSE(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_find(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("MX_find",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  {
    try {
      result = casadi_MX_casadi_find((casadi::MX const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_find'."
      "  Prototype:\n"
      "    FIND(MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_low(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::Dict const &arg3_defvalue = casadi::Dict() ;
  casadi::Dict *arg3 = (casadi::Dict *) &arg3_defvalue ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  std::map< std::string,casadi::GenericType > m3 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("MX_low",argc,3,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  if (2<argc) {
    arg3 = &m3;
    if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi_MX_casadi_low((casadi::MX const &)*arg1,(casadi::MX const &)*arg2,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_low'."
      "  Prototype:\n"
      "    LOW(MX,MX,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_inv_node(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("MX_inv_node",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  {
    try {
      result = casadi_MX_casadi_inv_node((casadi::MX const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_inv_node'."
      "  Prototype:\n"
      "    INV_NODE(MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_brace__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  casadi::MX *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("MX_brace",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_brace" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = casadi_MX_brace__SWIG_2((casadi::MX const *)arg1,(casadi::MX const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_brace'."
      "  Prototype:\n"
      "    BRACE(self,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_brace(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MX, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi_int> **>(0));
      if (_v) {
        return _wrap_MX_brace__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MX, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        return _wrap_MX_brace__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MX, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_char(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_MX_brace__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_brace'."
    "  Possible prototypes are:\n"
    "    BRACE(self,IM)\n"
    "    BRACE(self,MX)\n"
    "    BRACE(self,char)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_MX_paren__SWIG_7(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  casadi::MX *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("MX_paren",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_paren" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = casadi_MX_paren__SWIG_7((casadi::MX const *)arg1,(casadi::MX const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_paren'."
      "  Prototype:\n"
      "    PAREN(self,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_paren__SWIG_8(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  char arg2 ;
  casadi::MX *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  char val2 ;
  int ecode2 = 0 ;
  casadi::MX m3 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("MX_paren",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_paren" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  ecode2 = SWIG_AsVal_char(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MX_paren" "', argument " "2"" of type '" "char""'");
  } 
  arg2 = static_cast< char >(val2);
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "MX" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = casadi_MX_paren__SWIG_8((casadi::MX const *)arg1,arg2,(casadi::MX const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_paren'."
      "  Prototype:\n"
      "    PAREN(self,char,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_paren__SWIG_9(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  casadi::MX *arg2 = 0 ;
  char arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  char val3 ;
  int ecode3 = 0 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("MX_paren",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_paren" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  ecode3 = SWIG_AsVal_char(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "MX_paren" "', argument " "3"" of type '" "char""'");
  } 
  arg3 = static_cast< char >(val3);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = casadi_MX_paren__SWIG_9((casadi::MX const *)arg1,(casadi::MX const &)*arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_paren'."
      "  Prototype:\n"
      "    PAREN(self,MX,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_paren__SWIG_10(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = (casadi::MX *) 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::MX *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  casadi::MX m3 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("MX_paren",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MX, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MX_paren" "', argument " "1"" of type '" "casadi::MX const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MX * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "MX" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = casadi_MX_paren__SWIG_10((casadi::MX const *)arg1,(casadi::MX const &)*arg2,(casadi::MX const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_paren'."
      "  Prototype:\n"
      "    PAREN(self,MX,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MX_paren(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MX, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Sparsity **>(0));
      if (_v) {
        return _wrap_MX_paren__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MX, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi_int> **>(0));
      if (_v) {
        return _wrap_MX_paren__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MX, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        return _wrap_MX_paren__SWIG_7(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MX, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_char(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_MX_paren__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MX, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi_int> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<casadi_int> **>(0));
        if (_v) {
          return _wrap_MX_paren__SWIG_6(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MX, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi_int> **>(0));
      if (_v) {
        {
          int res = SWIG_AsVal_char(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_MX_paren__SWIG_5(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MX, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::MX **>(0));
        if (_v) {
          return _wrap_MX_paren__SWIG_10(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MX, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        {
          int res = SWIG_AsVal_char(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_MX_paren__SWIG_9(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MX, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_char(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<casadi_int> **>(0));
        if (_v) {
          return _wrap_MX_paren__SWIG_4(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MX, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_char(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::MX **>(0));
        if (_v) {
          return _wrap_MX_paren__SWIG_8(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MX, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      {
        int res = SWIG_AsVal_char(argv[1], NULL);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        {
          int res = SWIG_AsVal_char(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_MX_paren__SWIG_3(resc,resv,argc,argv);
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MX_paren'."
    "  Possible prototypes are:\n"
    "    PAREN(self,Sparsity)\n"
    "    PAREN(self,IM)\n"
    "    PAREN(self,MX)\n"
    "    PAREN(self,char)\n"
    "    PAREN(self,IM,IM)\n"
    "    PAREN(self,IM,char)\n"
    "    PAREN(self,MX,MX)\n"
    "    PAREN(self,MX,char)\n"
    "    PAREN(self,char,IM)\n"
    "    PAREN(self,char,MX)\n"
    "    PAREN(self,char,char)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_new_MX__SWIG_7(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::MX *result = 0 ;
  
  if (!SWIG_check_num_args("new_MX",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  {
    result = (casadi::MX *)new casadi::MX((casadi::MX const &)*arg1);
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__MX, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_MX'."
      "  Prototype:\n"
      "    MX(MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_MX(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 0) {
    return _wrap_new_MX__SWIG_0(resc,resv,argc,argv);
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Sparsity **>(0));
    if (_v) {
      return _wrap_new_MX__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< double **>(0));
    if (_v) {
      return _wrap_new_MX__SWIG_5(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      return _wrap_new_MX__SWIG_6(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      return _wrap_new_MX__SWIG_7(resc,resv,argc,argv);
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi_int **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_new_MX__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Sparsity **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        return _wrap_new_MX__SWIG_3(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Sparsity **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        return _wrap_new_MX__SWIG_4(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_MX'."
    "  Possible prototypes are:\n"
    "    MX()\n"
    "    MX(Sparsity)\n"
    "    MX(double)\n"
    "    MX(DM)\n"
    "    MX(MX)\n"
    "    MX(int,int)\n"
    "    MX(Sparsity,MX)\n"
    "    MX(Sparsity,char)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_Function_type_name(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("Function_type_name",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      result = casadi::Function::type_name();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_type_name'."
      "  Prototype:\n"
      "    TYPE_NAME()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_Function__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  casadi::Function *result = 0 ;
  
  if (!SWIG_check_num_args("new_Function",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      result = (casadi::Function *)new casadi::Function();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__Function, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_Function'."
      "  Prototype:\n"
      "    FUNCTION()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_Function__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string m1 ;
  mxArray * _out;
  casadi::Function *result = 0 ;
  
  if (!SWIG_check_num_args("new_Function",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  {
    try {
      result = (casadi::Function *)new casadi::Function((std::string const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__Function, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_Function'."
      "  Prototype:\n"
      "    FUNCTION(char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_Function__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::vector< casadi::SX,std::allocator< casadi::SX > > *arg2 = 0 ;
  std::vector< casadi::SX,std::allocator< casadi::SX > > *arg3 = 0 ;
  casadi::Dict const &arg4_defvalue = casadi::Dict() ;
  casadi::Dict *arg4 = (casadi::Dict *) &arg4_defvalue ;
  std::string m1 ;
  std::vector< casadi::Matrix< casadi::SXElem > > m2 ;
  std::vector< casadi::Matrix< casadi::SXElem > > m3 ;
  std::map< std::string,casadi::GenericType > m4 ;
  mxArray * _out;
  casadi::Function *result = 0 ;
  
  if (!SWIG_check_num_args("new_Function",argc,4,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "SX" "}" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "{" "SX" "}" "'.");
  if (3<argc) {
    arg4 = &m4;
    if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "struct" "'.");
  }
  {
    try {
      result = (casadi::Function *)new casadi::Function((std::string const &)*arg1,(std::vector< casadi::SX,std::allocator< casadi::SX > > const &)*arg2,(std::vector< casadi::SX,std::allocator< casadi::SX > > const &)*arg3,(casadi::Dict const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__Function, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_Function'."
      "  Prototype:\n"
      "    FUNCTION(char,{SX},{SX},struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_Function__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::vector< casadi::SX,std::allocator< casadi::SX > > *arg2 = 0 ;
  std::vector< casadi::SX,std::allocator< casadi::SX > > *arg3 = 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg4 = 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg5 = 0 ;
  casadi::Dict const &arg6_defvalue = casadi::Dict() ;
  casadi::Dict *arg6 = (casadi::Dict *) &arg6_defvalue ;
  std::string m1 ;
  std::vector< casadi::Matrix< casadi::SXElem > > m2 ;
  std::vector< casadi::Matrix< casadi::SXElem > > m3 ;
  std::vector< std::string > m4 ;
  std::vector< std::string > m5 ;
  std::map< std::string,casadi::GenericType > m6 ;
  mxArray * _out;
  casadi::Function *result = 0 ;
  
  if (!SWIG_check_num_args("new_Function",argc,6,5,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "SX" "}" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "{" "SX" "}" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "{" "char" "}" "'.");
  arg5 = &m5;
  if (!casadi::to_ptr(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "{" "char" "}" "'.");
  if (5<argc) {
    arg6 = &m6;
    if (!casadi::to_ptr(argv[5], &arg6)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 6 to type '" "struct" "'.");
  }
  {
    try {
      result = (casadi::Function *)new casadi::Function((std::string const &)*arg1,(std::vector< casadi::SX,std::allocator< casadi::SX > > const &)*arg2,(std::vector< casadi::SX,std::allocator< casadi::SX > > const &)*arg3,(std::vector< std::string,std::allocator< std::string > > const &)*arg4,(std::vector< std::string,std::allocator< std::string > > const &)*arg5,(casadi::Dict const &)*arg6);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__Function, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_Function'."
      "  Prototype:\n"
      "    FUNCTION(char,{SX},{SX},{char},{char},struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_Function__SWIG_4(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::map< std::string,casadi::SX,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::SX > > > *arg2 = 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg3 = 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg4 = 0 ;
  casadi::Dict const &arg5_defvalue = casadi::Dict() ;
  casadi::Dict *arg5 = (casadi::Dict *) &arg5_defvalue ;
  std::string m1 ;
  std::map< std::string,casadi::Matrix< casadi::SXElem > > m2 ;
  std::vector< std::string > m3 ;
  std::vector< std::string > m4 ;
  std::map< std::string,casadi::GenericType > m5 ;
  mxArray * _out;
  casadi::Function *result = 0 ;
  
  if (!SWIG_check_num_args("new_Function",argc,5,4,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "struct" ":" "SX" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "{" "char" "}" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "{" "char" "}" "'.");
  if (4<argc) {
    arg5 = &m5;
    if (!casadi::to_ptr(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "struct" "'.");
  }
  {
    try {
      result = (casadi::Function *)new casadi::Function((std::string const &)*arg1,(std::map< std::string,casadi::SX,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::SX > > > const &)*arg2,(std::vector< std::string,std::allocator< std::string > > const &)*arg3,(std::vector< std::string,std::allocator< std::string > > const &)*arg4,(casadi::Dict const &)*arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__Function, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_Function'."
      "  Prototype:\n"
      "    FUNCTION(char,struct:SX,{char},{char},struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_Function__SWIG_5(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::vector< casadi::MX,std::allocator< casadi::MX > > *arg2 = 0 ;
  std::vector< casadi::MX,std::allocator< casadi::MX > > *arg3 = 0 ;
  casadi::Dict const &arg4_defvalue = casadi::Dict() ;
  casadi::Dict *arg4 = (casadi::Dict *) &arg4_defvalue ;
  std::string m1 ;
  std::vector< casadi::MX > m2 ;
  std::vector< casadi::MX > m3 ;
  std::map< std::string,casadi::GenericType > m4 ;
  mxArray * _out;
  casadi::Function *result = 0 ;
  
  if (!SWIG_check_num_args("new_Function",argc,4,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "MX" "}" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "{" "MX" "}" "'.");
  if (3<argc) {
    arg4 = &m4;
    if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "struct" "'.");
  }
  {
    try {
      result = (casadi::Function *)new casadi::Function((std::string const &)*arg1,(std::vector< casadi::MX,std::allocator< casadi::MX > > const &)*arg2,(std::vector< casadi::MX,std::allocator< casadi::MX > > const &)*arg3,(casadi::Dict const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__Function, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_Function'."
      "  Prototype:\n"
      "    FUNCTION(char,{MX},{MX},struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_Function__SWIG_6(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::vector< casadi::MX,std::allocator< casadi::MX > > *arg2 = 0 ;
  std::vector< casadi::MX,std::allocator< casadi::MX > > *arg3 = 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg4 = 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg5 = 0 ;
  casadi::Dict const &arg6_defvalue = casadi::Dict() ;
  casadi::Dict *arg6 = (casadi::Dict *) &arg6_defvalue ;
  std::string m1 ;
  std::vector< casadi::MX > m2 ;
  std::vector< casadi::MX > m3 ;
  std::vector< std::string > m4 ;
  std::vector< std::string > m5 ;
  std::map< std::string,casadi::GenericType > m6 ;
  mxArray * _out;
  casadi::Function *result = 0 ;
  
  if (!SWIG_check_num_args("new_Function",argc,6,5,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "MX" "}" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "{" "MX" "}" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "{" "char" "}" "'.");
  arg5 = &m5;
  if (!casadi::to_ptr(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "{" "char" "}" "'.");
  if (5<argc) {
    arg6 = &m6;
    if (!casadi::to_ptr(argv[5], &arg6)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 6 to type '" "struct" "'.");
  }
  {
    try {
      result = (casadi::Function *)new casadi::Function((std::string const &)*arg1,(std::vector< casadi::MX,std::allocator< casadi::MX > > const &)*arg2,(std::vector< casadi::MX,std::allocator< casadi::MX > > const &)*arg3,(std::vector< std::string,std::allocator< std::string > > const &)*arg4,(std::vector< std::string,std::allocator< std::string > > const &)*arg5,(casadi::Dict const &)*arg6);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__Function, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_Function'."
      "  Prototype:\n"
      "    FUNCTION(char,{MX},{MX},{char},{char},struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_Function__SWIG_7(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::map< std::string,casadi::MX,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::MX > > > *arg2 = 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg3 = 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg4 = 0 ;
  casadi::Dict const &arg5_defvalue = casadi::Dict() ;
  casadi::Dict *arg5 = (casadi::Dict *) &arg5_defvalue ;
  std::string m1 ;
  std::map< std::string,casadi::MX > m2 ;
  std::vector< std::string > m3 ;
  std::vector< std::string > m4 ;
  std::map< std::string,casadi::GenericType > m5 ;
  mxArray * _out;
  casadi::Function *result = 0 ;
  
  if (!SWIG_check_num_args("new_Function",argc,5,4,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "struct" ":" "MX" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "{" "char" "}" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "{" "char" "}" "'.");
  if (4<argc) {
    arg5 = &m5;
    if (!casadi::to_ptr(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "struct" "'.");
  }
  {
    try {
      result = (casadi::Function *)new casadi::Function((std::string const &)*arg1,(std::map< std::string,casadi::MX,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::MX > > > const &)*arg2,(std::vector< std::string,std::allocator< std::string > > const &)*arg3,(std::vector< std::string,std::allocator< std::string > > const &)*arg4,(casadi::Dict const &)*arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__Function, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_Function'."
      "  Prototype:\n"
      "    FUNCTION(char,struct:MX,{char},{char},struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_jit__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg3 = 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg4 = 0 ;
  casadi::Dict const &arg5_defvalue = casadi::Dict() ;
  casadi::Dict *arg5 = (casadi::Dict *) &arg5_defvalue ;
  std::string m1 ;
  std::string m2 ;
  std::vector< std::string > m3 ;
  std::vector< std::string > m4 ;
  std::map< std::string,casadi::GenericType > m5 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("Function_jit",argc,5,4,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "{" "char" "}" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "{" "char" "}" "'.");
  if (4<argc) {
    arg5 = &m5;
    if (!casadi::to_ptr(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi::Function::jit((std::string const &)*arg1,(std::string const &)*arg2,(std::vector< std::string,std::allocator< std::string > > const &)*arg3,(std::vector< std::string,std::allocator< std::string > > const &)*arg4,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_jit'."
      "  Prototype:\n"
      "    JIT(char,char,{char},{char},struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_jit__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg3 = 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg4 = 0 ;
  std::vector< casadi::Sparsity,std::allocator< casadi::Sparsity > > *arg5 = 0 ;
  std::vector< casadi::Sparsity,std::allocator< casadi::Sparsity > > *arg6 = 0 ;
  casadi::Dict const &arg7_defvalue = casadi::Dict() ;
  casadi::Dict *arg7 = (casadi::Dict *) &arg7_defvalue ;
  std::string m1 ;
  std::string m2 ;
  std::vector< std::string > m3 ;
  std::vector< std::string > m4 ;
  std::vector< casadi::Sparsity > m5 ;
  std::vector< casadi::Sparsity > m6 ;
  std::map< std::string,casadi::GenericType > m7 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("Function_jit",argc,7,6,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "{" "char" "}" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "{" "char" "}" "'.");
  arg5 = &m5;
  if (!casadi::to_ptr(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "{" "Sparsity" "}" "'.");
  arg6 = &m6;
  if (!casadi::to_ptr(argv[5], &arg6)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 6 to type '" "{" "Sparsity" "}" "'.");
  if (6<argc) {
    arg7 = &m7;
    if (!casadi::to_ptr(argv[6], &arg7)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 7 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi::Function::jit((std::string const &)*arg1,(std::string const &)*arg2,(std::vector< std::string,std::allocator< std::string > > const &)*arg3,(std::vector< std::string,std::allocator< std::string > > const &)*arg4,(std::vector< casadi::Sparsity,std::allocator< casadi::Sparsity > > const &)*arg5,(std::vector< casadi::Sparsity,std::allocator< casadi::Sparsity > > const &)*arg6,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg7);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_jit'."
      "  Prototype:\n"
      "    JIT(char,char,{char},{char},{Sparsity},{Sparsity},struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_jit(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 4) && (argc <= 5)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::string **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::vector<std::string> **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< std::vector<std::string> **>(0));
          if (_v) {
            if (argc <= 4) {
              return _wrap_Function_jit__SWIG_0(resc,resv,argc,argv);
            }
            _v = casadi::to_ptr(argv[4], static_cast< std::map<std::string,casadi::GenericType> **>(0));
            if (_v) {
              return _wrap_Function_jit__SWIG_0(resc,resv,argc,argv);
            }
          }
        }
      }
    }
  }
  if ((argc >= 6) && (argc <= 7)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::string **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::vector<std::string> **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< std::vector<std::string> **>(0));
          if (_v) {
            _v = casadi::to_ptr(argv[4], static_cast< std::vector< casadi::Sparsity> **>(0));
            if (_v) {
              _v = casadi::to_ptr(argv[5], static_cast< std::vector< casadi::Sparsity> **>(0));
              if (_v) {
                if (argc <= 6) {
                  return _wrap_Function_jit__SWIG_1(resc,resv,argc,argv);
                }
                _v = casadi::to_ptr(argv[6], static_cast< std::map<std::string,casadi::GenericType> **>(0));
                if (_v) {
                  return _wrap_Function_jit__SWIG_1(resc,resv,argc,argv);
                }
              }
            }
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_jit'."
    "  Possible prototypes are:\n"
    "    JIT(char,char,{char},{char},struct)\n"
    "    JIT(char,char,{char},{char},{Sparsity},{Sparsity},struct)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_delete_Function(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  int is_owned;
  if (!SWIG_check_num_args("delete_Function",argc,1,1,0)) {
    SWIG_fail;
  }
  is_owned = SWIG_Matlab_isOwned(argv[0]);
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Function" "', argument " "1"" of type '" "casadi::Function *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  if (is_owned) {
    {
      try {
        delete arg1;
      } catch(const std::exception& e) {
        SWIG_exception(SWIG_RuntimeError, e.what());
      }
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'delete_Function'."
      "  Prototype:\n"
      "    FUNCTION(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_expand__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("Function_expand",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_expand" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->expand();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_expand'."
      "  Prototype:\n"
      "    EXPAND(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_expand__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  std::string *arg2 = 0 ;
  casadi::Dict const &arg3_defvalue = casadi::Dict() ;
  casadi::Dict *arg3 = (casadi::Dict *) &arg3_defvalue ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  std::map< std::string,casadi::GenericType > m3 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("Function_expand",argc,3,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_expand" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  if (2<argc) {
    arg3 = &m3;
    if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "struct" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->expand((std::string const &)*arg2,(casadi::Dict const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_expand'."
      "  Prototype:\n"
      "    EXPAND(self,char,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_expand(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_Function_expand__SWIG_0(resc,resv,argc,argv);
    }
  }
  if ((argc >= 2) && (argc <= 3)) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_Function_expand__SWIG_1(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< std::map<std::string,casadi::GenericType> **>(0));
        if (_v) {
          return _wrap_Function_expand__SWIG_1(resc,resv,argc,argv);
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_expand'."
    "  Possible prototypes are:\n"
    "    EXPAND(self)\n"
    "    EXPAND(self,char,struct)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_Function_n_in(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("Function_n_in",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_n_in" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::Function const *)arg1)->n_in();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_n_in'."
      "  Prototype:\n"
      "    N_IN(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_n_out(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("Function_n_out",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_n_out" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::Function const *)arg1)->n_out();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_n_out'."
      "  Prototype:\n"
      "    N_OUT(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_size1_in__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  casadi_int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("Function_size1_in",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_size1_in" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::Function const *)arg1)->size1_in(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_size1_in'."
      "  Prototype:\n"
      "    SIZE1_IN(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_size1_in__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("Function_size1_in",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_size1_in" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::Function const *)arg1)->size1_in((std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_size1_in'."
      "  Prototype:\n"
      "    SIZE1_IN(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_size1_in(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_Function_size1_in__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        return _wrap_Function_size1_in__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_size1_in'."
    "  Possible prototypes are:\n"
    "    SIZE1_IN(self,int)\n"
    "    SIZE1_IN(self,char)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_Function_size2_in__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  casadi_int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("Function_size2_in",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_size2_in" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::Function const *)arg1)->size2_in(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_size2_in'."
      "  Prototype:\n"
      "    SIZE2_IN(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_size2_in__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("Function_size2_in",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_size2_in" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::Function const *)arg1)->size2_in((std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_size2_in'."
      "  Prototype:\n"
      "    SIZE2_IN(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_size2_in(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_Function_size2_in__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        return _wrap_Function_size2_in__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_size2_in'."
    "  Possible prototypes are:\n"
    "    SIZE2_IN(self,int)\n"
    "    SIZE2_IN(self,char)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_Function_size_in__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  casadi_int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::pair< casadi_int,casadi_int > result;
  
  if (!SWIG_check_num_args("Function_size_in",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_size_in" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->size_in(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[int,int]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_size_in'."
      "  Prototype:\n"
      "    SIZE_IN(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_size_in__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  std::pair< casadi_int,casadi_int > result;
  
  if (!SWIG_check_num_args("Function_size_in",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_size_in" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->size_in((std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[int,int]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_size_in'."
      "  Prototype:\n"
      "    SIZE_IN(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_size_in(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_Function_size_in__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        return _wrap_Function_size_in__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_size_in'."
    "  Possible prototypes are:\n"
    "    SIZE_IN(self,int)\n"
    "    SIZE_IN(self,char)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_Function_size1_out__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  casadi_int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("Function_size1_out",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_size1_out" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::Function const *)arg1)->size1_out(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_size1_out'."
      "  Prototype:\n"
      "    SIZE1_OUT(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_size1_out__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("Function_size1_out",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_size1_out" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::Function const *)arg1)->size1_out((std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_size1_out'."
      "  Prototype:\n"
      "    SIZE1_OUT(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_size1_out(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_Function_size1_out__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        return _wrap_Function_size1_out__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_size1_out'."
    "  Possible prototypes are:\n"
    "    SIZE1_OUT(self,int)\n"
    "    SIZE1_OUT(self,char)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_Function_size2_out__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  casadi_int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("Function_size2_out",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_size2_out" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::Function const *)arg1)->size2_out(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_size2_out'."
      "  Prototype:\n"
      "    SIZE2_OUT(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_size2_out__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("Function_size2_out",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_size2_out" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::Function const *)arg1)->size2_out((std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_size2_out'."
      "  Prototype:\n"
      "    SIZE2_OUT(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_size2_out(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_Function_size2_out__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        return _wrap_Function_size2_out__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_size2_out'."
    "  Possible prototypes are:\n"
    "    SIZE2_OUT(self,int)\n"
    "    SIZE2_OUT(self,char)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_Function_size_out__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  casadi_int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::pair< casadi_int,casadi_int > result;
  
  if (!SWIG_check_num_args("Function_size_out",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_size_out" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->size_out(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[int,int]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_size_out'."
      "  Prototype:\n"
      "    SIZE_OUT(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_size_out__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  std::pair< casadi_int,casadi_int > result;
  
  if (!SWIG_check_num_args("Function_size_out",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_size_out" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->size_out((std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[int,int]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_size_out'."
      "  Prototype:\n"
      "    SIZE_OUT(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_size_out(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_Function_size_out__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        return _wrap_Function_size_out__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_size_out'."
    "  Possible prototypes are:\n"
    "    SIZE_OUT(self,int)\n"
    "    SIZE_OUT(self,char)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_Function_nnz_in__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("Function_nnz_in",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_nnz_in" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::Function const *)arg1)->nnz_in();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_nnz_in'."
      "  Prototype:\n"
      "    NNZ_IN(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_nnz_in__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  casadi_int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("Function_nnz_in",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_nnz_in" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::Function const *)arg1)->nnz_in(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_nnz_in'."
      "  Prototype:\n"
      "    NNZ_IN(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_nnz_in__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("Function_nnz_in",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_nnz_in" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::Function const *)arg1)->nnz_in((std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_nnz_in'."
      "  Prototype:\n"
      "    NNZ_IN(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_nnz_in(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_Function_nnz_in__SWIG_0(resc,resv,argc,argv);
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_Function_nnz_in__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        return _wrap_Function_nnz_in__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_nnz_in'."
    "  Possible prototypes are:\n"
    "    NNZ_IN(self)\n"
    "    NNZ_IN(self,int)\n"
    "    NNZ_IN(self,char)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_Function_nnz_out__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("Function_nnz_out",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_nnz_out" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::Function const *)arg1)->nnz_out();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_nnz_out'."
      "  Prototype:\n"
      "    NNZ_OUT(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_nnz_out__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  casadi_int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("Function_nnz_out",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_nnz_out" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::Function const *)arg1)->nnz_out(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_nnz_out'."
      "  Prototype:\n"
      "    NNZ_OUT(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_nnz_out__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("Function_nnz_out",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_nnz_out" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::Function const *)arg1)->nnz_out((std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_nnz_out'."
      "  Prototype:\n"
      "    NNZ_OUT(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_nnz_out(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_Function_nnz_out__SWIG_0(resc,resv,argc,argv);
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_Function_nnz_out__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        return _wrap_Function_nnz_out__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_nnz_out'."
    "  Possible prototypes are:\n"
    "    NNZ_OUT(self)\n"
    "    NNZ_OUT(self,int)\n"
    "    NNZ_OUT(self,char)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_Function_numel_in__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("Function_numel_in",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_numel_in" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::Function const *)arg1)->numel_in();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_numel_in'."
      "  Prototype:\n"
      "    NUMEL_IN(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_numel_in__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  casadi_int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("Function_numel_in",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_numel_in" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::Function const *)arg1)->numel_in(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_numel_in'."
      "  Prototype:\n"
      "    NUMEL_IN(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_numel_in__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("Function_numel_in",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_numel_in" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::Function const *)arg1)->numel_in((std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_numel_in'."
      "  Prototype:\n"
      "    NUMEL_IN(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_numel_in(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_Function_numel_in__SWIG_0(resc,resv,argc,argv);
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_Function_numel_in__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        return _wrap_Function_numel_in__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_numel_in'."
    "  Possible prototypes are:\n"
    "    NUMEL_IN(self)\n"
    "    NUMEL_IN(self,int)\n"
    "    NUMEL_IN(self,char)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_Function_numel_out__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("Function_numel_out",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_numel_out" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::Function const *)arg1)->numel_out();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_numel_out'."
      "  Prototype:\n"
      "    NUMEL_OUT(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_numel_out__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  casadi_int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("Function_numel_out",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_numel_out" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::Function const *)arg1)->numel_out(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_numel_out'."
      "  Prototype:\n"
      "    NUMEL_OUT(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_numel_out__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("Function_numel_out",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_numel_out" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::Function const *)arg1)->numel_out((std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_numel_out'."
      "  Prototype:\n"
      "    NUMEL_OUT(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_numel_out(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_Function_numel_out__SWIG_0(resc,resv,argc,argv);
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_Function_numel_out__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        return _wrap_Function_numel_out__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_numel_out'."
    "  Possible prototypes are:\n"
    "    NUMEL_OUT(self)\n"
    "    NUMEL_OUT(self,int)\n"
    "    NUMEL_OUT(self,char)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_Function_name_in__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< std::string,std::allocator< std::string > > *result = 0 ;
  
  if (!SWIG_check_num_args("Function_name_in",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_name_in" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (std::vector< std::string,std::allocator< std::string > > *) &((casadi::Function const *)arg1)->name_in();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ptr(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "char" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_name_in'."
      "  Prototype:\n"
      "    NAME_IN(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_name_out__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< std::string,std::allocator< std::string > > *result = 0 ;
  
  if (!SWIG_check_num_args("Function_name_out",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_name_out" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (std::vector< std::string,std::allocator< std::string > > *) &((casadi::Function const *)arg1)->name_out();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ptr(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "char" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_name_out'."
      "  Prototype:\n"
      "    NAME_OUT(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_name_in__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  casadi_int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::string *result = 0 ;
  
  if (!SWIG_check_num_args("Function_name_in",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_name_in" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (std::string *) &((casadi::Function const *)arg1)->name_in(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ptr(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_name_in'."
      "  Prototype:\n"
      "    NAME_IN(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_name_in(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_Function_name_in__SWIG_0(resc,resv,argc,argv);
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_Function_name_in__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_name_in'."
    "  Possible prototypes are:\n"
    "    NAME_IN(self)\n"
    "    NAME_IN(self,int)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_Function_name_out__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  casadi_int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::string *result = 0 ;
  
  if (!SWIG_check_num_args("Function_name_out",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_name_out" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (std::string *) &((casadi::Function const *)arg1)->name_out(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ptr(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_name_out'."
      "  Prototype:\n"
      "    NAME_OUT(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_name_out(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_Function_name_out__SWIG_0(resc,resv,argc,argv);
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_Function_name_out__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_name_out'."
    "  Possible prototypes are:\n"
    "    NAME_OUT(self)\n"
    "    NAME_OUT(self,int)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_Function_index_in(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("Function_index_in",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_index_in" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::Function const *)arg1)->index_in((std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_index_in'."
      "  Prototype:\n"
      "    INDEX_IN(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_index_out(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("Function_index_out",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_index_out" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::Function const *)arg1)->index_out((std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_index_out'."
      "  Prototype:\n"
      "    INDEX_OUT(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_default_in(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  casadi_int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  double result;
  
  if (!SWIG_check_num_args("Function_default_in",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_default_in" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (double)((casadi::Function const *)arg1)->default_in(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "double" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_default_in'."
      "  Prototype:\n"
      "    DEFAULT_IN(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_max_in(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  casadi_int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  double result;
  
  if (!SWIG_check_num_args("Function_max_in",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_max_in" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (double)((casadi::Function const *)arg1)->max_in(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "double" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_max_in'."
      "  Prototype:\n"
      "    MAX_IN(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_min_in(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  casadi_int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  double result;
  
  if (!SWIG_check_num_args("Function_min_in",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_min_in" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (double)((casadi::Function const *)arg1)->min_in(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "double" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_min_in'."
      "  Prototype:\n"
      "    MIN_IN(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_nominal_in(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  casadi_int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< double,std::allocator< double > > result;
  
  if (!SWIG_check_num_args("Function_nominal_in",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_nominal_in" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->nominal_in(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[" "double" "]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_nominal_in'."
      "  Prototype:\n"
      "    NOMINAL_IN(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_nominal_out(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  casadi_int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< double,std::allocator< double > > result;
  
  if (!SWIG_check_num_args("Function_nominal_out",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_nominal_out" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->nominal_out(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[" "double" "]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_nominal_out'."
      "  Prototype:\n"
      "    NOMINAL_OUT(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_sparsity_in__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  casadi_int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Sparsity *result = 0 ;
  
  if (!SWIG_check_num_args("Function_sparsity_in",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_sparsity_in" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi::Sparsity *) &((casadi::Function const *)arg1)->sparsity_in(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ptr(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_sparsity_in'."
      "  Prototype:\n"
      "    SPARSITY_IN(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_sparsity_in__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  casadi::Sparsity *result = 0 ;
  
  if (!SWIG_check_num_args("Function_sparsity_in",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_sparsity_in" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi::Sparsity *) &((casadi::Function const *)arg1)->sparsity_in((std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ptr(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_sparsity_in'."
      "  Prototype:\n"
      "    SPARSITY_IN(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_sparsity_in(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_Function_sparsity_in__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        return _wrap_Function_sparsity_in__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_sparsity_in'."
    "  Possible prototypes are:\n"
    "    SPARSITY_IN(self,int)\n"
    "    SPARSITY_IN(self,char)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_Function_sparsity_out__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  casadi_int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Sparsity *result = 0 ;
  
  if (!SWIG_check_num_args("Function_sparsity_out",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_sparsity_out" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi::Sparsity *) &((casadi::Function const *)arg1)->sparsity_out(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ptr(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_sparsity_out'."
      "  Prototype:\n"
      "    SPARSITY_OUT(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_sparsity_out__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  casadi::Sparsity *result = 0 ;
  
  if (!SWIG_check_num_args("Function_sparsity_out",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_sparsity_out" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi::Sparsity *) &((casadi::Function const *)arg1)->sparsity_out((std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ptr(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_sparsity_out'."
      "  Prototype:\n"
      "    SPARSITY_OUT(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_sparsity_out(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_Function_sparsity_out__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        return _wrap_Function_sparsity_out__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_sparsity_out'."
    "  Possible prototypes are:\n"
    "    SPARSITY_OUT(self,int)\n"
    "    SPARSITY_OUT(self,char)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_Function_is_diff_in__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  casadi_int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("Function_is_diff_in",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_is_diff_in" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Function const *)arg1)->is_diff_in(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_is_diff_in'."
      "  Prototype:\n"
      "    IS_DIFF_IN(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_is_diff_out__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  casadi_int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("Function_is_diff_out",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_is_diff_out" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Function const *)arg1)->is_diff_out(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_is_diff_out'."
      "  Prototype:\n"
      "    IS_DIFF_OUT(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_is_diff_in__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< bool,std::allocator< bool > > result;
  
  if (!SWIG_check_num_args("Function_is_diff_in",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_is_diff_in" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->is_diff_in();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[" "bool" "]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_is_diff_in'."
      "  Prototype:\n"
      "    IS_DIFF_IN(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_is_diff_in(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_Function_is_diff_in__SWIG_1(resc,resv,argc,argv);
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_Function_is_diff_in__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_is_diff_in'."
    "  Possible prototypes are:\n"
    "    IS_DIFF_IN(self)\n"
    "    IS_DIFF_IN(self,int)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_Function_is_diff_out__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< bool,std::allocator< bool > > result;
  
  if (!SWIG_check_num_args("Function_is_diff_out",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_is_diff_out" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->is_diff_out();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[" "bool" "]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_is_diff_out'."
      "  Prototype:\n"
      "    IS_DIFF_OUT(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_is_diff_out(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_Function_is_diff_out__SWIG_1(resc,resv,argc,argv);
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_Function_is_diff_out__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_is_diff_out'."
    "  Possible prototypes are:\n"
    "    IS_DIFF_OUT(self)\n"
    "    IS_DIFF_OUT(self,int)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_Function_factory(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  std::string *arg2 = 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg3 = 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg4 = 0 ;
  casadi::Function::AuxOut const &arg5_defvalue = casadi::Function::AuxOut() ;
  casadi::Function::AuxOut *arg5 = (casadi::Function::AuxOut *) &arg5_defvalue ;
  casadi::Dict const &arg6_defvalue = casadi::Dict() ;
  casadi::Dict *arg6 = (casadi::Dict *) &arg6_defvalue ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  std::vector< std::string > m3 ;
  std::vector< std::string > m4 ;
  std::map< std::string,std::vector< std::string > > m5 ;
  std::map< std::string,casadi::GenericType > m6 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("Function_factory",argc,6,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_factory" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "{" "char" "}" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "{" "char" "}" "'.");
  if (4<argc) {
    arg5 = &m5;
    if (!casadi::to_ptr(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "struct" ":" "{" "char" "}" "'.");
  }
  if (5<argc) {
    arg6 = &m6;
    if (!casadi::to_ptr(argv[5], &arg6)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 6 to type '" "struct" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->factory((std::string const &)*arg2,(std::vector< std::string,std::allocator< std::string > > const &)*arg3,(std::vector< std::string,std::allocator< std::string > > const &)*arg4,(casadi::Function::AuxOut const &)*arg5,(casadi::Dict const &)*arg6);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_factory'."
      "  Prototype:\n"
      "    FACTORY(self,char,{char},{char},struct:{char},struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_oracle(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("Function_oracle",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_oracle" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->oracle();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_oracle'."
      "  Prototype:\n"
      "    ORACLE(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_wrap(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("Function_wrap",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_wrap" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->wrap();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_wrap'."
      "  Prototype:\n"
      "    WRAP(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_wrap_as_needed(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  casadi::Dict *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::map< std::string,casadi::GenericType > m2 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("Function_wrap_as_needed",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_wrap_as_needed" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "struct" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->wrap_as_needed((casadi::Dict const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_wrap_as_needed'."
      "  Prototype:\n"
      "    WRAP_AS_NEEDED(self,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_which_depends(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  std::string *arg2 = 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg3 = 0 ;
  casadi_int arg4 = (casadi_int) 1 ;
  bool arg5 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  std::vector< std::string > m3 ;
  mxArray * _out;
  std::vector< bool,std::allocator< bool > > result;
  
  if (!SWIG_check_num_args("Function_which_depends",argc,5,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_which_depends" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "{" "char" "}" "'.");
  if (3<argc) {
    if (!casadi::to_val(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "int" "'.");
  }
  if (4<argc) {
    if (!casadi::to_val(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->which_depends((std::string const &)*arg2,(std::vector< std::string,std::allocator< std::string > > const &)*arg3,arg4,arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[" "bool" "]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_which_depends'."
      "  Prototype:\n"
      "    WHICH_DEPENDS(self,char,{char},int,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_print_dimensions(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  std::ostream &arg2_defvalue = casadi::uout() ;
  std::ostream *arg2 = (std::ostream *) &arg2_defvalue ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  arg2 = &casadi::uout();
  if (!SWIG_check_num_args("Function_print_dimensions",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_print_dimensions" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Function const *)arg1)->print_dimensions(*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  *arg2 << "\n" << std::flush;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_print_dimensions'."
      "  Prototype:\n"
      "    PRINT_DIMENSIONS(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_print_options(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  std::ostream &arg2_defvalue = casadi::uout() ;
  std::ostream *arg2 = (std::ostream *) &arg2_defvalue ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  arg2 = &casadi::uout();
  if (!SWIG_check_num_args("Function_print_options",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_print_options" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Function const *)arg1)->print_options(*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  *arg2 << "\n" << std::flush;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_print_options'."
      "  Prototype:\n"
      "    PRINT_OPTIONS(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_print_option(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  std::string *arg2 = 0 ;
  std::ostream &arg3_defvalue = casadi::uout() ;
  std::ostream *arg3 = (std::ostream *) &arg3_defvalue ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  
  arg3 = &casadi::uout();
  if (!SWIG_check_num_args("Function_print_option",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_print_option" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Function const *)arg1)->print_option((std::string const &)*arg2,*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  *arg3 << "\n" << std::flush;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_print_option'."
      "  Prototype:\n"
      "    PRINT_OPTION(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_has_option(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("Function_has_option",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_has_option" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Function const *)arg1)->has_option((std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_has_option'."
      "  Prototype:\n"
      "    HAS_OPTION(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_change_option(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  std::string *arg2 = 0 ;
  casadi::GenericType *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  casadi::GenericType m3 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("Function_change_option",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_change_option" "', argument " "1"" of type '" "casadi::Function *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "GenericType" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->change_option((std::string const &)*arg2,(casadi::GenericType const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_change_option'."
      "  Prototype:\n"
      "    CHANGE_OPTION(self,char,GenericType)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_uses_output(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("Function_uses_output",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_uses_output" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Function const *)arg1)->uses_output();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_uses_output'."
      "  Prototype:\n"
      "    USES_OUTPUT(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_jacobian_old(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  casadi_int arg2 ;
  casadi_int arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("Function_jacobian_old",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_jacobian_old" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->jacobian_old(arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_jacobian_old'."
      "  Prototype:\n"
      "    JACOBIAN_OLD(self,int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_hessian_old(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  casadi_int arg2 ;
  casadi_int arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("Function_hessian_old",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_hessian_old" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->hessian_old(arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_hessian_old'."
      "  Prototype:\n"
      "    HESSIAN_OLD(self,int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_sparsity_jac__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  casadi_int arg2 ;
  casadi_int arg3 ;
  bool arg4 = (bool) false ;
  bool arg5 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("Function_sparsity_jac",argc,5,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_sparsity_jac" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  if (3<argc) {
    if (!casadi::to_val(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "bool" "'.");
  }
  if (4<argc) {
    if (!casadi::to_val(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->sparsity_jac(arg2,arg3,arg4,arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_sparsity_jac'."
      "  Prototype:\n"
      "    SPARSITY_JAC(self,int,int,bool,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_sparsity_jac__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  std::string *arg2 = 0 ;
  casadi_int arg3 = (casadi_int) 0 ;
  bool arg4 = (bool) false ;
  bool arg5 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("Function_sparsity_jac",argc,5,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_sparsity_jac" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  }
  if (3<argc) {
    if (!casadi::to_val(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "bool" "'.");
  }
  if (4<argc) {
    if (!casadi::to_val(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->sparsity_jac((std::string const &)*arg2,arg3,arg4,arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_sparsity_jac'."
      "  Prototype:\n"
      "    SPARSITY_JAC(self,char,int,bool,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_sparsity_jac__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  casadi_int arg2 ;
  std::string *arg3 = 0 ;
  bool arg4 = (bool) false ;
  bool arg5 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m3 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("Function_sparsity_jac",argc,5,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_sparsity_jac" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "char" "'.");
  if (3<argc) {
    if (!casadi::to_val(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "bool" "'.");
  }
  if (4<argc) {
    if (!casadi::to_val(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->sparsity_jac(arg2,(std::string const &)*arg3,arg4,arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_sparsity_jac'."
      "  Prototype:\n"
      "    SPARSITY_JAC(self,int,char,bool,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_sparsity_jac__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  std::string *arg2 = 0 ;
  std::string *arg3 = 0 ;
  bool arg4 = (bool) false ;
  bool arg5 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  std::string m3 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("Function_sparsity_jac",argc,5,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_sparsity_jac" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "char" "'.");
  if (3<argc) {
    if (!casadi::to_val(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "bool" "'.");
  }
  if (4<argc) {
    if (!casadi::to_val(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->sparsity_jac((std::string const &)*arg2,(std::string const &)*arg3,arg4,arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_sparsity_jac'."
      "  Prototype:\n"
      "    SPARSITY_JAC(self,char,char,bool,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_sparsity_jac(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 2) && (argc <= 5)) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_Function_sparsity_jac__SWIG_1(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_Function_sparsity_jac__SWIG_1(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< bool **>(0));
          if (_v) {
            if (argc <= 4) {
              return _wrap_Function_sparsity_jac__SWIG_1(resc,resv,argc,argv);
            }
            _v = casadi::to_ptr(argv[4], static_cast< bool **>(0));
            if (_v) {
              return _wrap_Function_sparsity_jac__SWIG_1(resc,resv,argc,argv);
            }
          }
        }
      }
    }
  }
  if ((argc >= 3) && (argc <= 5)) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_Function_sparsity_jac__SWIG_0(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< bool **>(0));
          if (_v) {
            if (argc <= 4) {
              return _wrap_Function_sparsity_jac__SWIG_0(resc,resv,argc,argv);
            }
            _v = casadi::to_ptr(argv[4], static_cast< bool **>(0));
            if (_v) {
              return _wrap_Function_sparsity_jac__SWIG_0(resc,resv,argc,argv);
            }
          }
        }
      }
    }
  }
  if ((argc >= 3) && (argc <= 5)) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::string **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_Function_sparsity_jac__SWIG_2(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< bool **>(0));
          if (_v) {
            if (argc <= 4) {
              return _wrap_Function_sparsity_jac__SWIG_2(resc,resv,argc,argv);
            }
            _v = casadi::to_ptr(argv[4], static_cast< bool **>(0));
            if (_v) {
              return _wrap_Function_sparsity_jac__SWIG_2(resc,resv,argc,argv);
            }
          }
        }
      }
    }
  }
  if ((argc >= 3) && (argc <= 5)) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::string **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_Function_sparsity_jac__SWIG_3(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< bool **>(0));
          if (_v) {
            if (argc <= 4) {
              return _wrap_Function_sparsity_jac__SWIG_3(resc,resv,argc,argv);
            }
            _v = casadi::to_ptr(argv[4], static_cast< bool **>(0));
            if (_v) {
              return _wrap_Function_sparsity_jac__SWIG_3(resc,resv,argc,argv);
            }
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_sparsity_jac'."
    "  Possible prototypes are:\n"
    "    SPARSITY_JAC(self,char,int,bool,bool)\n"
    "    SPARSITY_JAC(self,int,int,bool,bool)\n"
    "    SPARSITY_JAC(self,int,char,bool,bool)\n"
    "    SPARSITY_JAC(self,char,char,bool,bool)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_Function_jacobian(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("Function_jacobian",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_jacobian" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->jacobian();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_jacobian'."
      "  Prototype:\n"
      "    JACOBIAN(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_call__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  std::vector< casadi::DM,std::allocator< casadi::DM > > *arg2 = 0 ;
  std::vector< casadi::DM,std::allocator< casadi::DM > > *arg3 = 0 ;
  bool arg4 = (bool) false ;
  bool arg5 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< casadi::Matrix< double > > m2 ;
  std::vector< casadi::Matrix< double > > m3 ;
  mxArray * _out;
  
  arg3 = &m3;
  if (!SWIG_check_num_args("Function_call",argc,4,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_call" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "DM" "}" "'.");
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "bool" "'.");
  }
  if (3<argc) {
    if (!casadi::to_val(argv[3], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Function const *)arg1)->call((std::vector< casadi::DM,std::allocator< casadi::DM > > const &)*arg2,*arg3,arg4,arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg3);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_call'."
      "  Prototype:\n"
      "    CALL(self,{DM},bool,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_call__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  std::vector< casadi::SX,std::allocator< casadi::SX > > *arg2 = 0 ;
  std::vector< casadi::SX,std::allocator< casadi::SX > > *arg3 = 0 ;
  bool arg4 = (bool) false ;
  bool arg5 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< casadi::Matrix< casadi::SXElem > > m2 ;
  std::vector< casadi::Matrix< casadi::SXElem > > m3 ;
  mxArray * _out;
  
  arg3 = &m3;
  if (!SWIG_check_num_args("Function_call",argc,4,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_call" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "SX" "}" "'.");
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "bool" "'.");
  }
  if (3<argc) {
    if (!casadi::to_val(argv[3], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Function const *)arg1)->call((std::vector< casadi::SX,std::allocator< casadi::SX > > const &)*arg2,*arg3,arg4,arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg3);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_call'."
      "  Prototype:\n"
      "    CALL(self,{SX},bool,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_call__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  std::vector< casadi::MX,std::allocator< casadi::MX > > *arg2 = 0 ;
  std::vector< casadi::MX,std::allocator< casadi::MX > > *arg3 = 0 ;
  bool arg4 = (bool) false ;
  bool arg5 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< casadi::MX > m2 ;
  std::vector< casadi::MX > m3 ;
  mxArray * _out;
  
  arg3 = &m3;
  if (!SWIG_check_num_args("Function_call",argc,4,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_call" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "MX" "}" "'.");
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "bool" "'.");
  }
  if (3<argc) {
    if (!casadi::to_val(argv[3], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Function const *)arg1)->call((std::vector< casadi::MX,std::allocator< casadi::MX > > const &)*arg2,*arg3,arg4,arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg3);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_call'."
      "  Prototype:\n"
      "    CALL(self,{MX},bool,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_call__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  casadi::DMDict *arg2 = 0 ;
  casadi::DMDict *arg3 = 0 ;
  bool arg4 = (bool) false ;
  bool arg5 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::map< std::string,casadi::Matrix< double > > m2 ;
  std::map< std::string,casadi::Matrix< double > > m3 ;
  mxArray * _out;
  
  arg3 = &m3;
  if (!SWIG_check_num_args("Function_call",argc,4,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_call" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "struct" ":" "DM" "'.");
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "bool" "'.");
  }
  if (3<argc) {
    if (!casadi::to_val(argv[3], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Function const *)arg1)->call((casadi::DMDict const &)*arg2,*arg3,arg4,arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg3);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_call'."
      "  Prototype:\n"
      "    CALL(self,struct:DM,bool,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_call__SWIG_4(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  casadi::SXDict *arg2 = 0 ;
  casadi::SXDict *arg3 = 0 ;
  bool arg4 = (bool) false ;
  bool arg5 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::map< std::string,casadi::Matrix< casadi::SXElem > > m2 ;
  std::map< std::string,casadi::Matrix< casadi::SXElem > > m3 ;
  mxArray * _out;
  
  arg3 = &m3;
  if (!SWIG_check_num_args("Function_call",argc,4,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_call" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "struct" ":" "SX" "'.");
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "bool" "'.");
  }
  if (3<argc) {
    if (!casadi::to_val(argv[3], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Function const *)arg1)->call((casadi::SXDict const &)*arg2,*arg3,arg4,arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg3);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_call'."
      "  Prototype:\n"
      "    CALL(self,struct:SX,bool,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_call__SWIG_5(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  casadi::MXDict *arg2 = 0 ;
  casadi::MXDict *arg3 = 0 ;
  bool arg4 = (bool) false ;
  bool arg5 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::map< std::string,casadi::MX > m2 ;
  std::map< std::string,casadi::MX > m3 ;
  mxArray * _out;
  
  arg3 = &m3;
  if (!SWIG_check_num_args("Function_call",argc,4,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_call" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "struct" ":" "MX" "'.");
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "bool" "'.");
  }
  if (3<argc) {
    if (!casadi::to_val(argv[3], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Function const *)arg1)->call((casadi::MXDict const &)*arg2,*arg3,arg4,arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg3);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_call'."
      "  Prototype:\n"
      "    CALL(self,struct:MX,bool,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_call(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 2) && (argc <= 4)) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::map<std::string,casadi::Matrix<double> > **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_Function_call__SWIG_3(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< bool **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_Function_call__SWIG_3(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< bool **>(0));
          if (_v) {
            return _wrap_Function_call__SWIG_3(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if ((argc >= 2) && (argc <= 4)) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector< casadi::Matrix<double> > **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_Function_call__SWIG_0(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< bool **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_Function_call__SWIG_0(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< bool **>(0));
          if (_v) {
            return _wrap_Function_call__SWIG_0(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if ((argc >= 2) && (argc <= 4)) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector< casadi::Matrix<casadi::SXElem> > **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_Function_call__SWIG_1(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< bool **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_Function_call__SWIG_1(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< bool **>(0));
          if (_v) {
            return _wrap_Function_call__SWIG_1(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if ((argc >= 2) && (argc <= 4)) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::map<std::string,casadi::Matrix<casadi::SXElem> > **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_Function_call__SWIG_4(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< bool **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_Function_call__SWIG_4(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< bool **>(0));
          if (_v) {
            return _wrap_Function_call__SWIG_4(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if ((argc >= 2) && (argc <= 4)) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::map<std::string,casadi::MX> **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_Function_call__SWIG_5(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< bool **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_Function_call__SWIG_5(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< bool **>(0));
          if (_v) {
            return _wrap_Function_call__SWIG_5(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if ((argc >= 2) && (argc <= 4)) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<casadi::MX> **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_Function_call__SWIG_2(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< bool **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_Function_call__SWIG_2(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< bool **>(0));
          if (_v) {
            return _wrap_Function_call__SWIG_2(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_call'."
    "  Possible prototypes are:\n"
    "    CALL(self,struct:DM,bool,bool)\n"
    "    CALL(self,{DM},bool,bool)\n"
    "    CALL(self,{SX},bool,bool)\n"
    "    CALL(self,struct:SX,bool,bool)\n"
    "    CALL(self,struct:MX,bool,bool)\n"
    "    CALL(self,{MX},bool,bool)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_Function_mapsum(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  std::vector< casadi::MX,std::allocator< casadi::MX > > *arg2 = 0 ;
  std::string const &arg3_defvalue = "serial" ;
  std::string *arg3 = (std::string *) &arg3_defvalue ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< casadi::MX > m2 ;
  std::string m3 ;
  mxArray * _out;
  std::vector< casadi::MX,std::allocator< casadi::MX > > result;
  
  if (!SWIG_check_num_args("Function_mapsum",argc,3,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_mapsum" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "MX" "}" "'.");
  if (2<argc) {
    arg3 = &m3;
    if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "char" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->mapsum((std::vector< casadi::MX,std::allocator< casadi::MX > > const &)*arg2,(std::string const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "MX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_mapsum'."
      "  Prototype:\n"
      "    MAPSUM(self,{MX},char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_mapaccum__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  std::string *arg2 = 0 ;
  casadi_int arg3 ;
  casadi::Dict const &arg4_defvalue = casadi::Dict() ;
  casadi::Dict *arg4 = (casadi::Dict *) &arg4_defvalue ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  std::map< std::string,casadi::GenericType > m4 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("Function_mapaccum",argc,4,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_mapaccum" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  if (3<argc) {
    arg4 = &m4;
    if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "struct" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->mapaccum((std::string const &)*arg2,arg3,(casadi::Dict const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_mapaccum'."
      "  Prototype:\n"
      "    MAPACCUM(self,char,int,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_mapaccum__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  std::string *arg2 = 0 ;
  casadi_int arg3 ;
  casadi_int arg4 ;
  casadi::Dict const &arg5_defvalue = casadi::Dict() ;
  casadi::Dict *arg5 = (casadi::Dict *) &arg5_defvalue ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  std::map< std::string,casadi::GenericType > m5 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("Function_mapaccum",argc,5,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_mapaccum" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  if (!casadi::to_val(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "int" "'.");
  if (4<argc) {
    arg5 = &m5;
    if (!casadi::to_ptr(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "struct" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->mapaccum((std::string const &)*arg2,arg3,arg4,(casadi::Dict const &)*arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_mapaccum'."
      "  Prototype:\n"
      "    MAPACCUM(self,char,int,int,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_mapaccum__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  std::string *arg2 = 0 ;
  casadi_int arg3 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg4 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg5 = 0 ;
  casadi::Dict const &arg6_defvalue = casadi::Dict() ;
  casadi::Dict *arg6 = (casadi::Dict *) &arg6_defvalue ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  std::vector< casadi_int > m4 ;
  std::vector< casadi_int > m5 ;
  std::map< std::string,casadi::GenericType > m6 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("Function_mapaccum",argc,6,5,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_mapaccum" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "[" "int" "]" "'.");
  arg5 = &m5;
  if (!casadi::to_ptr(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "[" "int" "]" "'.");
  if (5<argc) {
    arg6 = &m6;
    if (!casadi::to_ptr(argv[5], &arg6)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 6 to type '" "struct" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->mapaccum((std::string const &)*arg2,arg3,(std::vector< casadi_int,std::allocator< casadi_int > > const &)*arg4,(std::vector< casadi_int,std::allocator< casadi_int > > const &)*arg5,(casadi::Dict const &)*arg6);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_mapaccum'."
      "  Prototype:\n"
      "    MAPACCUM(self,char,int,[int],[int],struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_mapaccum__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  std::string *arg2 = 0 ;
  casadi_int arg3 ;
  std::vector< std::string,std::allocator< std::string > > *arg4 = 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg5 = 0 ;
  casadi::Dict const &arg6_defvalue = casadi::Dict() ;
  casadi::Dict *arg6 = (casadi::Dict *) &arg6_defvalue ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  std::vector< std::string > m4 ;
  std::vector< std::string > m5 ;
  std::map< std::string,casadi::GenericType > m6 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("Function_mapaccum",argc,6,5,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_mapaccum" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "{" "char" "}" "'.");
  arg5 = &m5;
  if (!casadi::to_ptr(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "{" "char" "}" "'.");
  if (5<argc) {
    arg6 = &m6;
    if (!casadi::to_ptr(argv[5], &arg6)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 6 to type '" "struct" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->mapaccum((std::string const &)*arg2,arg3,(std::vector< std::string,std::allocator< std::string > > const &)*arg4,(std::vector< std::string,std::allocator< std::string > > const &)*arg5,(casadi::Dict const &)*arg6);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_mapaccum'."
      "  Prototype:\n"
      "    MAPACCUM(self,char,int,{char},{char},struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_mapaccum__SWIG_4(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  casadi_int arg2 ;
  casadi::Dict const &arg3_defvalue = casadi::Dict() ;
  casadi::Dict *arg3 = (casadi::Dict *) &arg3_defvalue ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::map< std::string,casadi::GenericType > m3 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("Function_mapaccum",argc,3,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_mapaccum" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  if (2<argc) {
    arg3 = &m3;
    if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "struct" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->mapaccum(arg2,(casadi::Dict const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_mapaccum'."
      "  Prototype:\n"
      "    MAPACCUM(self,int,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_mapaccum(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 2) && (argc <= 3)) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_Function_mapaccum__SWIG_4(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< std::map<std::string,casadi::GenericType> **>(0));
        if (_v) {
          return _wrap_Function_mapaccum__SWIG_4(resc,resv,argc,argv);
        }
      }
    }
  }
  if ((argc >= 3) && (argc <= 4)) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_Function_mapaccum__SWIG_0(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< std::map<std::string,casadi::GenericType> **>(0));
          if (_v) {
            return _wrap_Function_mapaccum__SWIG_0(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if ((argc >= 4) && (argc <= 5)) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi_int **>(0));
          if (_v) {
            if (argc <= 4) {
              return _wrap_Function_mapaccum__SWIG_1(resc,resv,argc,argv);
            }
            _v = casadi::to_ptr(argv[4], static_cast< std::map<std::string,casadi::GenericType> **>(0));
            if (_v) {
              return _wrap_Function_mapaccum__SWIG_1(resc,resv,argc,argv);
            }
          }
        }
      }
    }
  }
  if ((argc >= 5) && (argc <= 6)) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< std::vector<std::string> **>(0));
          if (_v) {
            _v = casadi::to_ptr(argv[4], static_cast< std::vector<std::string> **>(0));
            if (_v) {
              if (argc <= 5) {
                return _wrap_Function_mapaccum__SWIG_3(resc,resv,argc,argv);
              }
              _v = casadi::to_ptr(argv[5], static_cast< std::map<std::string,casadi::GenericType> **>(0));
              if (_v) {
                return _wrap_Function_mapaccum__SWIG_3(resc,resv,argc,argv);
              }
            }
          }
        }
      }
    }
  }
  if ((argc >= 5) && (argc <= 6)) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< std::vector<casadi_int> **>(0));
          if (_v) {
            _v = casadi::to_ptr(argv[4], static_cast< std::vector<casadi_int> **>(0));
            if (_v) {
              if (argc <= 5) {
                return _wrap_Function_mapaccum__SWIG_2(resc,resv,argc,argv);
              }
              _v = casadi::to_ptr(argv[5], static_cast< std::map<std::string,casadi::GenericType> **>(0));
              if (_v) {
                return _wrap_Function_mapaccum__SWIG_2(resc,resv,argc,argv);
              }
            }
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_mapaccum'."
    "  Possible prototypes are:\n"
    "    MAPACCUM(self,int,struct)\n"
    "    MAPACCUM(self,char,int,struct)\n"
    "    MAPACCUM(self,char,int,int,struct)\n"
    "    MAPACCUM(self,char,int,{char},{char},struct)\n"
    "    MAPACCUM(self,char,int,[int],[int],struct)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_Function_fold(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  casadi_int arg2 ;
  casadi::Dict const &arg3_defvalue = casadi::Dict() ;
  casadi::Dict *arg3 = (casadi::Dict *) &arg3_defvalue ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::map< std::string,casadi::GenericType > m3 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("Function_fold",argc,3,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_fold" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  if (2<argc) {
    arg3 = &m3;
    if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "struct" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->fold(arg2,(casadi::Dict const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_fold'."
      "  Prototype:\n"
      "    FOLD(self,int,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_map__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  casadi_int arg2 ;
  std::string const &arg3_defvalue = "serial" ;
  std::string *arg3 = (std::string *) &arg3_defvalue ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m3 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("Function_map",argc,3,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_map" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  if (2<argc) {
    arg3 = &m3;
    if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "char" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->map(arg2,(std::string const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_map'."
      "  Prototype:\n"
      "    MAP(self,int,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_map__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  casadi_int arg2 ;
  std::string *arg3 = 0 ;
  casadi_int arg4 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m3 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("Function_map",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_map" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "char" "'.");
  if (!casadi::to_val(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->map(arg2,(std::string const &)*arg3,arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_map'."
      "  Prototype:\n"
      "    MAP(self,int,char,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_map__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  std::string *arg2 = 0 ;
  std::string *arg3 = 0 ;
  casadi_int arg4 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg5 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg6 = 0 ;
  casadi::Dict const &arg7_defvalue = casadi::Dict() ;
  casadi::Dict *arg7 = (casadi::Dict *) &arg7_defvalue ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  std::string m3 ;
  std::vector< casadi_int > m5 ;
  std::vector< casadi_int > m6 ;
  std::map< std::string,casadi::GenericType > m7 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("Function_map",argc,7,6,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_map" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "char" "'.");
  if (!casadi::to_val(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "int" "'.");
  arg5 = &m5;
  if (!casadi::to_ptr(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "[" "int" "]" "'.");
  arg6 = &m6;
  if (!casadi::to_ptr(argv[5], &arg6)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 6 to type '" "[" "int" "]" "'.");
  if (6<argc) {
    arg7 = &m7;
    if (!casadi::to_ptr(argv[6], &arg7)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 7 to type '" "struct" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->map((std::string const &)*arg2,(std::string const &)*arg3,arg4,(std::vector< casadi_int,std::allocator< casadi_int > > const &)*arg5,(std::vector< casadi_int,std::allocator< casadi_int > > const &)*arg6,(casadi::Dict const &)*arg7);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_map'."
      "  Prototype:\n"
      "    MAP(self,char,char,int,[int],[int],struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_map__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  std::string *arg2 = 0 ;
  std::string *arg3 = 0 ;
  casadi_int arg4 ;
  std::vector< std::string,std::allocator< std::string > > *arg5 = 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg6 = 0 ;
  casadi::Dict const &arg7_defvalue = casadi::Dict() ;
  casadi::Dict *arg7 = (casadi::Dict *) &arg7_defvalue ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  std::string m3 ;
  std::vector< std::string > m5 ;
  std::vector< std::string > m6 ;
  std::map< std::string,casadi::GenericType > m7 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("Function_map",argc,7,6,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_map" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "char" "'.");
  if (!casadi::to_val(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "int" "'.");
  arg5 = &m5;
  if (!casadi::to_ptr(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "{" "char" "}" "'.");
  arg6 = &m6;
  if (!casadi::to_ptr(argv[5], &arg6)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 6 to type '" "{" "char" "}" "'.");
  if (6<argc) {
    arg7 = &m7;
    if (!casadi::to_ptr(argv[6], &arg7)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 7 to type '" "struct" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->map((std::string const &)*arg2,(std::string const &)*arg3,arg4,(std::vector< std::string,std::allocator< std::string > > const &)*arg5,(std::vector< std::string,std::allocator< std::string > > const &)*arg6,(casadi::Dict const &)*arg7);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_map'."
      "  Prototype:\n"
      "    MAP(self,char,char,int,{char},{char},struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_map__SWIG_4(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  casadi_int arg2 ;
  std::vector< bool,std::allocator< bool > > *arg3 = 0 ;
  std::vector< bool,std::allocator< bool > > const &arg4_defvalue = std::vector< bool >() ;
  std::vector< bool,std::allocator< bool > > *arg4 = (std::vector< bool,std::allocator< bool > > *) &arg4_defvalue ;
  casadi::Dict const &arg5_defvalue = casadi::Dict() ;
  casadi::Dict *arg5 = (casadi::Dict *) &arg5_defvalue ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< bool > m3 ;
  std::vector< bool > m4 ;
  std::map< std::string,casadi::GenericType > m5 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("Function_map",argc,5,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_map" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "[" "bool" "]" "'.");
  if (3<argc) {
    arg4 = &m4;
    if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "[" "bool" "]" "'.");
  }
  if (4<argc) {
    arg5 = &m5;
    if (!casadi::to_ptr(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "struct" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->map(arg2,(std::vector< bool,std::allocator< bool > > const &)*arg3,(std::vector< bool,std::allocator< bool > > const &)*arg4,(casadi::Dict const &)*arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_map'."
      "  Prototype:\n"
      "    MAP(self,int,[bool],[bool],struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_map(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 2) && (argc <= 3)) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_Function_map__SWIG_0(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< std::string **>(0));
        if (_v) {
          return _wrap_Function_map__SWIG_0(resc,resv,argc,argv);
        }
      }
    }
  }
  if ((argc >= 3) && (argc <= 5)) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::vector<bool> **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_Function_map__SWIG_4(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< std::vector<bool> **>(0));
          if (_v) {
            if (argc <= 4) {
              return _wrap_Function_map__SWIG_4(resc,resv,argc,argv);
            }
            _v = casadi::to_ptr(argv[4], static_cast< std::map<std::string,casadi::GenericType> **>(0));
            if (_v) {
              return _wrap_Function_map__SWIG_4(resc,resv,argc,argv);
            }
          }
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::string **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi_int **>(0));
          if (_v) {
            return _wrap_Function_map__SWIG_1(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if ((argc >= 6) && (argc <= 7)) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::string **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi_int **>(0));
          if (_v) {
            _v = casadi::to_ptr(argv[4], static_cast< std::vector<std::string> **>(0));
            if (_v) {
              _v = casadi::to_ptr(argv[5], static_cast< std::vector<std::string> **>(0));
              if (_v) {
                if (argc <= 6) {
                  return _wrap_Function_map__SWIG_3(resc,resv,argc,argv);
                }
                _v = casadi::to_ptr(argv[6], static_cast< std::map<std::string,casadi::GenericType> **>(0));
                if (_v) {
                  return _wrap_Function_map__SWIG_3(resc,resv,argc,argv);
                }
              }
            }
          }
        }
      }
    }
  }
  if ((argc >= 6) && (argc <= 7)) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::string **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi_int **>(0));
          if (_v) {
            _v = casadi::to_ptr(argv[4], static_cast< std::vector<casadi_int> **>(0));
            if (_v) {
              _v = casadi::to_ptr(argv[5], static_cast< std::vector<casadi_int> **>(0));
              if (_v) {
                if (argc <= 6) {
                  return _wrap_Function_map__SWIG_2(resc,resv,argc,argv);
                }
                _v = casadi::to_ptr(argv[6], static_cast< std::map<std::string,casadi::GenericType> **>(0));
                if (_v) {
                  return _wrap_Function_map__SWIG_2(resc,resv,argc,argv);
                }
              }
            }
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_map'."
    "  Possible prototypes are:\n"
    "    MAP(self,int,char)\n"
    "    MAP(self,int,[bool],[bool],struct)\n"
    "    MAP(self,int,char,int)\n"
    "    MAP(self,char,char,int,{char},{char},struct)\n"
    "    MAP(self,char,char,int,[int],[int],struct)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_Function_slice(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  std::string *arg2 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg3 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg4 = 0 ;
  casadi::Dict const &arg5_defvalue = casadi::Dict() ;
  casadi::Dict *arg5 = (casadi::Dict *) &arg5_defvalue ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  std::vector< casadi_int > m3 ;
  std::vector< casadi_int > m4 ;
  std::map< std::string,casadi::GenericType > m5 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("Function_slice",argc,5,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_slice" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "[" "int" "]" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "[" "int" "]" "'.");
  if (4<argc) {
    arg5 = &m5;
    if (!casadi::to_ptr(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "struct" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->slice((std::string const &)*arg2,(std::vector< casadi_int,std::allocator< casadi_int > > const &)*arg3,(std::vector< casadi_int,std::allocator< casadi_int > > const &)*arg4,(casadi::Dict const &)*arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_slice'."
      "  Prototype:\n"
      "    SLICE(self,char,[int],[int],struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_conditional__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::vector< casadi::Function,std::allocator< casadi::Function > > *arg2 = 0 ;
  casadi::Function *arg3 = 0 ;
  casadi::Dict const &arg4_defvalue = casadi::Dict() ;
  casadi::Dict *arg4 = (casadi::Dict *) &arg4_defvalue ;
  std::string m1 ;
  std::vector< casadi::Function > m2 ;
  casadi::Function m3 ;
  std::map< std::string,casadi::GenericType > m4 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("Function_conditional",argc,4,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "Function" "}" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "Function" "'.");
  if (3<argc) {
    arg4 = &m4;
    if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi::Function::conditional((std::string const &)*arg1,(std::vector< casadi::Function,std::allocator< casadi::Function > > const &)*arg2,(casadi::Function const &)*arg3,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_conditional'."
      "  Prototype:\n"
      "    CONDITIONAL(char,{Function},Function,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_conditional__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  casadi::Function *arg2 = 0 ;
  casadi::Dict const &arg3_defvalue = casadi::Dict() ;
  casadi::Dict *arg3 = (casadi::Dict *) &arg3_defvalue ;
  std::string m1 ;
  casadi::Function m2 ;
  std::map< std::string,casadi::GenericType > m3 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("Function_conditional",argc,3,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "Function" "'.");
  if (2<argc) {
    arg3 = &m3;
    if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi::Function::conditional((std::string const &)*arg1,(casadi::Function const &)*arg2,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_conditional'."
      "  Prototype:\n"
      "    CONDITIONAL(char,Function,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_conditional(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 2) && (argc <= 3)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::string **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Function **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_Function_conditional__SWIG_1(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< std::map<std::string,casadi::GenericType> **>(0));
        if (_v) {
          return _wrap_Function_conditional__SWIG_1(resc,resv,argc,argv);
        }
      }
    }
  }
  if ((argc >= 3) && (argc <= 4)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::string **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<casadi::Function> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Function **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_Function_conditional__SWIG_0(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< std::map<std::string,casadi::GenericType> **>(0));
          if (_v) {
            return _wrap_Function_conditional__SWIG_0(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_conditional'."
    "  Possible prototypes are:\n"
    "    CONDITIONAL(char,Function,struct)\n"
    "    CONDITIONAL(char,{Function},Function,struct)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_Function_bspline(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *arg2 = 0 ;
  std::vector< double,std::allocator< double > > *arg3 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg4 = 0 ;
  casadi_int arg5 = (casadi_int) 1 ;
  casadi::Dict const &arg6_defvalue = casadi::Dict() ;
  casadi::Dict *arg6 = (casadi::Dict *) &arg6_defvalue ;
  std::string m1 ;
  std::vector< std::vector< double > > m2 ;
  std::vector< double > m3 ;
  std::vector< casadi_int > m4 ;
  std::map< std::string,casadi::GenericType > m6 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("Function_bspline",argc,6,4,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "[" "double" "]" "}" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "[" "double" "]" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "[" "int" "]" "'.");
  if (4<argc) {
    if (!casadi::to_val(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "int" "'.");
  }
  if (5<argc) {
    arg6 = &m6;
    if (!casadi::to_ptr(argv[5], &arg6)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 6 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi::Function::bspline((std::string const &)*arg1,(std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > const &)*arg2,(std::vector< double,std::allocator< double > > const &)*arg3,(std::vector< long long,std::allocator< long long > > const &)*arg4,arg5,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg6);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_bspline'."
      "  Prototype:\n"
      "    BSPLINE(char,{[double]},[double],[int],int,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_if_else(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  casadi::Function *arg2 = 0 ;
  casadi::Function *arg3 = 0 ;
  casadi::Dict const &arg4_defvalue = casadi::Dict() ;
  casadi::Dict *arg4 = (casadi::Dict *) &arg4_defvalue ;
  std::string m1 ;
  casadi::Function m2 ;
  casadi::Function m3 ;
  std::map< std::string,casadi::GenericType > m4 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("Function_if_else",argc,4,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "Function" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "Function" "'.");
  if (3<argc) {
    arg4 = &m4;
    if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi::Function::if_else((std::string const &)*arg1,(casadi::Function const &)*arg2,(casadi::Function const &)*arg3,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_if_else'."
      "  Prototype:\n"
      "    IF_ELSE(char,Function,Function,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_forward(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  casadi_int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("Function_forward",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_forward" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->forward(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_forward'."
      "  Prototype:\n"
      "    FORWARD(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_reverse(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  casadi_int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("Function_reverse",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_reverse" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->reverse(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_reverse'."
      "  Prototype:\n"
      "    REVERSE(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_jac_sparsity__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  bool arg2 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi::Sparsity,std::allocator< casadi::Sparsity > > *result = 0 ;
  
  if (!SWIG_check_num_args("Function_jac_sparsity",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_jac_sparsity" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (std::vector< casadi::Sparsity,std::allocator< casadi::Sparsity > > *) &((casadi::Function const *)arg1)->jac_sparsity(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ptr(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "Sparsity" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_jac_sparsity'."
      "  Prototype:\n"
      "    JAC_SPARSITY(self,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_jac_sparsity__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  casadi_int arg2 ;
  casadi_int arg3 ;
  bool arg4 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("Function_jac_sparsity",argc,4,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_jac_sparsity" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  if (3<argc) {
    if (!casadi::to_val(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->jac_sparsity(arg2,arg3,arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_jac_sparsity'."
      "  Prototype:\n"
      "    JAC_SPARSITY(self,int,int,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_jac_sparsity(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 1) && (argc <= 2)) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      if (argc <= 1) {
        return _wrap_Function_jac_sparsity__SWIG_0(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< bool **>(0));
      if (_v) {
        return _wrap_Function_jac_sparsity__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  if ((argc >= 3) && (argc <= 4)) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_Function_jac_sparsity__SWIG_1(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< bool **>(0));
          if (_v) {
            return _wrap_Function_jac_sparsity__SWIG_1(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_jac_sparsity'."
    "  Possible prototypes are:\n"
    "    JAC_SPARSITY(self,bool)\n"
    "    JAC_SPARSITY(self,int,int,bool)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_Function_generate__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  std::string *arg2 = 0 ;
  casadi::Dict const &arg3_defvalue = casadi::Dict() ;
  casadi::Dict *arg3 = (casadi::Dict *) &arg3_defvalue ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  std::map< std::string,casadi::GenericType > m3 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("Function_generate",argc,3,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_generate" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  if (2<argc) {
    arg3 = &m3;
    if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "struct" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->generate((std::string const &)*arg2,(casadi::Dict const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_generate'."
      "  Prototype:\n"
      "    GENERATE(self,char,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_generate__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  casadi::Dict const &arg2_defvalue = casadi::Dict() ;
  casadi::Dict *arg2 = (casadi::Dict *) &arg2_defvalue ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::map< std::string,casadi::GenericType > m2 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("Function_generate",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_generate" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  if (1<argc) {
    arg2 = &m2;
    if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "struct" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->generate((casadi::Dict const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_generate'."
      "  Prototype:\n"
      "    GENERATE(self,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_generate(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 1) && (argc <= 2)) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      if (argc <= 1) {
        return _wrap_Function_generate__SWIG_1(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< std::map<std::string,casadi::GenericType> **>(0));
      if (_v) {
        return _wrap_Function_generate__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if ((argc >= 2) && (argc <= 3)) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_Function_generate__SWIG_0(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< std::map<std::string,casadi::GenericType> **>(0));
        if (_v) {
          return _wrap_Function_generate__SWIG_0(resc,resv,argc,argv);
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_generate'."
    "  Possible prototypes are:\n"
    "    GENERATE(self,struct)\n"
    "    GENERATE(self,char,struct)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_Function_generate_dependencies(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  std::string *arg2 = 0 ;
  casadi::Dict const &arg3_defvalue = casadi::Dict() ;
  casadi::Dict *arg3 = (casadi::Dict *) &arg3_defvalue ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  std::map< std::string,casadi::GenericType > m3 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("Function_generate_dependencies",argc,3,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_generate_dependencies" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  if (2<argc) {
    arg3 = &m3;
    if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "struct" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->generate_dependencies((std::string const &)*arg2,(casadi::Dict const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_generate_dependencies'."
      "  Prototype:\n"
      "    GENERATE_DEPENDENCIES(self,char,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_generate_in__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  std::string *arg2 = 0 ;
  std::vector< casadi::DM,std::allocator< casadi::DM > > *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  std::vector< casadi::Matrix< double > > m3 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("Function_generate_in",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_generate_in" "', argument " "1"" of type '" "casadi::Function *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "{" "DM" "}" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->generate_in((std::string const &)*arg2,(std::vector< casadi::DM,std::allocator< casadi::DM > > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_generate_in'."
      "  Prototype:\n"
      "    GENERATE_IN(self,char,{DM})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_generate_in__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  std::vector< casadi::DM,std::allocator< casadi::DM > > result;
  
  if (!SWIG_check_num_args("Function_generate_in",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_generate_in" "', argument " "1"" of type '" "casadi::Function *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->generate_in((std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "DM" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_generate_in'."
      "  Prototype:\n"
      "    GENERATE_IN(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_generate_in(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        return _wrap_Function_generate_in__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::vector< casadi::Matrix<double> > **>(0));
        if (_v) {
          return _wrap_Function_generate_in__SWIG_0(resc,resv,argc,argv);
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_generate_in'."
    "  Possible prototypes are:\n"
    "    GENERATE_IN(self,char)\n"
    "    GENERATE_IN(self,char,{DM})\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_Function_generate_out__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  std::string *arg2 = 0 ;
  std::vector< casadi::DM,std::allocator< casadi::DM > > *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  std::vector< casadi::Matrix< double > > m3 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("Function_generate_out",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_generate_out" "', argument " "1"" of type '" "casadi::Function *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "{" "DM" "}" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->generate_out((std::string const &)*arg2,(std::vector< casadi::DM,std::allocator< casadi::DM > > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_generate_out'."
      "  Prototype:\n"
      "    GENERATE_OUT(self,char,{DM})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_generate_out__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  std::vector< casadi::DM,std::allocator< casadi::DM > > result;
  
  if (!SWIG_check_num_args("Function_generate_out",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_generate_out" "', argument " "1"" of type '" "casadi::Function *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->generate_out((std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "DM" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_generate_out'."
      "  Prototype:\n"
      "    GENERATE_OUT(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_generate_out(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        return _wrap_Function_generate_out__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::vector< casadi::Matrix<double> > **>(0));
        if (_v) {
          return _wrap_Function_generate_out__SWIG_0(resc,resv,argc,argv);
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_generate_out'."
    "  Possible prototypes are:\n"
    "    GENERATE_OUT(self,char)\n"
    "    GENERATE_OUT(self,char,{DM})\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_Function_export_code__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  std::string *arg2 = 0 ;
  std::string *arg3 = 0 ;
  casadi::Dict const &arg4_defvalue = casadi::Dict() ;
  casadi::Dict *arg4 = (casadi::Dict *) &arg4_defvalue ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  std::string m3 ;
  std::map< std::string,casadi::GenericType > m4 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("Function_export_code",argc,4,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_export_code" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "char" "'.");
  if (3<argc) {
    arg4 = &m4;
    if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "struct" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Function const *)arg1)->export_code((std::string const &)*arg2,(std::string const &)*arg3,(casadi::Dict const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_export_code'."
      "  Prototype:\n"
      "    EXPORT_CODE(self,char,char,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_serialize(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  casadi::Dict const &arg2_defvalue = casadi::Dict() ;
  casadi::Dict *arg2 = (casadi::Dict *) &arg2_defvalue ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::map< std::string,casadi::GenericType > m2 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("Function_serialize",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_serialize" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  if (1<argc) {
    arg2 = &m2;
    if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "struct" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->serialize((casadi::Dict const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_serialize'."
      "  Prototype:\n"
      "    SERIALIZE(self,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_save(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  std::string *arg2 = 0 ;
  casadi::Dict const &arg3_defvalue = casadi::Dict() ;
  casadi::Dict *arg3 = (casadi::Dict *) &arg3_defvalue ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  std::map< std::string,casadi::GenericType > m3 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("Function_save",argc,3,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_save" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  if (2<argc) {
    arg3 = &m3;
    if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "struct" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Function const *)arg1)->save((std::string const &)*arg2,(casadi::Dict const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_save'."
      "  Prototype:\n"
      "    SAVE(self,char,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_export_code__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  std::string *arg2 = 0 ;
  casadi::Dict const &arg3_defvalue = casadi::Dict() ;
  casadi::Dict *arg3 = (casadi::Dict *) &arg3_defvalue ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  std::map< std::string,casadi::GenericType > m3 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("Function_export_code",argc,3,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_export_code" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  if (2<argc) {
    arg3 = &m3;
    if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "struct" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->export_code((std::string const &)*arg2,(casadi::Dict const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_export_code'."
      "  Prototype:\n"
      "    EXPORT_CODE(self,char,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_export_code(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 2) && (argc <= 3)) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_Function_export_code__SWIG_1(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< std::map<std::string,casadi::GenericType> **>(0));
        if (_v) {
          return _wrap_Function_export_code__SWIG_1(resc,resv,argc,argv);
        }
      }
    }
  }
  if ((argc >= 3) && (argc <= 4)) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::string **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_Function_export_code__SWIG_0(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< std::map<std::string,casadi::GenericType> **>(0));
          if (_v) {
            return _wrap_Function_export_code__SWIG_0(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_export_code'."
    "  Possible prototypes are:\n"
    "    EXPORT_CODE(self,char,struct)\n"
    "    EXPORT_CODE(self,char,char,struct)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_Function_stats(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  int arg2 = (int) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  mxArray * _out;
  casadi::Dict result;
  
  if (!SWIG_check_num_args("Function_stats",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_stats" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  if (1<argc) {
    ecode2 = SWIG_AsVal_int(argv[1], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Function_stats" "', argument " "2"" of type '" "int""'");
    } 
    arg2 = static_cast< int >(val2);
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->stats(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "struct" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_stats'."
      "  Prototype:\n"
      "    STATS(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_sx_in__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  casadi_int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::SX result;
  
  if (!SWIG_check_num_args("Function_sx_in",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_sx_in" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->sx_in(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_sx_in'."
      "  Prototype:\n"
      "    SX_IN(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_sx_in__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  casadi::SX result;
  
  if (!SWIG_check_num_args("Function_sx_in",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_sx_in" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->sx_in((std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_sx_in'."
      "  Prototype:\n"
      "    SX_IN(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_sx_in__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi::SX,std::allocator< casadi::SX > > result;
  
  if (!SWIG_check_num_args("Function_sx_in",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_sx_in" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->sx_in();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "SX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_sx_in'."
      "  Prototype:\n"
      "    SX_IN(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_sx_in(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_Function_sx_in__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_Function_sx_in__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        return _wrap_Function_sx_in__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_sx_in'."
    "  Possible prototypes are:\n"
    "    SX_IN(self)\n"
    "    SX_IN(self,int)\n"
    "    SX_IN(self,char)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_Function_mx_in__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  casadi_int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("Function_mx_in",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_mx_in" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->mx_in(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_mx_in'."
      "  Prototype:\n"
      "    MX_IN(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_mx_in__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("Function_mx_in",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_mx_in" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->mx_in((std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_mx_in'."
      "  Prototype:\n"
      "    MX_IN(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_mx_in__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi::MX,std::allocator< casadi::MX > > result;
  
  if (!SWIG_check_num_args("Function_mx_in",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_mx_in" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->mx_in();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "MX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_mx_in'."
      "  Prototype:\n"
      "    MX_IN(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_mx_in(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_Function_mx_in__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_Function_mx_in__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        return _wrap_Function_mx_in__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_mx_in'."
    "  Possible prototypes are:\n"
    "    MX_IN(self)\n"
    "    MX_IN(self,int)\n"
    "    MX_IN(self,char)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_Function_sx_out__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  casadi_int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::SX result;
  
  if (!SWIG_check_num_args("Function_sx_out",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_sx_out" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->sx_out(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_sx_out'."
      "  Prototype:\n"
      "    SX_OUT(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_sx_out__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  casadi::SX result;
  
  if (!SWIG_check_num_args("Function_sx_out",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_sx_out" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->sx_out((std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_sx_out'."
      "  Prototype:\n"
      "    SX_OUT(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_sx_out__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi::SX,std::allocator< casadi::SX > > result;
  
  if (!SWIG_check_num_args("Function_sx_out",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_sx_out" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->sx_out();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "SX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_sx_out'."
      "  Prototype:\n"
      "    SX_OUT(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_sx_out(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_Function_sx_out__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_Function_sx_out__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        return _wrap_Function_sx_out__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_sx_out'."
    "  Possible prototypes are:\n"
    "    SX_OUT(self)\n"
    "    SX_OUT(self,int)\n"
    "    SX_OUT(self,char)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_Function_mx_out__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  casadi_int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("Function_mx_out",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_mx_out" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->mx_out(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_mx_out'."
      "  Prototype:\n"
      "    MX_OUT(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_mx_out__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("Function_mx_out",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_mx_out" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->mx_out((std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_mx_out'."
      "  Prototype:\n"
      "    MX_OUT(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_mx_out__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi::MX,std::allocator< casadi::MX > > result;
  
  if (!SWIG_check_num_args("Function_mx_out",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_mx_out" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->mx_out();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "MX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_mx_out'."
      "  Prototype:\n"
      "    MX_OUT(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_mx_out(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_Function_mx_out__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_Function_mx_out__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        return _wrap_Function_mx_out__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_mx_out'."
    "  Possible prototypes are:\n"
    "    MX_OUT(self)\n"
    "    MX_OUT(self,int)\n"
    "    MX_OUT(self,char)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_Function_nz_from_in(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  std::vector< casadi::DM,std::allocator< casadi::DM > > *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< casadi::Matrix< double > > m2 ;
  mxArray * _out;
  std::vector< double,std::allocator< double > > result;
  
  if (!SWIG_check_num_args("Function_nz_from_in",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_nz_from_in" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "DM" "}" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->nz_from_in((std::vector< casadi::DM,std::allocator< casadi::DM > > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[" "double" "]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_nz_from_in'."
      "  Prototype:\n"
      "    NZ_FROM_IN(self,{DM})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_nz_from_out(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  std::vector< casadi::DM,std::allocator< casadi::DM > > *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< casadi::Matrix< double > > m2 ;
  mxArray * _out;
  std::vector< double,std::allocator< double > > result;
  
  if (!SWIG_check_num_args("Function_nz_from_out",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_nz_from_out" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "DM" "}" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->nz_from_out((std::vector< casadi::DM,std::allocator< casadi::DM > > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[" "double" "]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_nz_from_out'."
      "  Prototype:\n"
      "    NZ_FROM_OUT(self,{DM})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_nz_to_in(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  std::vector< double,std::allocator< double > > *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< double > m2 ;
  mxArray * _out;
  std::vector< casadi::DM,std::allocator< casadi::DM > > result;
  
  if (!SWIG_check_num_args("Function_nz_to_in",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_nz_to_in" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "[" "double" "]" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->nz_to_in((std::vector< double,std::allocator< double > > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "DM" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_nz_to_in'."
      "  Prototype:\n"
      "    NZ_TO_IN(self,[double])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_nz_to_out(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  std::vector< double,std::allocator< double > > *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< double > m2 ;
  mxArray * _out;
  std::vector< casadi::DM,std::allocator< casadi::DM > > result;
  
  if (!SWIG_check_num_args("Function_nz_to_out",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_nz_to_out" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "[" "double" "]" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->nz_to_out((std::vector< double,std::allocator< double > > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "DM" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_nz_to_out'."
      "  Prototype:\n"
      "    NZ_TO_OUT(self,[double])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_convert_in__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  std::vector< casadi::DM,std::allocator< casadi::DM > > *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< casadi::Matrix< double > > m2 ;
  mxArray * _out;
  casadi::DMDict result;
  
  if (!SWIG_check_num_args("Function_convert_in",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_convert_in" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "DM" "}" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->convert_in((std::vector< casadi::DM,std::allocator< casadi::DM > > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "struct" ":" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_convert_in'."
      "  Prototype:\n"
      "    CONVERT_IN(self,{DM})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_convert_in__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  casadi::DMDict *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::map< std::string,casadi::Matrix< double > > m2 ;
  mxArray * _out;
  std::vector< casadi::DM,std::allocator< casadi::DM > > result;
  
  if (!SWIG_check_num_args("Function_convert_in",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_convert_in" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "struct" ":" "DM" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->convert_in((casadi::DMDict const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "DM" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_convert_in'."
      "  Prototype:\n"
      "    CONVERT_IN(self,struct:DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_convert_out__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  std::vector< casadi::DM,std::allocator< casadi::DM > > *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< casadi::Matrix< double > > m2 ;
  mxArray * _out;
  casadi::DMDict result;
  
  if (!SWIG_check_num_args("Function_convert_out",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_convert_out" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "DM" "}" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->convert_out((std::vector< casadi::DM,std::allocator< casadi::DM > > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "struct" ":" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_convert_out'."
      "  Prototype:\n"
      "    CONVERT_OUT(self,{DM})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_convert_out__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  casadi::DMDict *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::map< std::string,casadi::Matrix< double > > m2 ;
  mxArray * _out;
  std::vector< casadi::DM,std::allocator< casadi::DM > > result;
  
  if (!SWIG_check_num_args("Function_convert_out",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_convert_out" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "struct" ":" "DM" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->convert_out((casadi::DMDict const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "DM" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_convert_out'."
      "  Prototype:\n"
      "    CONVERT_OUT(self,struct:DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_convert_in__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  std::vector< casadi::SX,std::allocator< casadi::SX > > *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< casadi::Matrix< casadi::SXElem > > m2 ;
  mxArray * _out;
  casadi::SXDict result;
  
  if (!SWIG_check_num_args("Function_convert_in",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_convert_in" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "SX" "}" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->convert_in((std::vector< casadi::SX,std::allocator< casadi::SX > > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "struct" ":" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_convert_in'."
      "  Prototype:\n"
      "    CONVERT_IN(self,{SX})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_convert_in__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  casadi::SXDict *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::map< std::string,casadi::Matrix< casadi::SXElem > > m2 ;
  mxArray * _out;
  std::vector< casadi::SX,std::allocator< casadi::SX > > result;
  
  if (!SWIG_check_num_args("Function_convert_in",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_convert_in" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "struct" ":" "SX" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->convert_in((casadi::SXDict const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "SX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_convert_in'."
      "  Prototype:\n"
      "    CONVERT_IN(self,struct:SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_convert_out__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  std::vector< casadi::SX,std::allocator< casadi::SX > > *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< casadi::Matrix< casadi::SXElem > > m2 ;
  mxArray * _out;
  casadi::SXDict result;
  
  if (!SWIG_check_num_args("Function_convert_out",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_convert_out" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "SX" "}" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->convert_out((std::vector< casadi::SX,std::allocator< casadi::SX > > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "struct" ":" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_convert_out'."
      "  Prototype:\n"
      "    CONVERT_OUT(self,{SX})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_convert_out__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  casadi::SXDict *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::map< std::string,casadi::Matrix< casadi::SXElem > > m2 ;
  mxArray * _out;
  std::vector< casadi::SX,std::allocator< casadi::SX > > result;
  
  if (!SWIG_check_num_args("Function_convert_out",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_convert_out" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "struct" ":" "SX" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->convert_out((casadi::SXDict const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "SX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_convert_out'."
      "  Prototype:\n"
      "    CONVERT_OUT(self,struct:SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_convert_in__SWIG_4(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  std::vector< casadi::MX,std::allocator< casadi::MX > > *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< casadi::MX > m2 ;
  mxArray * _out;
  casadi::MXDict result;
  
  if (!SWIG_check_num_args("Function_convert_in",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_convert_in" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "MX" "}" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->convert_in((std::vector< casadi::MX,std::allocator< casadi::MX > > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "struct" ":" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_convert_in'."
      "  Prototype:\n"
      "    CONVERT_IN(self,{MX})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_convert_in__SWIG_5(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  casadi::MXDict *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::map< std::string,casadi::MX > m2 ;
  mxArray * _out;
  std::vector< casadi::MX,std::allocator< casadi::MX > > result;
  
  if (!SWIG_check_num_args("Function_convert_in",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_convert_in" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "struct" ":" "MX" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->convert_in((casadi::MXDict const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "MX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_convert_in'."
      "  Prototype:\n"
      "    CONVERT_IN(self,struct:MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_convert_in(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::map<std::string,casadi::Matrix<double> > **>(0));
      if (_v) {
        return _wrap_Function_convert_in__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector< casadi::Matrix<double> > **>(0));
      if (_v) {
        return _wrap_Function_convert_in__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector< casadi::Matrix<casadi::SXElem> > **>(0));
      if (_v) {
        return _wrap_Function_convert_in__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::map<std::string,casadi::Matrix<casadi::SXElem> > **>(0));
      if (_v) {
        return _wrap_Function_convert_in__SWIG_3(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::map<std::string,casadi::MX> **>(0));
      if (_v) {
        return _wrap_Function_convert_in__SWIG_5(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<casadi::MX> **>(0));
      if (_v) {
        return _wrap_Function_convert_in__SWIG_4(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_convert_in'."
    "  Possible prototypes are:\n"
    "    CONVERT_IN(self,struct:DM)\n"
    "    CONVERT_IN(self,{DM})\n"
    "    CONVERT_IN(self,{SX})\n"
    "    CONVERT_IN(self,struct:SX)\n"
    "    CONVERT_IN(self,struct:MX)\n"
    "    CONVERT_IN(self,{MX})\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_Function_convert_out__SWIG_4(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  std::vector< casadi::MX,std::allocator< casadi::MX > > *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< casadi::MX > m2 ;
  mxArray * _out;
  casadi::MXDict result;
  
  if (!SWIG_check_num_args("Function_convert_out",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_convert_out" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "MX" "}" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->convert_out((std::vector< casadi::MX,std::allocator< casadi::MX > > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "struct" ":" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_convert_out'."
      "  Prototype:\n"
      "    CONVERT_OUT(self,{MX})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_convert_out__SWIG_5(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  casadi::MXDict *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::map< std::string,casadi::MX > m2 ;
  mxArray * _out;
  std::vector< casadi::MX,std::allocator< casadi::MX > > result;
  
  if (!SWIG_check_num_args("Function_convert_out",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_convert_out" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "struct" ":" "MX" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->convert_out((casadi::MXDict const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "MX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_convert_out'."
      "  Prototype:\n"
      "    CONVERT_OUT(self,struct:MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_convert_out(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::map<std::string,casadi::Matrix<double> > **>(0));
      if (_v) {
        return _wrap_Function_convert_out__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector< casadi::Matrix<double> > **>(0));
      if (_v) {
        return _wrap_Function_convert_out__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector< casadi::Matrix<casadi::SXElem> > **>(0));
      if (_v) {
        return _wrap_Function_convert_out__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::map<std::string,casadi::Matrix<casadi::SXElem> > **>(0));
      if (_v) {
        return _wrap_Function_convert_out__SWIG_3(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::map<std::string,casadi::MX> **>(0));
      if (_v) {
        return _wrap_Function_convert_out__SWIG_5(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<casadi::MX> **>(0));
      if (_v) {
        return _wrap_Function_convert_out__SWIG_4(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_convert_out'."
    "  Possible prototypes are:\n"
    "    CONVERT_OUT(self,struct:DM)\n"
    "    CONVERT_OUT(self,{DM})\n"
    "    CONVERT_OUT(self,{SX})\n"
    "    CONVERT_OUT(self,struct:SX)\n"
    "    CONVERT_OUT(self,struct:MX)\n"
    "    CONVERT_OUT(self,{MX})\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_Function_has_free(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("Function_has_free",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_has_free" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Function const *)arg1)->has_free();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_has_free'."
      "  Prototype:\n"
      "    HAS_FREE(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_get_free(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< std::string,std::allocator< std::string > > result;
  
  if (!SWIG_check_num_args("Function_get_free",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_get_free" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->get_free();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "char" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_get_free'."
      "  Prototype:\n"
      "    GET_FREE(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_free_sx(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi::SX,std::allocator< casadi::SX > > result;
  
  if (!SWIG_check_num_args("Function_free_sx",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_free_sx" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->free_sx();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "SX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_free_sx'."
      "  Prototype:\n"
      "    FREE_SX(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_free_mx(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi::MX,std::allocator< casadi::MX > > result;
  
  if (!SWIG_check_num_args("Function_free_mx",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_free_mx" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->free_mx();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "MX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_free_mx'."
      "  Prototype:\n"
      "    FREE_MX(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_generate_lifted(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  casadi::Function *arg2 = 0 ;
  casadi::Function *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Function m2 ;
  casadi::Function m3 ;
  mxArray * _out;
  
  arg2 = &m2;
  arg3 = &m3;
  if (!SWIG_check_num_args("Function_generate_lifted",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_generate_lifted" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Function const *)arg1)->generate_lifted(*arg2,*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg3);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_generate_lifted'."
      "  Prototype:\n"
      "    GENERATE_LIFTED(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_n_nodes(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("Function_n_nodes",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_n_nodes" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::Function const *)arg1)->n_nodes();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_n_nodes'."
      "  Prototype:\n"
      "    N_NODES(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_n_instructions(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("Function_n_instructions",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_n_instructions" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::Function const *)arg1)->n_instructions();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_n_instructions'."
      "  Prototype:\n"
      "    N_INSTRUCTIONS(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_instruction_id(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  casadi_int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("Function_instruction_id",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_instruction_id" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::Function const *)arg1)->instruction_id(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_instruction_id'."
      "  Prototype:\n"
      "    INSTRUCTION_ID(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_instruction_input(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  casadi_int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi_int,std::allocator< casadi_int > > result;
  
  if (!SWIG_check_num_args("Function_instruction_input",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_instruction_input" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->instruction_input(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[" "int" "]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_instruction_input'."
      "  Prototype:\n"
      "    INSTRUCTION_INPUT(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_instruction_constant(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  casadi_int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  double result;
  
  if (!SWIG_check_num_args("Function_instruction_constant",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_instruction_constant" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (double)((casadi::Function const *)arg1)->instruction_constant(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "double" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_instruction_constant'."
      "  Prototype:\n"
      "    INSTRUCTION_CONSTANT(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_instruction_output(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  casadi_int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi_int,std::allocator< casadi_int > > result;
  
  if (!SWIG_check_num_args("Function_instruction_output",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_instruction_output" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->instruction_output(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[" "int" "]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_instruction_output'."
      "  Prototype:\n"
      "    INSTRUCTION_OUTPUT(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_instruction_MX(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  casadi_int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("Function_instruction_MX",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_instruction_MX" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->instruction_MX(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_instruction_MX'."
      "  Prototype:\n"
      "    INSTRUCTION_MX(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_instructions_sx(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::SX result;
  
  if (!SWIG_check_num_args("Function_instructions_sx",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_instructions_sx" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->instructions_sx();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_instructions_sx'."
      "  Prototype:\n"
      "    INSTRUCTIONS_SX(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_has_spfwd(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("Function_has_spfwd",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_has_spfwd" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Function const *)arg1)->has_spfwd();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_has_spfwd'."
      "  Prototype:\n"
      "    HAS_SPFWD(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_has_sprev(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("Function_has_sprev",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_has_sprev" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Function const *)arg1)->has_sprev();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_has_sprev'."
      "  Prototype:\n"
      "    HAS_SPREV(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_sz_arg(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  size_t result;
  
  if (!SWIG_check_num_args("Function_sz_arg",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_sz_arg" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->sz_arg();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_From_size_t(static_cast< size_t >(result));
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_sz_arg'."
      "  Prototype:\n"
      "    SZ_ARG(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_sz_res(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  size_t result;
  
  if (!SWIG_check_num_args("Function_sz_res",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_sz_res" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->sz_res();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_From_size_t(static_cast< size_t >(result));
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_sz_res'."
      "  Prototype:\n"
      "    SZ_RES(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_sz_iw(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  size_t result;
  
  if (!SWIG_check_num_args("Function_sz_iw",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_sz_iw" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->sz_iw();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_From_size_t(static_cast< size_t >(result));
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_sz_iw'."
      "  Prototype:\n"
      "    SZ_IW(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_sz_w(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  size_t result;
  
  if (!SWIG_check_num_args("Function_sz_w",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_sz_w" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->sz_w();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_From_size_t(static_cast< size_t >(result));
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_sz_w'."
      "  Prototype:\n"
      "    SZ_W(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_name(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::string *result = 0 ;
  
  if (!SWIG_check_num_args("Function_name",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_name" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (std::string *) &((casadi::Function const *)arg1)->name();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ptr(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_name'."
      "  Prototype:\n"
      "    NAME(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_is_a(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  std::string *arg2 = 0 ;
  bool arg3 = (bool) true ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("Function_is_a",argc,3,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_is_a" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Function const *)arg1)->is_a((std::string const &)*arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_is_a'."
      "  Prototype:\n"
      "    IS_A(self,char,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_check_name(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string m1 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("Function_check_name",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  {
    try {
      result = (bool)casadi::Function::check_name((std::string const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_check_name'."
      "  Prototype:\n"
      "    CHECK_NAME(char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_fix_name(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string m1 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("Function_fix_name",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  {
    try {
      result = casadi::Function::fix_name((std::string const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_fix_name'."
      "  Prototype:\n"
      "    FIX_NAME(char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_deserialize__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::istream *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("Function_deserialize",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_std__istream,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_deserialize" "', argument " "1"" of type '" "std::istream &""'"); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Function_deserialize" "', argument " "1"" of type '" "std::istream &""'"); 
  }
  arg1 = reinterpret_cast< std::istream * >(argp1);
  {
    try {
      result = casadi::Function::deserialize(*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_deserialize'."
      "  Prototype:\n"
      "    DESERIALIZE(std::istream &)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_deserialize__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string m1 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("Function_deserialize",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  {
    try {
      result = casadi::Function::deserialize((std::string const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_deserialize'."
      "  Prototype:\n"
      "    DESERIALIZE(char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_load(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string m1 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("Function_load",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  {
    try {
      result = casadi::Function::load((std::string const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_load'."
      "  Prototype:\n"
      "    LOAD(char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_deserialize__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DeserializingStream *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("Function_deserialize",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_casadi__DeserializingStream,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_deserialize" "', argument " "1"" of type '" "casadi::DeserializingStream &""'"); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Function_deserialize" "', argument " "1"" of type '" "casadi::DeserializingStream &""'"); 
  }
  arg1 = reinterpret_cast< casadi::DeserializingStream * >(argp1);
  {
    try {
      result = casadi::Function::deserialize(*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_deserialize'."
      "  Prototype:\n"
      "    DESERIALIZE(casadi::DeserializingStream &)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_deserialize(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_std__istream, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_Function_deserialize__SWIG_0(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__DeserializingStream, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_Function_deserialize__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::string **>(0));
    if (_v) {
      return _wrap_Function_deserialize__SWIG_1(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_deserialize'."
    "  Possible prototypes are:\n"
    "    DESERIALIZE(std::istream &)\n"
    "    DESERIALIZE(casadi::DeserializingStream &)\n"
    "    DESERIALIZE(char)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_Function_assert_size_in(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  casadi_int arg2 ;
  casadi_int arg3 ;
  casadi_int arg4 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("Function_assert_size_in",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_assert_size_in" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  if (!casadi::to_val(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Function const *)arg1)->assert_size_in(arg2,arg3,arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_assert_size_in'."
      "  Prototype:\n"
      "    ASSERT_SIZE_IN(self,int,int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_assert_size_out(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  casadi_int arg2 ;
  casadi_int arg3 ;
  casadi_int arg4 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("Function_assert_size_out",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_assert_size_out" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  if (!casadi::to_val(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Function const *)arg1)->assert_size_out(arg2,arg3,arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_assert_size_out'."
      "  Prototype:\n"
      "    ASSERT_SIZE_OUT(self,int,int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_assert_sparsity_out(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  casadi_int arg2 ;
  casadi::Sparsity *arg3 = 0 ;
  casadi_int arg4 = (casadi_int) 1 ;
  bool arg5 = (bool) true ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Sparsity m3 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("Function_assert_sparsity_out",argc,5,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_assert_sparsity_out" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "Sparsity" "'.");
  if (3<argc) {
    if (!casadi::to_val(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "int" "'.");
  }
  if (4<argc) {
    if (!casadi::to_val(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Function const *)arg1)->assert_sparsity_out(arg2,(casadi::Sparsity const &)*arg3,arg4,arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_assert_sparsity_out'."
      "  Prototype:\n"
      "    ASSERT_SPARSITY_OUT(self,int,Sparsity,int,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_checkout(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("Function_checkout",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_checkout" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::Function const *)arg1)->checkout();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_checkout'."
      "  Prototype:\n"
      "    CHECKOUT(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_release(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("Function_release",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_release" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Function_release" "', argument " "2"" of type '" "int""'");
  } 
  arg2 = static_cast< int >(val2);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Function const *)arg1)->release(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_release'."
      "  Prototype:\n"
      "    RELEASE(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_cache(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Dict result;
  
  if (!SWIG_check_num_args("Function_cache",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_cache" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->cache();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "struct" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_cache'."
      "  Prototype:\n"
      "    CACHE(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_get_function__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< std::string,std::allocator< std::string > > result;
  
  if (!SWIG_check_num_args("Function_get_function",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_get_function" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->get_function();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "char" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_get_function'."
      "  Prototype:\n"
      "    GET_FUNCTION(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_get_function__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("Function_get_function",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_get_function" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->get_function((std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_get_function'."
      "  Prototype:\n"
      "    GET_FUNCTION(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_get_function(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_Function_get_function__SWIG_0(resc,resv,argc,argv);
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Function, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        return _wrap_Function_get_function__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_get_function'."
    "  Possible prototypes are:\n"
    "    GET_FUNCTION(self)\n"
    "    GET_FUNCTION(self,char)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_Function_has_function(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("Function_has_function",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_has_function" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Function const *)arg1)->has_function((std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_has_function'."
      "  Prototype:\n"
      "    HAS_FUNCTION(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_find_functions(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  casadi_int arg2 = (casadi_int) -1 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi::Function,std::allocator< casadi::Function > > result;
  
  if (!SWIG_check_num_args("Function_find_functions",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_find_functions" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->find_functions(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "Function" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_find_functions'."
      "  Prototype:\n"
      "    FIND_FUNCTIONS(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_find_function(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  std::string *arg2 = 0 ;
  casadi_int arg3 = (casadi_int) -1 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("Function_find_function",argc,3,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_find_function" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->find_function((std::string const &)*arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_find_function'."
      "  Prototype:\n"
      "    FIND_FUNCTION(self,char,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Function_info(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = (casadi::Function *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Dict result;
  
  if (!SWIG_check_num_args("Function_info",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Function, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Function_info" "', argument " "1"" of type '" "casadi::Function const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Function * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Function const *)arg1)->info();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "struct" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Function_info'."
      "  Prototype:\n"
      "    INFO(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_Function__SWIG_8(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = 0 ;
  casadi::Function m1 ;
  mxArray * _out;
  casadi::Function *result = 0 ;
  
  if (!SWIG_check_num_args("new_Function",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Function" "'.");
  {
    result = (casadi::Function *)new casadi::Function((casadi::Function const &)*arg1);
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__Function, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_Function'."
      "  Prototype:\n"
      "    FUNCTION(Function)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_Function(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 0) {
    return _wrap_new_Function__SWIG_0(resc,resv,argc,argv);
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::string **>(0));
    if (_v) {
      return _wrap_new_Function__SWIG_1(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Function **>(0));
    if (_v) {
      return _wrap_new_Function__SWIG_8(resc,resv,argc,argv);
    }
  }
  if ((argc >= 3) && (argc <= 4)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::string **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector< casadi::Matrix<casadi::SXElem> > **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::vector< casadi::Matrix<casadi::SXElem> > **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_new_Function__SWIG_2(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< std::map<std::string,casadi::GenericType> **>(0));
          if (_v) {
            return _wrap_new_Function__SWIG_2(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if ((argc >= 3) && (argc <= 4)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::string **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<casadi::MX> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::vector<casadi::MX> **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_new_Function__SWIG_5(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< std::map<std::string,casadi::GenericType> **>(0));
          if (_v) {
            return _wrap_new_Function__SWIG_5(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if ((argc >= 4) && (argc <= 5)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::string **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::map<std::string,casadi::Matrix<casadi::SXElem> > **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::vector<std::string> **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< std::vector<std::string> **>(0));
          if (_v) {
            if (argc <= 4) {
              return _wrap_new_Function__SWIG_4(resc,resv,argc,argv);
            }
            _v = casadi::to_ptr(argv[4], static_cast< std::map<std::string,casadi::GenericType> **>(0));
            if (_v) {
              return _wrap_new_Function__SWIG_4(resc,resv,argc,argv);
            }
          }
        }
      }
    }
  }
  if ((argc >= 4) && (argc <= 5)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::string **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::map<std::string,casadi::MX> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::vector<std::string> **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< std::vector<std::string> **>(0));
          if (_v) {
            if (argc <= 4) {
              return _wrap_new_Function__SWIG_7(resc,resv,argc,argv);
            }
            _v = casadi::to_ptr(argv[4], static_cast< std::map<std::string,casadi::GenericType> **>(0));
            if (_v) {
              return _wrap_new_Function__SWIG_7(resc,resv,argc,argv);
            }
          }
        }
      }
    }
  }
  if ((argc >= 5) && (argc <= 6)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::string **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector< casadi::Matrix<casadi::SXElem> > **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::vector< casadi::Matrix<casadi::SXElem> > **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< std::vector<std::string> **>(0));
          if (_v) {
            _v = casadi::to_ptr(argv[4], static_cast< std::vector<std::string> **>(0));
            if (_v) {
              if (argc <= 5) {
                return _wrap_new_Function__SWIG_3(resc,resv,argc,argv);
              }
              _v = casadi::to_ptr(argv[5], static_cast< std::map<std::string,casadi::GenericType> **>(0));
              if (_v) {
                return _wrap_new_Function__SWIG_3(resc,resv,argc,argv);
              }
            }
          }
        }
      }
    }
  }
  if ((argc >= 5) && (argc <= 6)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::string **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<casadi::MX> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::vector<casadi::MX> **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< std::vector<std::string> **>(0));
          if (_v) {
            _v = casadi::to_ptr(argv[4], static_cast< std::vector<std::string> **>(0));
            if (_v) {
              if (argc <= 5) {
                return _wrap_new_Function__SWIG_6(resc,resv,argc,argv);
              }
              _v = casadi::to_ptr(argv[5], static_cast< std::map<std::string,casadi::GenericType> **>(0));
              if (_v) {
                return _wrap_new_Function__SWIG_6(resc,resv,argc,argv);
              }
            }
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_Function'."
    "  Possible prototypes are:\n"
    "    FUNCTION()\n"
    "    FUNCTION(char)\n"
    "    FUNCTION(Function)\n"
    "    FUNCTION(char,{SX},{SX},struct)\n"
    "    FUNCTION(char,{MX},{MX},struct)\n"
    "    FUNCTION(char,struct:SX,{char},{char},struct)\n"
    "    FUNCTION(char,struct:MX,{char},{char},struct)\n"
    "    FUNCTION(char,{SX},{SX},{char},{char},struct)\n"
    "    FUNCTION(char,{MX},{MX},{char},{char},struct)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_external__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  casadi::Dict const &arg2_defvalue = casadi::Dict() ;
  casadi::Dict *arg2 = (casadi::Dict *) &arg2_defvalue ;
  std::string m1 ;
  std::map< std::string,casadi::GenericType > m2 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("external",argc,2,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  if (1<argc) {
    arg2 = &m2;
    if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi::external((std::string const &)*arg1,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'external'."
      "  Prototype:\n"
      "    EXTERNAL(char,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_external__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  casadi::Dict const &arg3_defvalue = casadi::Dict() ;
  casadi::Dict *arg3 = (casadi::Dict *) &arg3_defvalue ;
  std::string m1 ;
  std::string m2 ;
  std::map< std::string,casadi::GenericType > m3 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("external",argc,3,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  if (2<argc) {
    arg3 = &m3;
    if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi::external((std::string const &)*arg1,(std::string const &)*arg2,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'external'."
      "  Prototype:\n"
      "    EXTERNAL(char,char,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_external__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  casadi::Importer *arg2 = 0 ;
  casadi::Dict const &arg3_defvalue = casadi::Dict() ;
  casadi::Dict *arg3 = (casadi::Dict *) &arg3_defvalue ;
  std::string m1 ;
  void *argp2 ;
  int res2 = 0 ;
  std::map< std::string,casadi::GenericType > m3 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("external",argc,3,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  res2 = SWIG_ConvertPtr(argv[1], &argp2, SWIGTYPE_p_casadi__Importer,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "external" "', argument " "2"" of type '" "casadi::Importer const &""'"); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "external" "', argument " "2"" of type '" "casadi::Importer const &""'"); 
  }
  arg2 = reinterpret_cast< casadi::Importer * >(argp2);
  if (2<argc) {
    arg3 = &m3;
    if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi::external((std::string const &)*arg1,(casadi::Importer const &)*arg2,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'external'."
      "  Prototype:\n"
      "    EXTERNAL(char,Importer,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_external(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 1) && (argc <= 2)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::string **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_external__SWIG_0(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< std::map<std::string,casadi::GenericType> **>(0));
      if (_v) {
        return _wrap_external__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  if ((argc >= 2) && (argc <= 3)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::string **>(0));
    if (_v) {
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_casadi__Importer, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        if (argc <= 2) {
          return _wrap_external__SWIG_2(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< std::map<std::string,casadi::GenericType> **>(0));
        if (_v) {
          return _wrap_external__SWIG_2(resc,resv,argc,argv);
        }
      }
    }
  }
  if ((argc >= 2) && (argc <= 3)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::string **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_external__SWIG_1(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< std::map<std::string,casadi::GenericType> **>(0));
        if (_v) {
          return _wrap_external__SWIG_1(resc,resv,argc,argv);
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'external'."
    "  Possible prototypes are:\n"
    "    EXTERNAL(char,struct)\n"
    "    EXTERNAL(char,Importer,struct)\n"
    "    EXTERNAL(char,char,struct)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_integrator__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  casadi::SXDict *arg3 = 0 ;
  casadi::Dict const &arg4_defvalue = casadi::Dict() ;
  casadi::Dict *arg4 = (casadi::Dict *) &arg4_defvalue ;
  std::string m1 ;
  std::string m2 ;
  std::map< std::string,casadi::Matrix< casadi::SXElem > > m3 ;
  std::map< std::string,casadi::GenericType > m4 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("integrator",argc,4,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "struct" ":" "SX" "'.");
  if (3<argc) {
    arg4 = &m4;
    if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi::integrator((std::string const &)*arg1,(std::string const &)*arg2,(std::map< std::string,casadi::Matrix< casadi::SXElem >,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::Matrix< casadi::SXElem > > > > const &)*arg3,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'integrator'."
      "  Prototype:\n"
      "    INTEGRATOR(char,char,struct:SX,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_integrator__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  casadi::MXDict *arg3 = 0 ;
  casadi::Dict const &arg4_defvalue = casadi::Dict() ;
  casadi::Dict *arg4 = (casadi::Dict *) &arg4_defvalue ;
  std::string m1 ;
  std::string m2 ;
  std::map< std::string,casadi::MX > m3 ;
  std::map< std::string,casadi::GenericType > m4 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("integrator",argc,4,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "struct" ":" "MX" "'.");
  if (3<argc) {
    arg4 = &m4;
    if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi::integrator((std::string const &)*arg1,(std::string const &)*arg2,(std::map< std::string,casadi::MX,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::MX > > > const &)*arg3,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'integrator'."
      "  Prototype:\n"
      "    INTEGRATOR(char,char,struct:MX,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_integrator__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  casadi::Function *arg3 = 0 ;
  casadi::Dict const &arg4_defvalue = casadi::Dict() ;
  casadi::Dict *arg4 = (casadi::Dict *) &arg4_defvalue ;
  std::string m1 ;
  std::string m2 ;
  casadi::Function m3 ;
  std::map< std::string,casadi::GenericType > m4 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("integrator",argc,4,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "Function" "'.");
  if (3<argc) {
    arg4 = &m4;
    if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi::integrator((std::string const &)*arg1,(std::string const &)*arg2,(casadi::Function const &)*arg3,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'integrator'."
      "  Prototype:\n"
      "    INTEGRATOR(char,char,Function,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_integrator__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  casadi::SXDict *arg3 = 0 ;
  double arg4 ;
  std::vector< double,std::allocator< double > > *arg5 = 0 ;
  casadi::Dict const &arg6_defvalue = casadi::Dict() ;
  casadi::Dict *arg6 = (casadi::Dict *) &arg6_defvalue ;
  std::string m1 ;
  std::string m2 ;
  std::map< std::string,casadi::Matrix< casadi::SXElem > > m3 ;
  std::vector< double > m5 ;
  std::map< std::string,casadi::GenericType > m6 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("integrator",argc,6,5,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "struct" ":" "SX" "'.");
  if (!casadi::to_val(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "double" "'.");
  arg5 = &m5;
  if (!casadi::to_ptr(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "[" "double" "]" "'.");
  if (5<argc) {
    arg6 = &m6;
    if (!casadi::to_ptr(argv[5], &arg6)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 6 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi::integrator((std::string const &)*arg1,(std::string const &)*arg2,(std::map< std::string,casadi::Matrix< casadi::SXElem >,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::Matrix< casadi::SXElem > > > > const &)*arg3,arg4,(std::vector< double,std::allocator< double > > const &)*arg5,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg6);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'integrator'."
      "  Prototype:\n"
      "    INTEGRATOR(char,char,struct:SX,double,[double],struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_integrator__SWIG_4(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  casadi::MXDict *arg3 = 0 ;
  double arg4 ;
  std::vector< double,std::allocator< double > > *arg5 = 0 ;
  casadi::Dict const &arg6_defvalue = casadi::Dict() ;
  casadi::Dict *arg6 = (casadi::Dict *) &arg6_defvalue ;
  std::string m1 ;
  std::string m2 ;
  std::map< std::string,casadi::MX > m3 ;
  std::vector< double > m5 ;
  std::map< std::string,casadi::GenericType > m6 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("integrator",argc,6,5,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "struct" ":" "MX" "'.");
  if (!casadi::to_val(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "double" "'.");
  arg5 = &m5;
  if (!casadi::to_ptr(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "[" "double" "]" "'.");
  if (5<argc) {
    arg6 = &m6;
    if (!casadi::to_ptr(argv[5], &arg6)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 6 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi::integrator((std::string const &)*arg1,(std::string const &)*arg2,(std::map< std::string,casadi::MX,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::MX > > > const &)*arg3,arg4,(std::vector< double,std::allocator< double > > const &)*arg5,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg6);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'integrator'."
      "  Prototype:\n"
      "    INTEGRATOR(char,char,struct:MX,double,[double],struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_integrator__SWIG_5(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  casadi::Function *arg3 = 0 ;
  double arg4 ;
  std::vector< double,std::allocator< double > > *arg5 = 0 ;
  casadi::Dict const &arg6_defvalue = casadi::Dict() ;
  casadi::Dict *arg6 = (casadi::Dict *) &arg6_defvalue ;
  std::string m1 ;
  std::string m2 ;
  casadi::Function m3 ;
  std::vector< double > m5 ;
  std::map< std::string,casadi::GenericType > m6 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("integrator",argc,6,5,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "Function" "'.");
  if (!casadi::to_val(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "double" "'.");
  arg5 = &m5;
  if (!casadi::to_ptr(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "[" "double" "]" "'.");
  if (5<argc) {
    arg6 = &m6;
    if (!casadi::to_ptr(argv[5], &arg6)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 6 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi::integrator((std::string const &)*arg1,(std::string const &)*arg2,(casadi::Function const &)*arg3,arg4,(std::vector< double,std::allocator< double > > const &)*arg5,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg6);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'integrator'."
      "  Prototype:\n"
      "    INTEGRATOR(char,char,Function,double,[double],struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_integrator(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 3) && (argc <= 4)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::string **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::map<std::string,casadi::Matrix<casadi::SXElem> > **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_integrator__SWIG_0(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< std::map<std::string,casadi::GenericType> **>(0));
          if (_v) {
            return _wrap_integrator__SWIG_0(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if ((argc >= 3) && (argc <= 4)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::string **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::map<std::string,casadi::MX> **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_integrator__SWIG_1(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< std::map<std::string,casadi::GenericType> **>(0));
          if (_v) {
            return _wrap_integrator__SWIG_1(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if ((argc >= 3) && (argc <= 4)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::string **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Function **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_integrator__SWIG_2(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< std::map<std::string,casadi::GenericType> **>(0));
          if (_v) {
            return _wrap_integrator__SWIG_2(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if ((argc >= 5) && (argc <= 6)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::string **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::map<std::string,casadi::Matrix<casadi::SXElem> > **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< double **>(0));
          if (_v) {
            _v = casadi::to_ptr(argv[4], static_cast< std::vector<double> **>(0));
            if (_v) {
              if (argc <= 5) {
                return _wrap_integrator__SWIG_3(resc,resv,argc,argv);
              }
              _v = casadi::to_ptr(argv[5], static_cast< std::map<std::string,casadi::GenericType> **>(0));
              if (_v) {
                return _wrap_integrator__SWIG_3(resc,resv,argc,argv);
              }
            }
          }
        }
      }
    }
  }
  if ((argc >= 5) && (argc <= 6)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::string **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::map<std::string,casadi::MX> **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< double **>(0));
          if (_v) {
            _v = casadi::to_ptr(argv[4], static_cast< std::vector<double> **>(0));
            if (_v) {
              if (argc <= 5) {
                return _wrap_integrator__SWIG_4(resc,resv,argc,argv);
              }
              _v = casadi::to_ptr(argv[5], static_cast< std::map<std::string,casadi::GenericType> **>(0));
              if (_v) {
                return _wrap_integrator__SWIG_4(resc,resv,argc,argv);
              }
            }
          }
        }
      }
    }
  }
  if ((argc >= 5) && (argc <= 6)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::string **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Function **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< double **>(0));
          if (_v) {
            _v = casadi::to_ptr(argv[4], static_cast< std::vector<double> **>(0));
            if (_v) {
              if (argc <= 5) {
                return _wrap_integrator__SWIG_5(resc,resv,argc,argv);
              }
              _v = casadi::to_ptr(argv[5], static_cast< std::map<std::string,casadi::GenericType> **>(0));
              if (_v) {
                return _wrap_integrator__SWIG_5(resc,resv,argc,argv);
              }
            }
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'integrator'."
    "  Possible prototypes are:\n"
    "    INTEGRATOR(char,char,struct:SX,struct)\n"
    "    INTEGRATOR(char,char,struct:MX,struct)\n"
    "    INTEGRATOR(char,char,Function,struct)\n"
    "    INTEGRATOR(char,char,struct:SX,double,[double],struct)\n"
    "    INTEGRATOR(char,char,struct:MX,double,[double],struct)\n"
    "    INTEGRATOR(char,char,Function,double,[double],struct)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_has_integrator(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string m1 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("has_integrator",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  {
    try {
      result = (bool)casadi::has_integrator((std::string const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'has_integrator'."
      "  Prototype:\n"
      "    HAS_INTEGRATOR(char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_load_integrator(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string m1 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("load_integrator",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  {
    try {
      casadi::load_integrator((std::string const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'load_integrator'."
      "  Prototype:\n"
      "    LOAD_INTEGRATOR(char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_doc_integrator(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string m1 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("doc_integrator",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  {
    try {
      result = casadi::doc_integrator((std::string const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'doc_integrator'."
      "  Prototype:\n"
      "    DOC_INTEGRATOR(char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_integrator_in__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  std::vector< std::string,std::allocator< std::string > > result;
  
  if (!SWIG_check_num_args("integrator_in",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      result = casadi::integrator_in();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "char" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'integrator_in'."
      "  Prototype:\n"
      "    INTEGRATOR_IN()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_integrator_out__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  std::vector< std::string,std::allocator< std::string > > result;
  
  if (!SWIG_check_num_args("integrator_out",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      result = casadi::integrator_out();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "char" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'integrator_out'."
      "  Prototype:\n"
      "    INTEGRATOR_OUT()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_integrator_in__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("integrator_in",argc,1,1,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  {
    try {
      result = casadi::integrator_in(arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'integrator_in'."
      "  Prototype:\n"
      "    INTEGRATOR_IN(int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_integrator_in(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 0) {
    return _wrap_integrator_in__SWIG_0(resc,resv,argc,argv);
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi_int **>(0));
    if (_v) {
      return _wrap_integrator_in__SWIG_1(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'integrator_in'."
    "  Possible prototypes are:\n"
    "    INTEGRATOR_IN()\n"
    "    INTEGRATOR_IN(int)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_integrator_out__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("integrator_out",argc,1,1,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  {
    try {
      result = casadi::integrator_out(arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'integrator_out'."
      "  Prototype:\n"
      "    INTEGRATOR_OUT(int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_integrator_out(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 0) {
    return _wrap_integrator_out__SWIG_0(resc,resv,argc,argv);
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi_int **>(0));
    if (_v) {
      return _wrap_integrator_out__SWIG_1(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'integrator_out'."
    "  Possible prototypes are:\n"
    "    INTEGRATOR_OUT()\n"
    "    INTEGRATOR_OUT(int)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_integrator_n_in(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("integrator_n_in",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      result = (casadi_int)casadi::integrator_n_in();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'integrator_n_in'."
      "  Prototype:\n"
      "    INTEGRATOR_N_IN()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_integrator_n_out(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("integrator_n_out",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      result = (casadi_int)casadi::integrator_n_out();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'integrator_n_out'."
      "  Prototype:\n"
      "    INTEGRATOR_N_OUT()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_dyn_in__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  std::vector< std::string,std::allocator< std::string > > result;
  
  if (!SWIG_check_num_args("dyn_in",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      result = casadi::dyn_in();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "char" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'dyn_in'."
      "  Prototype:\n"
      "    DYN_IN()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_dyn_out__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  std::vector< std::string,std::allocator< std::string > > result;
  
  if (!SWIG_check_num_args("dyn_out",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      result = casadi::dyn_out();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "char" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'dyn_out'."
      "  Prototype:\n"
      "    DYN_OUT()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_dyn_in__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("dyn_in",argc,1,1,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  {
    try {
      result = casadi::dyn_in(arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'dyn_in'."
      "  Prototype:\n"
      "    DYN_IN(int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_dyn_in(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 0) {
    return _wrap_dyn_in__SWIG_0(resc,resv,argc,argv);
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi_int **>(0));
    if (_v) {
      return _wrap_dyn_in__SWIG_1(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'dyn_in'."
    "  Possible prototypes are:\n"
    "    DYN_IN()\n"
    "    DYN_IN(int)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_dyn_out__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("dyn_out",argc,1,1,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  {
    try {
      result = casadi::dyn_out(arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'dyn_out'."
      "  Prototype:\n"
      "    DYN_OUT(int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_dyn_out(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 0) {
    return _wrap_dyn_out__SWIG_0(resc,resv,argc,argv);
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi_int **>(0));
    if (_v) {
      return _wrap_dyn_out__SWIG_1(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'dyn_out'."
    "  Possible prototypes are:\n"
    "    DYN_OUT()\n"
    "    DYN_OUT(int)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_dyn_n_in(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("dyn_n_in",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      result = (casadi_int)casadi::dyn_n_in();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'dyn_n_in'."
      "  Prototype:\n"
      "    DYN_N_IN()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_dyn_n_out(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("dyn_n_out",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      result = (casadi_int)casadi::dyn_n_out();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'dyn_n_out'."
      "  Prototype:\n"
      "    DYN_N_OUT()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_conic(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  casadi::SpDict *arg3 = 0 ;
  casadi::Dict const &arg4_defvalue = casadi::Dict() ;
  casadi::Dict *arg4 = (casadi::Dict *) &arg4_defvalue ;
  std::string m1 ;
  std::string m2 ;
  std::map< std::string,casadi::Sparsity > m3 ;
  std::map< std::string,casadi::GenericType > m4 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("conic",argc,4,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "struct" ":" "Sparsity" "'.");
  if (3<argc) {
    arg4 = &m4;
    if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi::conic((std::string const &)*arg1,(std::string const &)*arg2,(std::map< std::string,casadi::Sparsity,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::Sparsity > > > const &)*arg3,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'conic'."
      "  Prototype:\n"
      "    CONIC(char,char,struct:Sparsity,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_qpsol__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  casadi::SXDict *arg3 = 0 ;
  casadi::Dict const &arg4_defvalue = casadi::Dict() ;
  casadi::Dict *arg4 = (casadi::Dict *) &arg4_defvalue ;
  std::string m1 ;
  std::string m2 ;
  std::map< std::string,casadi::Matrix< casadi::SXElem > > m3 ;
  std::map< std::string,casadi::GenericType > m4 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("qpsol",argc,4,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "struct" ":" "SX" "'.");
  if (3<argc) {
    arg4 = &m4;
    if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi::qpsol((std::string const &)*arg1,(std::string const &)*arg2,(std::map< std::string,casadi::Matrix< casadi::SXElem >,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::Matrix< casadi::SXElem > > > > const &)*arg3,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'qpsol'."
      "  Prototype:\n"
      "    QPSOL(char,char,struct:SX,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_qpsol__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  casadi::MXDict *arg3 = 0 ;
  casadi::Dict const &arg4_defvalue = casadi::Dict() ;
  casadi::Dict *arg4 = (casadi::Dict *) &arg4_defvalue ;
  std::string m1 ;
  std::string m2 ;
  std::map< std::string,casadi::MX > m3 ;
  std::map< std::string,casadi::GenericType > m4 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("qpsol",argc,4,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "struct" ":" "MX" "'.");
  if (3<argc) {
    arg4 = &m4;
    if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi::qpsol((std::string const &)*arg1,(std::string const &)*arg2,(std::map< std::string,casadi::MX,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::MX > > > const &)*arg3,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'qpsol'."
      "  Prototype:\n"
      "    QPSOL(char,char,struct:MX,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_qpsol(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 3) && (argc <= 4)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::string **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::map<std::string,casadi::Matrix<casadi::SXElem> > **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_qpsol__SWIG_0(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< std::map<std::string,casadi::GenericType> **>(0));
          if (_v) {
            return _wrap_qpsol__SWIG_0(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if ((argc >= 3) && (argc <= 4)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::string **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::map<std::string,casadi::MX> **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_qpsol__SWIG_1(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< std::map<std::string,casadi::GenericType> **>(0));
          if (_v) {
            return _wrap_qpsol__SWIG_1(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'qpsol'."
    "  Possible prototypes are:\n"
    "    QPSOL(char,char,struct:SX,struct)\n"
    "    QPSOL(char,char,struct:MX,struct)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_conic_in__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  std::vector< std::string,std::allocator< std::string > > result;
  
  if (!SWIG_check_num_args("conic_in",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      result = casadi::conic_in();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "char" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'conic_in'."
      "  Prototype:\n"
      "    CONIC_IN()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_conic_out__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  std::vector< std::string,std::allocator< std::string > > result;
  
  if (!SWIG_check_num_args("conic_out",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      result = casadi::conic_out();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "char" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'conic_out'."
      "  Prototype:\n"
      "    CONIC_OUT()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_conic_in__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("conic_in",argc,1,1,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  {
    try {
      result = casadi::conic_in(arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'conic_in'."
      "  Prototype:\n"
      "    CONIC_IN(int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_conic_in(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 0) {
    return _wrap_conic_in__SWIG_0(resc,resv,argc,argv);
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi_int **>(0));
    if (_v) {
      return _wrap_conic_in__SWIG_1(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'conic_in'."
    "  Possible prototypes are:\n"
    "    CONIC_IN()\n"
    "    CONIC_IN(int)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_conic_out__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("conic_out",argc,1,1,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  {
    try {
      result = casadi::conic_out(arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'conic_out'."
      "  Prototype:\n"
      "    CONIC_OUT(int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_conic_out(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 0) {
    return _wrap_conic_out__SWIG_0(resc,resv,argc,argv);
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi_int **>(0));
    if (_v) {
      return _wrap_conic_out__SWIG_1(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'conic_out'."
    "  Possible prototypes are:\n"
    "    CONIC_OUT()\n"
    "    CONIC_OUT(int)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_conic_n_in(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("conic_n_in",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      result = (casadi_int)casadi::conic_n_in();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'conic_n_in'."
      "  Prototype:\n"
      "    CONIC_N_IN()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_conic_n_out(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("conic_n_out",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      result = (casadi_int)casadi::conic_n_out();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'conic_n_out'."
      "  Prototype:\n"
      "    CONIC_N_OUT()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_conic_options(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string m1 ;
  mxArray * _out;
  std::vector< std::string,std::allocator< std::string > > result;
  
  if (!SWIG_check_num_args("conic_options",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  {
    try {
      result = casadi::conic_options((std::string const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "char" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'conic_options'."
      "  Prototype:\n"
      "    CONIC_OPTIONS(char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_conic_option_type(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  std::string m1 ;
  std::string m2 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("conic_option_type",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  {
    try {
      result = casadi::conic_option_type((std::string const &)*arg1,(std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'conic_option_type'."
      "  Prototype:\n"
      "    CONIC_OPTION_TYPE(char,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_conic_option_info(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  std::string m1 ;
  std::string m2 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("conic_option_info",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  {
    try {
      result = casadi::conic_option_info((std::string const &)*arg1,(std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'conic_option_info'."
      "  Prototype:\n"
      "    CONIC_OPTION_INFO(char,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_has_conic(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string m1 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("has_conic",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  {
    try {
      result = (bool)casadi::has_conic((std::string const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'has_conic'."
      "  Prototype:\n"
      "    HAS_CONIC(char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_load_conic(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string m1 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("load_conic",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  {
    try {
      casadi::load_conic((std::string const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'load_conic'."
      "  Prototype:\n"
      "    LOAD_CONIC(char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_doc_conic(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string m1 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("doc_conic",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  {
    try {
      result = casadi::doc_conic((std::string const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'doc_conic'."
      "  Prototype:\n"
      "    DOC_CONIC(char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_conic_debug__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = 0 ;
  std::string *arg2 = 0 ;
  casadi::Function m1 ;
  std::string m2 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("conic_debug",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Function" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  {
    try {
      casadi::conic_debug((casadi::Function const &)*arg1,(std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'conic_debug'."
      "  Prototype:\n"
      "    CONIC_DEBUG(Function,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_conic_debug__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function *arg1 = 0 ;
  std::ostream *arg2 = 0 ;
  casadi::Function m1 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("conic_debug",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Function" "'.");
  res2 = SWIG_ConvertPtr(argv[1], &argp2, SWIGTYPE_p_std__ostream,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "conic_debug" "', argument " "2"" of type '" "std::ostream &""'"); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "conic_debug" "', argument " "2"" of type '" "std::ostream &""'"); 
  }
  arg2 = reinterpret_cast< std::ostream * >(argp2);
  {
    try {
      casadi::conic_debug((casadi::Function const &)*arg1,*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'conic_debug'."
      "  Prototype:\n"
      "    CONIC_DEBUG(Function,std::ostream &)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_conic_debug(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Function **>(0));
    if (_v) {
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_std__ostream, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap_conic_debug__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Function **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        return _wrap_conic_debug__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'conic_debug'."
    "  Possible prototypes are:\n"
    "    CONIC_DEBUG(Function,std::ostream &)\n"
    "    CONIC_DEBUG(Function,char)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_nlpsol__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  casadi::SXDict *arg3 = 0 ;
  casadi::Dict const &arg4_defvalue = casadi::Dict() ;
  casadi::Dict *arg4 = (casadi::Dict *) &arg4_defvalue ;
  std::string m1 ;
  std::string m2 ;
  std::map< std::string,casadi::Matrix< casadi::SXElem > > m3 ;
  std::map< std::string,casadi::GenericType > m4 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("nlpsol",argc,4,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "struct" ":" "SX" "'.");
  if (3<argc) {
    arg4 = &m4;
    if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi::nlpsol((std::string const &)*arg1,(std::string const &)*arg2,(std::map< std::string,casadi::Matrix< casadi::SXElem >,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::Matrix< casadi::SXElem > > > > const &)*arg3,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'nlpsol'."
      "  Prototype:\n"
      "    NLPSOL(char,char,struct:SX,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_nlpsol__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  casadi::MXDict *arg3 = 0 ;
  casadi::Dict const &arg4_defvalue = casadi::Dict() ;
  casadi::Dict *arg4 = (casadi::Dict *) &arg4_defvalue ;
  std::string m1 ;
  std::string m2 ;
  std::map< std::string,casadi::MX > m3 ;
  std::map< std::string,casadi::GenericType > m4 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("nlpsol",argc,4,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "struct" ":" "MX" "'.");
  if (3<argc) {
    arg4 = &m4;
    if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi::nlpsol((std::string const &)*arg1,(std::string const &)*arg2,(std::map< std::string,casadi::MX,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::MX > > > const &)*arg3,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'nlpsol'."
      "  Prototype:\n"
      "    NLPSOL(char,char,struct:MX,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_nlpsol__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  std::string *arg3 = 0 ;
  casadi::Dict const &arg4_defvalue = casadi::Dict() ;
  casadi::Dict *arg4 = (casadi::Dict *) &arg4_defvalue ;
  std::string m1 ;
  std::string m2 ;
  std::string m3 ;
  std::map< std::string,casadi::GenericType > m4 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("nlpsol",argc,4,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "char" "'.");
  if (3<argc) {
    arg4 = &m4;
    if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi::nlpsol((std::string const &)*arg1,(std::string const &)*arg2,(std::string const &)*arg3,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'nlpsol'."
      "  Prototype:\n"
      "    NLPSOL(char,char,char,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_nlpsol__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  casadi::Importer *arg3 = 0 ;
  casadi::Dict const &arg4_defvalue = casadi::Dict() ;
  casadi::Dict *arg4 = (casadi::Dict *) &arg4_defvalue ;
  std::string m1 ;
  std::string m2 ;
  void *argp3 ;
  int res3 = 0 ;
  std::map< std::string,casadi::GenericType > m4 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("nlpsol",argc,4,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  res3 = SWIG_ConvertPtr(argv[2], &argp3, SWIGTYPE_p_casadi__Importer,  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "nlpsol" "', argument " "3"" of type '" "casadi::Importer const &""'"); 
  }
  if (!argp3) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "nlpsol" "', argument " "3"" of type '" "casadi::Importer const &""'"); 
  }
  arg3 = reinterpret_cast< casadi::Importer * >(argp3);
  if (3<argc) {
    arg4 = &m4;
    if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi::nlpsol((std::string const &)*arg1,(std::string const &)*arg2,(casadi::Importer const &)*arg3,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'nlpsol'."
      "  Prototype:\n"
      "    NLPSOL(char,char,Importer,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_nlpsol__SWIG_4(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  casadi::NlpBuilder *arg3 = 0 ;
  casadi::Dict const &arg4_defvalue = casadi::Dict() ;
  casadi::Dict *arg4 = (casadi::Dict *) &arg4_defvalue ;
  std::string m1 ;
  std::string m2 ;
  void *argp3 ;
  int res3 = 0 ;
  std::map< std::string,casadi::GenericType > m4 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("nlpsol",argc,4,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  res3 = SWIG_ConvertPtr(argv[2], &argp3, SWIGTYPE_p_casadi__NlpBuilder,  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "nlpsol" "', argument " "3"" of type '" "casadi::NlpBuilder const &""'"); 
  }
  if (!argp3) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "nlpsol" "', argument " "3"" of type '" "casadi::NlpBuilder const &""'"); 
  }
  arg3 = reinterpret_cast< casadi::NlpBuilder * >(argp3);
  if (3<argc) {
    arg4 = &m4;
    if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi::nlpsol((std::string const &)*arg1,(std::string const &)*arg2,(casadi::NlpBuilder const &)*arg3,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'nlpsol'."
      "  Prototype:\n"
      "    NLPSOL(char,char,NlpBuilder,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_nlpsol__SWIG_5(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  casadi::Function *arg3 = 0 ;
  casadi::Dict const &arg4_defvalue = casadi::Dict() ;
  casadi::Dict *arg4 = (casadi::Dict *) &arg4_defvalue ;
  std::string m1 ;
  std::string m2 ;
  casadi::Function m3 ;
  std::map< std::string,casadi::GenericType > m4 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("nlpsol",argc,4,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "Function" "'.");
  if (3<argc) {
    arg4 = &m4;
    if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi::nlpsol((std::string const &)*arg1,(std::string const &)*arg2,(casadi::Function const &)*arg3,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'nlpsol'."
      "  Prototype:\n"
      "    NLPSOL(char,char,Function,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_nlpsol(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 3) && (argc <= 4)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::string **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        void *vptr = 0;
        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_casadi__Importer, 0);
        _v = SWIG_CheckState(res);
        if (_v) {
          if (argc <= 3) {
            return _wrap_nlpsol__SWIG_3(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< std::map<std::string,casadi::GenericType> **>(0));
          if (_v) {
            return _wrap_nlpsol__SWIG_3(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if ((argc >= 3) && (argc <= 4)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::string **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        void *vptr = 0;
        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_casadi__NlpBuilder, 0);
        _v = SWIG_CheckState(res);
        if (_v) {
          if (argc <= 3) {
            return _wrap_nlpsol__SWIG_4(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< std::map<std::string,casadi::GenericType> **>(0));
          if (_v) {
            return _wrap_nlpsol__SWIG_4(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if ((argc >= 3) && (argc <= 4)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::string **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::map<std::string,casadi::Matrix<casadi::SXElem> > **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_nlpsol__SWIG_0(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< std::map<std::string,casadi::GenericType> **>(0));
          if (_v) {
            return _wrap_nlpsol__SWIG_0(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if ((argc >= 3) && (argc <= 4)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::string **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::map<std::string,casadi::MX> **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_nlpsol__SWIG_1(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< std::map<std::string,casadi::GenericType> **>(0));
          if (_v) {
            return _wrap_nlpsol__SWIG_1(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if ((argc >= 3) && (argc <= 4)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::string **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::string **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_nlpsol__SWIG_2(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< std::map<std::string,casadi::GenericType> **>(0));
          if (_v) {
            return _wrap_nlpsol__SWIG_2(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if ((argc >= 3) && (argc <= 4)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::string **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Function **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_nlpsol__SWIG_5(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< std::map<std::string,casadi::GenericType> **>(0));
          if (_v) {
            return _wrap_nlpsol__SWIG_5(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'nlpsol'."
    "  Possible prototypes are:\n"
    "    NLPSOL(char,char,Importer,struct)\n"
    "    NLPSOL(char,char,NlpBuilder,struct)\n"
    "    NLPSOL(char,char,struct:SX,struct)\n"
    "    NLPSOL(char,char,struct:MX,struct)\n"
    "    NLPSOL(char,char,char,struct)\n"
    "    NLPSOL(char,char,Function,struct)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_nlpsol_in__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  std::vector< std::string,std::allocator< std::string > > result;
  
  if (!SWIG_check_num_args("nlpsol_in",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      result = casadi::nlpsol_in();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "char" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'nlpsol_in'."
      "  Prototype:\n"
      "    NLPSOL_IN()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_nlpsol_out__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  std::vector< std::string,std::allocator< std::string > > result;
  
  if (!SWIG_check_num_args("nlpsol_out",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      result = casadi::nlpsol_out();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "char" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'nlpsol_out'."
      "  Prototype:\n"
      "    NLPSOL_OUT()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_nlpsol_in__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("nlpsol_in",argc,1,1,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  {
    try {
      result = casadi::nlpsol_in(arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'nlpsol_in'."
      "  Prototype:\n"
      "    NLPSOL_IN(int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_nlpsol_in(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 0) {
    return _wrap_nlpsol_in__SWIG_0(resc,resv,argc,argv);
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi_int **>(0));
    if (_v) {
      return _wrap_nlpsol_in__SWIG_1(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'nlpsol_in'."
    "  Possible prototypes are:\n"
    "    NLPSOL_IN()\n"
    "    NLPSOL_IN(int)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_nlpsol_out__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("nlpsol_out",argc,1,1,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  {
    try {
      result = casadi::nlpsol_out(arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'nlpsol_out'."
      "  Prototype:\n"
      "    NLPSOL_OUT(int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_nlpsol_out(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 0) {
    return _wrap_nlpsol_out__SWIG_0(resc,resv,argc,argv);
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi_int **>(0));
    if (_v) {
      return _wrap_nlpsol_out__SWIG_1(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'nlpsol_out'."
    "  Possible prototypes are:\n"
    "    NLPSOL_OUT()\n"
    "    NLPSOL_OUT(int)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_nlpsol_n_in(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("nlpsol_n_in",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      result = (casadi_int)casadi::nlpsol_n_in();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'nlpsol_n_in'."
      "  Prototype:\n"
      "    NLPSOL_N_IN()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_nlpsol_n_out(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("nlpsol_n_out",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      result = (casadi_int)casadi::nlpsol_n_out();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'nlpsol_n_out'."
      "  Prototype:\n"
      "    NLPSOL_N_OUT()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_nlpsol_default_in__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 ;
  mxArray * _out;
  double result;
  
  if (!SWIG_check_num_args("nlpsol_default_in",argc,1,1,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  {
    try {
      result = (double)casadi::nlpsol_default_in(arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "double" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'nlpsol_default_in'."
      "  Prototype:\n"
      "    NLPSOL_DEFAULT_IN(int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_nlpsol_default_in__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  std::vector< double,std::allocator< double > > result;
  
  if (!SWIG_check_num_args("nlpsol_default_in",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      result = casadi::nlpsol_default_in();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[" "double" "]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'nlpsol_default_in'."
      "  Prototype:\n"
      "    NLPSOL_DEFAULT_IN()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_nlpsol_default_in(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 0) {
    return _wrap_nlpsol_default_in__SWIG_1(resc,resv,argc,argv);
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi_int **>(0));
    if (_v) {
      return _wrap_nlpsol_default_in__SWIG_0(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'nlpsol_default_in'."
    "  Possible prototypes are:\n"
    "    NLPSOL_DEFAULT_IN()\n"
    "    NLPSOL_DEFAULT_IN(int)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_nlpsol_options(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string m1 ;
  mxArray * _out;
  std::vector< std::string,std::allocator< std::string > > result;
  
  if (!SWIG_check_num_args("nlpsol_options",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  {
    try {
      result = casadi::nlpsol_options((std::string const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "char" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'nlpsol_options'."
      "  Prototype:\n"
      "    NLPSOL_OPTIONS(char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_nlpsol_option_type(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  std::string m1 ;
  std::string m2 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("nlpsol_option_type",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  {
    try {
      result = casadi::nlpsol_option_type((std::string const &)*arg1,(std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'nlpsol_option_type'."
      "  Prototype:\n"
      "    NLPSOL_OPTION_TYPE(char,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_nlpsol_option_info(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  std::string m1 ;
  std::string m2 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("nlpsol_option_info",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  {
    try {
      result = casadi::nlpsol_option_info((std::string const &)*arg1,(std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'nlpsol_option_info'."
      "  Prototype:\n"
      "    NLPSOL_OPTION_INFO(char,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_has_nlpsol(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string m1 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("has_nlpsol",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  {
    try {
      result = (bool)casadi::has_nlpsol((std::string const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'has_nlpsol'."
      "  Prototype:\n"
      "    HAS_NLPSOL(char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_load_nlpsol(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string m1 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("load_nlpsol",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  {
    try {
      casadi::load_nlpsol((std::string const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'load_nlpsol'."
      "  Prototype:\n"
      "    LOAD_NLPSOL(char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_doc_nlpsol(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string m1 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("doc_nlpsol",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  {
    try {
      result = casadi::doc_nlpsol((std::string const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'doc_nlpsol'."
      "  Prototype:\n"
      "    DOC_NLPSOL(char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_rootfinder__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  casadi::SXDict *arg3 = 0 ;
  casadi::Dict const &arg4_defvalue = casadi::Dict() ;
  casadi::Dict *arg4 = (casadi::Dict *) &arg4_defvalue ;
  std::string m1 ;
  std::string m2 ;
  std::map< std::string,casadi::Matrix< casadi::SXElem > > m3 ;
  std::map< std::string,casadi::GenericType > m4 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("rootfinder",argc,4,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "struct" ":" "SX" "'.");
  if (3<argc) {
    arg4 = &m4;
    if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi::rootfinder((std::string const &)*arg1,(std::string const &)*arg2,(std::map< std::string,casadi::Matrix< casadi::SXElem >,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::Matrix< casadi::SXElem > > > > const &)*arg3,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'rootfinder'."
      "  Prototype:\n"
      "    ROOTFINDER(char,char,struct:SX,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_rootfinder__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  casadi::MXDict *arg3 = 0 ;
  casadi::Dict const &arg4_defvalue = casadi::Dict() ;
  casadi::Dict *arg4 = (casadi::Dict *) &arg4_defvalue ;
  std::string m1 ;
  std::string m2 ;
  std::map< std::string,casadi::MX > m3 ;
  std::map< std::string,casadi::GenericType > m4 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("rootfinder",argc,4,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "struct" ":" "MX" "'.");
  if (3<argc) {
    arg4 = &m4;
    if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi::rootfinder((std::string const &)*arg1,(std::string const &)*arg2,(std::map< std::string,casadi::MX,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::MX > > > const &)*arg3,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'rootfinder'."
      "  Prototype:\n"
      "    ROOTFINDER(char,char,struct:MX,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_rootfinder__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  casadi::Function *arg3 = 0 ;
  casadi::Dict const &arg4_defvalue = casadi::Dict() ;
  casadi::Dict *arg4 = (casadi::Dict *) &arg4_defvalue ;
  std::string m1 ;
  std::string m2 ;
  casadi::Function m3 ;
  std::map< std::string,casadi::GenericType > m4 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("rootfinder",argc,4,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "Function" "'.");
  if (3<argc) {
    arg4 = &m4;
    if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi::rootfinder((std::string const &)*arg1,(std::string const &)*arg2,(casadi::Function const &)*arg3,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'rootfinder'."
      "  Prototype:\n"
      "    ROOTFINDER(char,char,Function,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_rootfinder(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 3) && (argc <= 4)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::string **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::map<std::string,casadi::Matrix<casadi::SXElem> > **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_rootfinder__SWIG_0(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< std::map<std::string,casadi::GenericType> **>(0));
          if (_v) {
            return _wrap_rootfinder__SWIG_0(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if ((argc >= 3) && (argc <= 4)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::string **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::map<std::string,casadi::MX> **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_rootfinder__SWIG_1(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< std::map<std::string,casadi::GenericType> **>(0));
          if (_v) {
            return _wrap_rootfinder__SWIG_1(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if ((argc >= 3) && (argc <= 4)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::string **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Function **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_rootfinder__SWIG_2(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< std::map<std::string,casadi::GenericType> **>(0));
          if (_v) {
            return _wrap_rootfinder__SWIG_2(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'rootfinder'."
    "  Possible prototypes are:\n"
    "    ROOTFINDER(char,char,struct:SX,struct)\n"
    "    ROOTFINDER(char,char,struct:MX,struct)\n"
    "    ROOTFINDER(char,char,Function,struct)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_rootfinder_in__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  std::vector< std::string,std::allocator< std::string > > result;
  
  if (!SWIG_check_num_args("rootfinder_in",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      result = casadi::rootfinder_in();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "char" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'rootfinder_in'."
      "  Prototype:\n"
      "    ROOTFINDER_IN()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_rootfinder_out__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  std::vector< std::string,std::allocator< std::string > > result;
  
  if (!SWIG_check_num_args("rootfinder_out",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      result = casadi::rootfinder_out();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "char" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'rootfinder_out'."
      "  Prototype:\n"
      "    ROOTFINDER_OUT()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_rootfinder_in__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("rootfinder_in",argc,1,1,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  {
    try {
      result = casadi::rootfinder_in(arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'rootfinder_in'."
      "  Prototype:\n"
      "    ROOTFINDER_IN(int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_rootfinder_in(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 0) {
    return _wrap_rootfinder_in__SWIG_0(resc,resv,argc,argv);
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi_int **>(0));
    if (_v) {
      return _wrap_rootfinder_in__SWIG_1(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'rootfinder_in'."
    "  Possible prototypes are:\n"
    "    ROOTFINDER_IN()\n"
    "    ROOTFINDER_IN(int)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_rootfinder_out__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("rootfinder_out",argc,1,1,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  {
    try {
      result = casadi::rootfinder_out(arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'rootfinder_out'."
      "  Prototype:\n"
      "    ROOTFINDER_OUT(int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_rootfinder_out(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 0) {
    return _wrap_rootfinder_out__SWIG_0(resc,resv,argc,argv);
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi_int **>(0));
    if (_v) {
      return _wrap_rootfinder_out__SWIG_1(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'rootfinder_out'."
    "  Possible prototypes are:\n"
    "    ROOTFINDER_OUT()\n"
    "    ROOTFINDER_OUT(int)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_rootfinder_n_in(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("rootfinder_n_in",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      result = (casadi_int)casadi::rootfinder_n_in();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'rootfinder_n_in'."
      "  Prototype:\n"
      "    ROOTFINDER_N_IN()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_rootfinder_n_out(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("rootfinder_n_out",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      result = (casadi_int)casadi::rootfinder_n_out();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'rootfinder_n_out'."
      "  Prototype:\n"
      "    ROOTFINDER_N_OUT()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_rootfinder_options(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string m1 ;
  mxArray * _out;
  std::vector< std::string,std::allocator< std::string > > result;
  
  if (!SWIG_check_num_args("rootfinder_options",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  {
    try {
      result = casadi::rootfinder_options((std::string const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "char" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'rootfinder_options'."
      "  Prototype:\n"
      "    ROOTFINDER_OPTIONS(char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_rootfinder_option_type(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  std::string m1 ;
  std::string m2 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("rootfinder_option_type",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  {
    try {
      result = casadi::rootfinder_option_type((std::string const &)*arg1,(std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'rootfinder_option_type'."
      "  Prototype:\n"
      "    ROOTFINDER_OPTION_TYPE(char,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_rootfinder_option_info(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  std::string m1 ;
  std::string m2 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("rootfinder_option_info",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  {
    try {
      result = casadi::rootfinder_option_info((std::string const &)*arg1,(std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'rootfinder_option_info'."
      "  Prototype:\n"
      "    ROOTFINDER_OPTION_INFO(char,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_has_rootfinder(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string m1 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("has_rootfinder",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  {
    try {
      result = (bool)casadi::has_rootfinder((std::string const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'has_rootfinder'."
      "  Prototype:\n"
      "    HAS_ROOTFINDER(char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_load_rootfinder(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string m1 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("load_rootfinder",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  {
    try {
      casadi::load_rootfinder((std::string const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'load_rootfinder'."
      "  Prototype:\n"
      "    LOAD_ROOTFINDER(char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_doc_rootfinder(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string m1 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("doc_rootfinder",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  {
    try {
      result = casadi::doc_rootfinder((std::string const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'doc_rootfinder'."
      "  Prototype:\n"
      "    DOC_ROOTFINDER(char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Linsol_type_name(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("Linsol_type_name",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      result = casadi::Linsol::type_name();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Linsol_type_name'."
      "  Prototype:\n"
      "    TYPE_NAME()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_Linsol__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  casadi::Linsol *result = 0 ;
  
  if (!SWIG_check_num_args("new_Linsol",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      result = (casadi::Linsol *)new casadi::Linsol();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__Linsol, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_Linsol'."
      "  Prototype:\n"
      "    LINSOL()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_Linsol__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  casadi::Sparsity *arg3 = 0 ;
  casadi::Dict const &arg4_defvalue = casadi::Dict() ;
  casadi::Dict *arg4 = (casadi::Dict *) &arg4_defvalue ;
  std::string m1 ;
  std::string m2 ;
  casadi::Sparsity m3 ;
  std::map< std::string,casadi::GenericType > m4 ;
  mxArray * _out;
  casadi::Linsol *result = 0 ;
  
  if (!SWIG_check_num_args("new_Linsol",argc,4,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "Sparsity" "'.");
  if (3<argc) {
    arg4 = &m4;
    if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "struct" "'.");
  }
  {
    try {
      result = (casadi::Linsol *)new casadi::Linsol((std::string const &)*arg1,(std::string const &)*arg2,(casadi::Sparsity const &)*arg3,(casadi::Dict const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__Linsol, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_Linsol'."
      "  Prototype:\n"
      "    LINSOL(char,char,Sparsity,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Linsol_has_plugin(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string m1 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("Linsol_has_plugin",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  {
    try {
      result = (bool)casadi::Linsol::has_plugin((std::string const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Linsol_has_plugin'."
      "  Prototype:\n"
      "    HAS_PLUGIN(char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Linsol_load_plugin(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string m1 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("Linsol_load_plugin",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  {
    try {
      casadi::Linsol::load_plugin((std::string const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Linsol_load_plugin'."
      "  Prototype:\n"
      "    LOAD_PLUGIN(char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Linsol_doc(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string m1 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("Linsol_doc",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  {
    try {
      result = casadi::Linsol::doc((std::string const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Linsol_doc'."
      "  Prototype:\n"
      "    DOC(char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Linsol_plugin_name(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Linsol *arg1 = (casadi::Linsol *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("Linsol_plugin_name",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Linsol, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Linsol_plugin_name" "', argument " "1"" of type '" "casadi::Linsol const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Linsol * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Linsol const *)arg1)->plugin_name();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Linsol_plugin_name'."
      "  Prototype:\n"
      "    PLUGIN_NAME(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Linsol_sparsity(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Linsol *arg1 = (casadi::Linsol *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Sparsity *result = 0 ;
  
  if (!SWIG_check_num_args("Linsol_sparsity",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Linsol, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Linsol_sparsity" "', argument " "1"" of type '" "casadi::Linsol const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Linsol * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi::Sparsity *) &((casadi::Linsol const *)arg1)->sparsity();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ptr(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Linsol_sparsity'."
      "  Prototype:\n"
      "    SPARSITY(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Linsol_sfact(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Linsol *arg1 = (casadi::Linsol *) 0 ;
  casadi::DM *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< double > m2 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("Linsol_sfact",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Linsol, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Linsol_sfact" "', argument " "1"" of type '" "casadi::Linsol const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Linsol * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Linsol const *)arg1)->sfact((casadi::DM const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Linsol_sfact'."
      "  Prototype:\n"
      "    SFACT(self,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Linsol_nfact(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Linsol *arg1 = (casadi::Linsol *) 0 ;
  casadi::DM *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< double > m2 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("Linsol_nfact",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Linsol, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Linsol_nfact" "', argument " "1"" of type '" "casadi::Linsol const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Linsol * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Linsol const *)arg1)->nfact((casadi::DM const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Linsol_nfact'."
      "  Prototype:\n"
      "    NFACT(self,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Linsol_solve__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Linsol *arg1 = (casadi::Linsol *) 0 ;
  casadi::DM *arg2 = 0 ;
  casadi::DM *arg3 = 0 ;
  bool arg4 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< double > m2 ;
  casadi::Matrix< double > m3 ;
  mxArray * _out;
  casadi::DM result;
  
  if (!SWIG_check_num_args("Linsol_solve",argc,4,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Linsol, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Linsol_solve" "', argument " "1"" of type '" "casadi::Linsol const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Linsol * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "DM" "'.");
  if (3<argc) {
    if (!casadi::to_val(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Linsol const *)arg1)->solve((casadi::DM const &)*arg2,(casadi::DM const &)*arg3,arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Linsol_solve'."
      "  Prototype:\n"
      "    SOLVE(self,DM,DM,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Linsol_solve__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Linsol *arg1 = (casadi::Linsol *) 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::MX *arg3 = 0 ;
  bool arg4 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  casadi::MX m3 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("Linsol_solve",argc,4,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Linsol, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Linsol_solve" "', argument " "1"" of type '" "casadi::Linsol const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Linsol * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "MX" "'.");
  if (3<argc) {
    if (!casadi::to_val(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Linsol const *)arg1)->solve((casadi::MX const &)*arg2,(casadi::MX const &)*arg3,arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Linsol_solve'."
      "  Prototype:\n"
      "    SOLVE(self,MX,MX,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Linsol_solve(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 3) && (argc <= 4)) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Linsol, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<double> **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_Linsol_solve__SWIG_0(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< bool **>(0));
          if (_v) {
            return _wrap_Linsol_solve__SWIG_0(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if ((argc >= 3) && (argc <= 4)) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Linsol, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::MX **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_Linsol_solve__SWIG_1(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< bool **>(0));
          if (_v) {
            return _wrap_Linsol_solve__SWIG_1(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Linsol_solve'."
    "  Possible prototypes are:\n"
    "    SOLVE(self,DM,DM,bool)\n"
    "    SOLVE(self,MX,MX,bool)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_Linsol_neig(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Linsol *arg1 = (casadi::Linsol *) 0 ;
  casadi::DM *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< double > m2 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("Linsol_neig",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Linsol, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Linsol_neig" "', argument " "1"" of type '" "casadi::Linsol const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Linsol * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::Linsol const *)arg1)->neig((casadi::DM const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Linsol_neig'."
      "  Prototype:\n"
      "    NEIG(self,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Linsol_rank(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Linsol *arg1 = (casadi::Linsol *) 0 ;
  casadi::DM *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< double > m2 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("Linsol_rank",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Linsol, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Linsol_rank" "', argument " "1"" of type '" "casadi::Linsol const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Linsol * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::Linsol const *)arg1)->rank((casadi::DM const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Linsol_rank'."
      "  Prototype:\n"
      "    RANK(self,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Linsol_stats(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Linsol *arg1 = (casadi::Linsol *) 0 ;
  int arg2 = (int) 1 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  mxArray * _out;
  casadi::Dict result;
  
  if (!SWIG_check_num_args("Linsol_stats",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Linsol, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Linsol_stats" "', argument " "1"" of type '" "casadi::Linsol const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Linsol * >(argp1);
  if (1<argc) {
    ecode2 = SWIG_AsVal_int(argv[1], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Linsol_stats" "', argument " "2"" of type '" "int""'");
    } 
    arg2 = static_cast< int >(val2);
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Linsol const *)arg1)->stats(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "struct" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Linsol_stats'."
      "  Prototype:\n"
      "    STATS(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_Linsol__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Linsol *arg1 = 0 ;
  void *argp1 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Linsol *result = 0 ;
  
  if (!SWIG_check_num_args("new_Linsol",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_casadi__Linsol,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_Linsol" "', argument " "1"" of type '" "casadi::Linsol const &""'"); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_Linsol" "', argument " "1"" of type '" "casadi::Linsol const &""'"); 
  }
  arg1 = reinterpret_cast< casadi::Linsol * >(argp1);
  {
    result = (casadi::Linsol *)new casadi::Linsol((casadi::Linsol const &)*arg1);
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__Linsol, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_Linsol'."
      "  Prototype:\n"
      "    LINSOL(Linsol)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_Linsol(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 0) {
    return _wrap_new_Linsol__SWIG_0(resc,resv,argc,argv);
  }
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Linsol, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_new_Linsol__SWIG_2(resc,resv,argc,argv);
    }
  }
  if ((argc >= 3) && (argc <= 4)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::string **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Sparsity **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_new_Linsol__SWIG_1(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< std::map<std::string,casadi::GenericType> **>(0));
          if (_v) {
            return _wrap_new_Linsol__SWIG_1(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_Linsol'."
    "  Possible prototypes are:\n"
    "    LINSOL()\n"
    "    LINSOL(Linsol)\n"
    "    LINSOL(char,char,Sparsity,struct)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_delete_Linsol(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Linsol *arg1 = (casadi::Linsol *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  int is_owned;
  if (!SWIG_check_num_args("delete_Linsol",argc,1,1,0)) {
    SWIG_fail;
  }
  is_owned = SWIG_Matlab_isOwned(argv[0]);
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Linsol, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Linsol" "', argument " "1"" of type '" "casadi::Linsol *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Linsol * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  if (is_owned) {
    {
      delete arg1;
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'delete_Linsol'."
      "  Prototype:\n"
      "    LINSOL(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_has_linsol(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string m1 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("has_linsol",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  {
    try {
      result = (bool)casadi::has_linsol((std::string const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'has_linsol'."
      "  Prototype:\n"
      "    HAS_LINSOL(char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_load_linsol(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string m1 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("load_linsol",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  {
    try {
      casadi::load_linsol((std::string const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'load_linsol'."
      "  Prototype:\n"
      "    LOAD_LINSOL(char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_doc_linsol(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string m1 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("doc_linsol",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  {
    try {
      result = casadi::doc_linsol((std::string const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'doc_linsol'."
      "  Prototype:\n"
      "    DOC_LINSOL(char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_dplesol__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  casadi::SpDict *arg3 = 0 ;
  casadi::Dict const &arg4_defvalue = casadi::Dict() ;
  casadi::Dict *arg4 = (casadi::Dict *) &arg4_defvalue ;
  std::string m1 ;
  std::string m2 ;
  std::map< std::string,casadi::Sparsity > m3 ;
  std::map< std::string,casadi::GenericType > m4 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("dplesol",argc,4,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "struct" ":" "Sparsity" "'.");
  if (3<argc) {
    arg4 = &m4;
    if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi::dplesol((std::string const &)*arg1,(std::string const &)*arg2,(std::map< std::string,casadi::Sparsity,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::Sparsity > > > const &)*arg3,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'dplesol'."
      "  Prototype:\n"
      "    DPLESOL(char,char,struct:Sparsity,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_dplesol__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  std::string *arg3 = 0 ;
  casadi::Dict const &arg4_defvalue = casadi::Dict() ;
  casadi::Dict *arg4 = (casadi::Dict *) &arg4_defvalue ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  std::string m3 ;
  std::map< std::string,casadi::GenericType > m4 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("dplesol",argc,4,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "char" "'.");
  if (3<argc) {
    arg4 = &m4;
    if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi::dplesol((casadi::MX const &)*arg1,(casadi::MX const &)*arg2,(std::string const &)*arg3,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'dplesol'."
      "  Prototype:\n"
      "    DPLESOL(MX,MX,char,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_dplesol__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MXVector *arg1 = 0 ;
  casadi::MXVector *arg2 = 0 ;
  std::string *arg3 = 0 ;
  casadi::Dict const &arg4_defvalue = casadi::Dict() ;
  casadi::Dict *arg4 = (casadi::Dict *) &arg4_defvalue ;
  std::vector< casadi::MX > m1 ;
  std::vector< casadi::MX > m2 ;
  std::string m3 ;
  std::map< std::string,casadi::GenericType > m4 ;
  mxArray * _out;
  casadi::MXVector result;
  
  if (!SWIG_check_num_args("dplesol",argc,4,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "{" "MX" "}" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "MX" "}" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "char" "'.");
  if (3<argc) {
    arg4 = &m4;
    if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi::dplesol((std::vector< casadi::MX,std::allocator< casadi::MX > > const &)*arg1,(std::vector< casadi::MX,std::allocator< casadi::MX > > const &)*arg2,(std::string const &)*arg3,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "MX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'dplesol'."
      "  Prototype:\n"
      "    DPLESOL({MX},{MX},char,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_dplesol__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DMVector *arg1 = 0 ;
  casadi::DMVector *arg2 = 0 ;
  std::string *arg3 = 0 ;
  casadi::Dict const &arg4_defvalue = casadi::Dict() ;
  casadi::Dict *arg4 = (casadi::Dict *) &arg4_defvalue ;
  std::vector< casadi::Matrix< double > > m1 ;
  std::vector< casadi::Matrix< double > > m2 ;
  std::string m3 ;
  std::map< std::string,casadi::GenericType > m4 ;
  mxArray * _out;
  casadi::DMVector result;
  
  if (!SWIG_check_num_args("dplesol",argc,4,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "{" "DM" "}" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "DM" "}" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "char" "'.");
  if (3<argc) {
    arg4 = &m4;
    if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi::dplesol((std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > const &)*arg1,(std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > const &)*arg2,(std::string const &)*arg3,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "DM" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'dplesol'."
      "  Prototype:\n"
      "    DPLESOL({DM},{DM},char,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_dplesol(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 3) && (argc <= 4)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::vector< casadi::Matrix<double> > **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector< casadi::Matrix<double> > **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::string **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_dplesol__SWIG_3(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< std::map<std::string,casadi::GenericType> **>(0));
          if (_v) {
            return _wrap_dplesol__SWIG_3(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if ((argc >= 3) && (argc <= 4)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::string **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_dplesol__SWIG_1(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< std::map<std::string,casadi::GenericType> **>(0));
          if (_v) {
            return _wrap_dplesol__SWIG_1(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if ((argc >= 3) && (argc <= 4)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::vector<casadi::MX> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<casadi::MX> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::string **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_dplesol__SWIG_2(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< std::map<std::string,casadi::GenericType> **>(0));
          if (_v) {
            return _wrap_dplesol__SWIG_2(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if ((argc >= 3) && (argc <= 4)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::string **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::map<std::string,casadi::Sparsity > **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_dplesol__SWIG_0(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< std::map<std::string,casadi::GenericType> **>(0));
          if (_v) {
            return _wrap_dplesol__SWIG_0(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'dplesol'."
    "  Possible prototypes are:\n"
    "    DPLESOL({DM},{DM},char,struct)\n"
    "    DPLESOL(MX,MX,char,struct)\n"
    "    DPLESOL({MX},{MX},char,struct)\n"
    "    DPLESOL(char,char,struct:Sparsity,struct)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_dple_in__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  std::vector< std::string,std::allocator< std::string > > result;
  
  if (!SWIG_check_num_args("dple_in",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      result = casadi::dple_in();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "char" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'dple_in'."
      "  Prototype:\n"
      "    DPLE_IN()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_dple_out__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  std::vector< std::string,std::allocator< std::string > > result;
  
  if (!SWIG_check_num_args("dple_out",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      result = casadi::dple_out();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "char" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'dple_out'."
      "  Prototype:\n"
      "    DPLE_OUT()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_dple_in__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("dple_in",argc,1,1,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  {
    try {
      result = casadi::dple_in(arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'dple_in'."
      "  Prototype:\n"
      "    DPLE_IN(int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_dple_in(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 0) {
    return _wrap_dple_in__SWIG_0(resc,resv,argc,argv);
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi_int **>(0));
    if (_v) {
      return _wrap_dple_in__SWIG_1(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'dple_in'."
    "  Possible prototypes are:\n"
    "    DPLE_IN()\n"
    "    DPLE_IN(int)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_dple_out__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("dple_out",argc,1,1,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  {
    try {
      result = casadi::dple_out(arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'dple_out'."
      "  Prototype:\n"
      "    DPLE_OUT(int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_dple_out(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 0) {
    return _wrap_dple_out__SWIG_0(resc,resv,argc,argv);
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi_int **>(0));
    if (_v) {
      return _wrap_dple_out__SWIG_1(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'dple_out'."
    "  Possible prototypes are:\n"
    "    DPLE_OUT()\n"
    "    DPLE_OUT(int)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_dple_n_in(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("dple_n_in",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      result = (casadi_int)casadi::dple_n_in();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'dple_n_in'."
      "  Prototype:\n"
      "    DPLE_N_IN()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_dple_n_out(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("dple_n_out",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      result = (casadi_int)casadi::dple_n_out();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'dple_n_out'."
      "  Prototype:\n"
      "    DPLE_N_OUT()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_has_dple(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string m1 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("has_dple",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  {
    try {
      result = (bool)casadi::has_dple((std::string const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'has_dple'."
      "  Prototype:\n"
      "    HAS_DPLE(char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_load_dple(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string m1 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("load_dple",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  {
    try {
      casadi::load_dple((std::string const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'load_dple'."
      "  Prototype:\n"
      "    LOAD_DPLE(char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_doc_dple(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string m1 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("doc_dple",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  {
    try {
      result = casadi::doc_dple((std::string const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'doc_dple'."
      "  Prototype:\n"
      "    DOC_DPLE(char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_expmsol(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  casadi::Sparsity *arg3 = 0 ;
  casadi::Dict const &arg4_defvalue = casadi::Dict() ;
  casadi::Dict *arg4 = (casadi::Dict *) &arg4_defvalue ;
  std::string m1 ;
  std::string m2 ;
  casadi::Sparsity m3 ;
  std::map< std::string,casadi::GenericType > m4 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("expmsol",argc,4,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "Sparsity" "'.");
  if (3<argc) {
    arg4 = &m4;
    if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi::expmsol((std::string const &)*arg1,(std::string const &)*arg2,(casadi::Sparsity const &)*arg3,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'expmsol'."
      "  Prototype:\n"
      "    EXPMSOL(char,char,Sparsity,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_expm_n_in(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("expm_n_in",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      result = (casadi_int)casadi::expm_n_in();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'expm_n_in'."
      "  Prototype:\n"
      "    EXPM_N_IN()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_expm_n_out(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("expm_n_out",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      result = (casadi_int)casadi::expm_n_out();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'expm_n_out'."
      "  Prototype:\n"
      "    EXPM_N_OUT()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_has_expm(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string m1 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("has_expm",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  {
    try {
      result = (bool)casadi::has_expm((std::string const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'has_expm'."
      "  Prototype:\n"
      "    HAS_EXPM(char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_load_expm(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string m1 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("load_expm",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  {
    try {
      casadi::load_expm((std::string const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'load_expm'."
      "  Prototype:\n"
      "    LOAD_EXPM(char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_doc_expm(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string m1 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("doc_expm",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  {
    try {
      result = casadi::doc_expm((std::string const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'doc_expm'."
      "  Prototype:\n"
      "    DOC_EXPM(char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_interpolant__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *arg3 = 0 ;
  std::vector< double,std::allocator< double > > *arg4 = 0 ;
  casadi::Dict const &arg5_defvalue = casadi::Dict() ;
  casadi::Dict *arg5 = (casadi::Dict *) &arg5_defvalue ;
  std::string m1 ;
  std::string m2 ;
  std::vector< std::vector< double > > m3 ;
  std::vector< double > m4 ;
  std::map< std::string,casadi::GenericType > m5 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("interpolant",argc,5,4,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "{" "[" "double" "]" "}" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "[" "double" "]" "'.");
  if (4<argc) {
    arg5 = &m5;
    if (!casadi::to_ptr(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi::interpolant((std::string const &)*arg1,(std::string const &)*arg2,(std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > const &)*arg3,(std::vector< double,std::allocator< double > > const &)*arg4,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'interpolant'."
      "  Prototype:\n"
      "    INTERPOLANT(char,char,{[double]},[double],struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_interpolant__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *arg3 = 0 ;
  casadi_int arg4 = (casadi_int) 1 ;
  casadi::Dict const &arg5_defvalue = casadi::Dict() ;
  casadi::Dict *arg5 = (casadi::Dict *) &arg5_defvalue ;
  std::string m1 ;
  std::string m2 ;
  std::vector< std::vector< double > > m3 ;
  std::map< std::string,casadi::GenericType > m5 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("interpolant",argc,5,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "{" "[" "double" "]" "}" "'.");
  if (3<argc) {
    if (!casadi::to_val(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "int" "'.");
  }
  if (4<argc) {
    arg5 = &m5;
    if (!casadi::to_ptr(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi::interpolant((std::string const &)*arg1,(std::string const &)*arg2,(std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > const &)*arg3,arg4,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'interpolant'."
      "  Prototype:\n"
      "    INTERPOLANT(char,char,{[double]},int,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_interpolant__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg3 = 0 ;
  casadi_int arg4 = (casadi_int) 1 ;
  casadi::Dict const &arg5_defvalue = casadi::Dict() ;
  casadi::Dict *arg5 = (casadi::Dict *) &arg5_defvalue ;
  std::string m1 ;
  std::string m2 ;
  std::vector< casadi_int > m3 ;
  std::map< std::string,casadi::GenericType > m5 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("interpolant",argc,5,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "[" "int" "]" "'.");
  if (3<argc) {
    if (!casadi::to_val(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "int" "'.");
  }
  if (4<argc) {
    arg5 = &m5;
    if (!casadi::to_ptr(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi::interpolant((std::string const &)*arg1,(std::string const &)*arg2,(std::vector< long long,std::allocator< long long > > const &)*arg3,arg4,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'interpolant'."
      "  Prototype:\n"
      "    INTERPOLANT(char,char,[int],int,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_interpolant__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg3 = 0 ;
  std::vector< double,std::allocator< double > > *arg4 = 0 ;
  casadi::Dict const &arg5_defvalue = casadi::Dict() ;
  casadi::Dict *arg5 = (casadi::Dict *) &arg5_defvalue ;
  std::string m1 ;
  std::string m2 ;
  std::vector< casadi_int > m3 ;
  std::vector< double > m4 ;
  std::map< std::string,casadi::GenericType > m5 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("interpolant",argc,5,4,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "[" "int" "]" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "[" "double" "]" "'.");
  if (4<argc) {
    arg5 = &m5;
    if (!casadi::to_ptr(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi::interpolant((std::string const &)*arg1,(std::string const &)*arg2,(std::vector< long long,std::allocator< long long > > const &)*arg3,(std::vector< double,std::allocator< double > > const &)*arg4,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'interpolant'."
      "  Prototype:\n"
      "    INTERPOLANT(char,char,[int],[double],struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_interpolant(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 3) && (argc <= 5)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::string **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::vector<std::vector<double> > **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_interpolant__SWIG_1(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< casadi_int **>(0));
          if (_v) {
            if (argc <= 4) {
              return _wrap_interpolant__SWIG_1(resc,resv,argc,argv);
            }
            _v = casadi::to_ptr(argv[4], static_cast< std::map<std::string,casadi::GenericType> **>(0));
            if (_v) {
              return _wrap_interpolant__SWIG_1(resc,resv,argc,argv);
            }
          }
        }
      }
    }
  }
  if ((argc >= 3) && (argc <= 5)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::string **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::vector<casadi_int> **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_interpolant__SWIG_2(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< casadi_int **>(0));
          if (_v) {
            if (argc <= 4) {
              return _wrap_interpolant__SWIG_2(resc,resv,argc,argv);
            }
            _v = casadi::to_ptr(argv[4], static_cast< std::map<std::string,casadi::GenericType> **>(0));
            if (_v) {
              return _wrap_interpolant__SWIG_2(resc,resv,argc,argv);
            }
          }
        }
      }
    }
  }
  if ((argc >= 4) && (argc <= 5)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::string **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::vector<std::vector<double> > **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< std::vector<double> **>(0));
          if (_v) {
            if (argc <= 4) {
              return _wrap_interpolant__SWIG_0(resc,resv,argc,argv);
            }
            _v = casadi::to_ptr(argv[4], static_cast< std::map<std::string,casadi::GenericType> **>(0));
            if (_v) {
              return _wrap_interpolant__SWIG_0(resc,resv,argc,argv);
            }
          }
        }
      }
    }
  }
  if ((argc >= 4) && (argc <= 5)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::string **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::vector<casadi_int> **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< std::vector<double> **>(0));
          if (_v) {
            if (argc <= 4) {
              return _wrap_interpolant__SWIG_3(resc,resv,argc,argv);
            }
            _v = casadi::to_ptr(argv[4], static_cast< std::map<std::string,casadi::GenericType> **>(0));
            if (_v) {
              return _wrap_interpolant__SWIG_3(resc,resv,argc,argv);
            }
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'interpolant'."
    "  Possible prototypes are:\n"
    "    INTERPOLANT(char,char,{[double]},int,struct)\n"
    "    INTERPOLANT(char,char,[int],int,struct)\n"
    "    INTERPOLANT(char,char,{[double]},[double],struct)\n"
    "    INTERPOLANT(char,char,[int],[double],struct)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_has_interpolant(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string m1 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("has_interpolant",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  {
    try {
      result = (bool)casadi::has_interpolant((std::string const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'has_interpolant'."
      "  Prototype:\n"
      "    HAS_INTERPOLANT(char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_load_interpolant(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string m1 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("load_interpolant",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  {
    try {
      casadi::load_interpolant((std::string const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'load_interpolant'."
      "  Prototype:\n"
      "    LOAD_INTERPOLANT(char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_doc_interpolant(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string m1 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("doc_interpolant",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  {
    try {
      result = casadi::doc_interpolant((std::string const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'doc_interpolant'."
      "  Prototype:\n"
      "    DOC_INTERPOLANT(char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_CodeGenerator(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  casadi::Dict const &arg2_defvalue = casadi::Dict() ;
  casadi::Dict *arg2 = (casadi::Dict *) &arg2_defvalue ;
  std::string m1 ;
  std::map< std::string,casadi::GenericType > m2 ;
  mxArray * _out;
  casadi::CodeGenerator *result = 0 ;
  
  if (!SWIG_check_num_args("new_CodeGenerator",argc,2,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  if (1<argc) {
    arg2 = &m2;
    if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "struct" "'.");
  }
  {
    try {
      result = (casadi::CodeGenerator *)new casadi::CodeGenerator((std::string const &)*arg1,(casadi::Dict const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__CodeGenerator, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_CodeGenerator'."
      "  Prototype:\n"
      "    CODEGENERATOR(char,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_CodeGenerator_add(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::CodeGenerator *arg1 = (casadi::CodeGenerator *) 0 ;
  casadi::Function *arg2 = 0 ;
  bool arg3 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Function m2 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("CodeGenerator_add",argc,3,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__CodeGenerator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CodeGenerator_add" "', argument " "1"" of type '" "casadi::CodeGenerator *""'"); 
  }
  arg1 = reinterpret_cast< casadi::CodeGenerator * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "Function" "'.");
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->add((casadi::Function const &)*arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'CodeGenerator_add'."
      "  Prototype:\n"
      "    ADD(self,Function,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_CodeGenerator_dump(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::CodeGenerator *arg1 = (casadi::CodeGenerator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("CodeGenerator_dump",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__CodeGenerator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CodeGenerator_dump" "', argument " "1"" of type '" "casadi::CodeGenerator *""'"); 
  }
  arg1 = reinterpret_cast< casadi::CodeGenerator * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->dump();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'CodeGenerator_dump'."
      "  Prototype:\n"
      "    DUMP(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_CodeGenerator_generate(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::CodeGenerator *arg1 = (casadi::CodeGenerator *) 0 ;
  std::string const &arg2_defvalue = "" ;
  std::string *arg2 = (std::string *) &arg2_defvalue ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("CodeGenerator_generate",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__CodeGenerator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CodeGenerator_generate" "', argument " "1"" of type '" "casadi::CodeGenerator *""'"); 
  }
  arg1 = reinterpret_cast< casadi::CodeGenerator * >(argp1);
  if (1<argc) {
    arg2 = &m2;
    if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->generate((std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'CodeGenerator_generate'."
      "  Prototype:\n"
      "    GENERATE(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_CodeGenerator_add_include(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::CodeGenerator *arg1 = (casadi::CodeGenerator *) 0 ;
  std::string *arg2 = 0 ;
  bool arg3 = (bool) false ;
  std::string const &arg4_defvalue = std::string() ;
  std::string *arg4 = (std::string *) &arg4_defvalue ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  std::string m4 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("CodeGenerator_add_include",argc,4,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__CodeGenerator, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CodeGenerator_add_include" "', argument " "1"" of type '" "casadi::CodeGenerator *""'"); 
  }
  arg1 = reinterpret_cast< casadi::CodeGenerator * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  }
  if (3<argc) {
    arg4 = &m4;
    if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "char" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->add_include((std::string const &)*arg2,arg3,(std::string const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'CodeGenerator_add_include'."
      "  Prototype:\n"
      "    ADD_INCLUDE(self,char,bool,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_delete_CodeGenerator(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::CodeGenerator *arg1 = (casadi::CodeGenerator *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  int is_owned;
  if (!SWIG_check_num_args("delete_CodeGenerator",argc,1,1,0)) {
    SWIG_fail;
  }
  is_owned = SWIG_Matlab_isOwned(argv[0]);
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__CodeGenerator, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_CodeGenerator" "', argument " "1"" of type '" "casadi::CodeGenerator *""'"); 
  }
  arg1 = reinterpret_cast< casadi::CodeGenerator * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  if (is_owned) {
    {
      delete arg1;
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'delete_CodeGenerator'."
      "  Prototype:\n"
      "    CODEGENERATOR(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_forward__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< casadi::MX,std::allocator< casadi::MX > > *arg1 = 0 ;
  std::vector< casadi::MX,std::allocator< casadi::MX > > *arg2 = 0 ;
  std::vector< std::vector< casadi::MX,std::allocator< casadi::MX > >,std::allocator< std::vector< casadi::MX,std::allocator< casadi::MX > > > > *arg3 = 0 ;
  casadi::Dict const &arg4_defvalue = casadi::Dict() ;
  casadi::Dict *arg4 = (casadi::Dict *) &arg4_defvalue ;
  std::vector< casadi::MX > m1 ;
  std::vector< casadi::MX > m2 ;
  std::vector< std::vector< casadi::MX > > m3 ;
  std::map< std::string,casadi::GenericType > m4 ;
  mxArray * _out;
  std::vector< std::vector< casadi::MX,std::allocator< casadi::MX > >,std::allocator< std::vector< casadi::MX,std::allocator< casadi::MX > > > > result;
  
  if (!SWIG_check_num_args("forward",argc,4,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "{" "MX" "}" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "MX" "}" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "{" "{" "MX" "}" "}" "'.");
  if (3<argc) {
    arg4 = &m4;
    if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi::casadi_forward((std::vector< casadi::MX,std::allocator< casadi::MX > > const &)*arg1,(std::vector< casadi::MX,std::allocator< casadi::MX > > const &)*arg2,(std::vector< std::vector< casadi::MX,std::allocator< casadi::MX > >,std::allocator< std::vector< casadi::MX,std::allocator< casadi::MX > > > > const &)*arg3,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "{" "MX" "}" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'forward'."
      "  Prototype:\n"
      "    FORWARD({MX},{MX},{{MX}},struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_reverse__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< casadi::MX,std::allocator< casadi::MX > > *arg1 = 0 ;
  std::vector< casadi::MX,std::allocator< casadi::MX > > *arg2 = 0 ;
  std::vector< std::vector< casadi::MX,std::allocator< casadi::MX > >,std::allocator< std::vector< casadi::MX,std::allocator< casadi::MX > > > > *arg3 = 0 ;
  casadi::Dict const &arg4_defvalue = casadi::Dict() ;
  casadi::Dict *arg4 = (casadi::Dict *) &arg4_defvalue ;
  std::vector< casadi::MX > m1 ;
  std::vector< casadi::MX > m2 ;
  std::vector< std::vector< casadi::MX > > m3 ;
  std::map< std::string,casadi::GenericType > m4 ;
  mxArray * _out;
  std::vector< std::vector< casadi::MX,std::allocator< casadi::MX > >,std::allocator< std::vector< casadi::MX,std::allocator< casadi::MX > > > > result;
  
  if (!SWIG_check_num_args("reverse",argc,4,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "{" "MX" "}" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "MX" "}" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "{" "{" "MX" "}" "}" "'.");
  if (3<argc) {
    arg4 = &m4;
    if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi::casadi_reverse((std::vector< casadi::MX,std::allocator< casadi::MX > > const &)*arg1,(std::vector< casadi::MX,std::allocator< casadi::MX > > const &)*arg2,(std::vector< std::vector< casadi::MX,std::allocator< casadi::MX > >,std::allocator< std::vector< casadi::MX,std::allocator< casadi::MX > > > > const &)*arg3,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "{" "MX" "}" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'reverse'."
      "  Prototype:\n"
      "    REVERSE({MX},{MX},{{MX}},struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_substitute__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::MX *arg3 = 0 ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  casadi::MX m3 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("substitute",argc,3,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "MX" "'.");
  {
    try {
      result = casadi::casadi_substitute((casadi::MX const &)*arg1,(casadi::MX const &)*arg2,(casadi::MX const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'substitute'."
      "  Prototype:\n"
      "    SUBSTITUTE(MX,MX,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_substitute__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< casadi::MX,std::allocator< casadi::MX > > *arg1 = 0 ;
  std::vector< casadi::MX,std::allocator< casadi::MX > > *arg2 = 0 ;
  std::vector< casadi::MX,std::allocator< casadi::MX > > *arg3 = 0 ;
  std::vector< casadi::MX > m1 ;
  std::vector< casadi::MX > m2 ;
  std::vector< casadi::MX > m3 ;
  mxArray * _out;
  std::vector< casadi::MX,std::allocator< casadi::MX > > result;
  
  if (!SWIG_check_num_args("substitute",argc,3,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "{" "MX" "}" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "MX" "}" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "{" "MX" "}" "'.");
  {
    try {
      result = casadi::casadi_substitute((std::vector< casadi::MX,std::allocator< casadi::MX > > const &)*arg1,(std::vector< casadi::MX,std::allocator< casadi::MX > > const &)*arg2,(std::vector< casadi::MX,std::allocator< casadi::MX > > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "MX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'substitute'."
      "  Prototype:\n"
      "    SUBSTITUTE({MX},{MX},{MX})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_substitute_inplace__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< casadi::MX,std::allocator< casadi::MX > > *arg1 = 0 ;
  std::vector< casadi::MX,std::allocator< casadi::MX > > *arg2 = 0 ;
  std::vector< casadi::MX,std::allocator< casadi::MX > > *arg3 = 0 ;
  bool arg4 = (bool) false ;
  std::vector< casadi::MX > m1 ;
  std::vector< casadi::MX > m2 ;
  std::vector< casadi::MX > m3 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("substitute_inplace",argc,4,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "{" "MX" "}" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input to type '" "{" "MX" "}" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input to type '" "{" "MX" "}" "'.");
  if (3<argc) {
    if (!casadi::to_val(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "bool" "'.");
  }
  {
    try {
      casadi::casadi_substitute_inplace((std::vector< casadi::MX,std::allocator< casadi::MX > > const &)*arg1,*arg2,*arg3,arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg3);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'substitute_inplace'."
      "  Prototype:\n"
      "    SUBSTITUTE_INPLACE({MX},bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_extract__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< casadi::MX,std::allocator< casadi::MX > > *arg1 = 0 ;
  std::vector< casadi::MX,std::allocator< casadi::MX > > *arg2 = 0 ;
  std::vector< casadi::MX,std::allocator< casadi::MX > > *arg3 = 0 ;
  std::vector< casadi::MX,std::allocator< casadi::MX > > *arg4 = 0 ;
  casadi::Dict const &arg5_defvalue = casadi::Dict() ;
  casadi::Dict *arg5 = (casadi::Dict *) &arg5_defvalue ;
  std::vector< casadi::MX > m1 ;
  std::vector< casadi::MX > m2 ;
  std::vector< casadi::MX > m3 ;
  std::vector< casadi::MX > m4 ;
  std::map< std::string,casadi::GenericType > m5 ;
  mxArray * _out;
  
  arg2 = &m2;
  arg3 = &m3;
  arg4 = &m4;
  if (!SWIG_check_num_args("extract",argc,2,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "{" "MX" "}" "'.");
  if (1<argc) {
    arg5 = &m5;
    if (!casadi::to_ptr(argv[1], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "struct" "'.");
  }
  {
    try {
      casadi::casadi_extract((std::vector< casadi::MX,std::allocator< casadi::MX > > const &)*arg1,*arg2,*arg3,*arg4,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg3);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg4);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'extract'."
      "  Prototype:\n"
      "    EXTRACT({MX},struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_shared__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< casadi::MX,std::allocator< casadi::MX > > *arg1 = 0 ;
  std::vector< casadi::MX,std::allocator< casadi::MX > > *arg2 = 0 ;
  std::vector< casadi::MX,std::allocator< casadi::MX > > *arg3 = 0 ;
  std::vector< casadi::MX,std::allocator< casadi::MX > > *arg4 = 0 ;
  std::string const &arg5_defvalue = "v_" ;
  std::string *arg5 = (std::string *) &arg5_defvalue ;
  std::string const &arg6_defvalue = "" ;
  std::string *arg6 = (std::string *) &arg6_defvalue ;
  std::vector< casadi::MX > m1 ;
  std::vector< casadi::MX > m2 ;
  std::vector< casadi::MX > m3 ;
  std::vector< casadi::MX > m4 ;
  std::string m5 ;
  std::string m6 ;
  mxArray * _out;
  
  arg2 = &m2;
  arg3 = &m3;
  arg4 = &m4;
  if (!SWIG_check_num_args("shared",argc,3,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "{" "MX" "}" "'.");
  if (1<argc) {
    arg5 = &m5;
    if (!casadi::to_ptr(argv[1], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "char" "'.");
  }
  if (2<argc) {
    arg6 = &m6;
    if (!casadi::to_ptr(argv[2], &arg6)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 6 to type '" "char" "'.");
  }
  {
    try {
      casadi::casadi_shared((std::vector< casadi::MX,std::allocator< casadi::MX > > const &)*arg1,*arg2,*arg3,*arg4,(std::string const &)*arg5,(std::string const &)*arg6);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg3);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg4);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'shared'."
      "  Prototype:\n"
      "    SHARED({MX},char,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_blockcat__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< std::vector< casadi::MX,std::allocator< casadi::MX > >,std::allocator< std::vector< casadi::MX,std::allocator< casadi::MX > > > > *arg1 = 0 ;
  std::vector< std::vector< casadi::MX > > m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("blockcat",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "{" "{" "MX" "}" "}" "'.");
  {
    try {
      result = casadi::casadi_blockcat((std::vector< std::vector< casadi::MX,std::allocator< casadi::MX > >,std::allocator< std::vector< casadi::MX,std::allocator< casadi::MX > > > > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'blockcat'."
      "  Prototype:\n"
      "    BLOCKCAT({{MX}})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_forward__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > *arg1 = 0 ;
  std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > *arg2 = 0 ;
  std::vector< std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > >,std::allocator< std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > > > *arg3 = 0 ;
  casadi::Dict const &arg4_defvalue = casadi::Dict() ;
  casadi::Dict *arg4 = (casadi::Dict *) &arg4_defvalue ;
  std::vector< casadi::Matrix< double > > m1 ;
  std::vector< casadi::Matrix< double > > m2 ;
  std::vector< std::vector< casadi::Matrix< double > > > m3 ;
  std::map< std::string,casadi::GenericType > m4 ;
  mxArray * _out;
  std::vector< std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > >,std::allocator< std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > > > result;
  
  if (!SWIG_check_num_args("forward",argc,4,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "{" "DM" "}" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "DM" "}" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "{" "{" "DM" "}" "}" "'.");
  if (3<argc) {
    arg4 = &m4;
    if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi::casadi_forward((std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > const &)*arg1,(std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > const &)*arg2,(std::vector< std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > >,std::allocator< std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > > > const &)*arg3,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "{" "DM" "}" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'forward'."
      "  Prototype:\n"
      "    FORWARD({DM},{DM},{{DM}},struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_reverse__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > *arg1 = 0 ;
  std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > *arg2 = 0 ;
  std::vector< std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > >,std::allocator< std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > > > *arg3 = 0 ;
  casadi::Dict const &arg4_defvalue = casadi::Dict() ;
  casadi::Dict *arg4 = (casadi::Dict *) &arg4_defvalue ;
  std::vector< casadi::Matrix< double > > m1 ;
  std::vector< casadi::Matrix< double > > m2 ;
  std::vector< std::vector< casadi::Matrix< double > > > m3 ;
  std::map< std::string,casadi::GenericType > m4 ;
  mxArray * _out;
  std::vector< std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > >,std::allocator< std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > > > result;
  
  if (!SWIG_check_num_args("reverse",argc,4,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "{" "DM" "}" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "DM" "}" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "{" "{" "DM" "}" "}" "'.");
  if (3<argc) {
    arg4 = &m4;
    if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi::casadi_reverse((std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > const &)*arg1,(std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > const &)*arg2,(std::vector< std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > >,std::allocator< std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > > > const &)*arg3,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "{" "DM" "}" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'reverse'."
      "  Prototype:\n"
      "    REVERSE({DM},{DM},{{DM}},struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_substitute__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< double > *arg1 = 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  casadi::Matrix< double > *arg3 = 0 ;
  casadi::Matrix< double > m1 ;
  casadi::Matrix< double > m2 ;
  casadi::Matrix< double > m3 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("substitute",argc,3,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "DM" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "DM" "'.");
  {
    try {
      result = casadi::casadi_substitute((casadi::Matrix< double > const &)*arg1,(casadi::Matrix< double > const &)*arg2,(casadi::Matrix< double > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'substitute'."
      "  Prototype:\n"
      "    SUBSTITUTE(DM,DM,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_substitute__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > *arg1 = 0 ;
  std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > *arg2 = 0 ;
  std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > *arg3 = 0 ;
  std::vector< casadi::Matrix< double > > m1 ;
  std::vector< casadi::Matrix< double > > m2 ;
  std::vector< casadi::Matrix< double > > m3 ;
  mxArray * _out;
  std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > result;
  
  if (!SWIG_check_num_args("substitute",argc,3,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "{" "DM" "}" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "DM" "}" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "{" "DM" "}" "'.");
  {
    try {
      result = casadi::casadi_substitute((std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > const &)*arg1,(std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > const &)*arg2,(std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "DM" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'substitute'."
      "  Prototype:\n"
      "    SUBSTITUTE({DM},{DM},{DM})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_substitute_inplace__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > *arg1 = 0 ;
  std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > *arg2 = 0 ;
  std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > *arg3 = 0 ;
  bool arg4 = (bool) false ;
  std::vector< casadi::Matrix< double > > m1 ;
  std::vector< casadi::Matrix< double > > m2 ;
  std::vector< casadi::Matrix< double > > m3 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("substitute_inplace",argc,4,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "{" "DM" "}" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input to type '" "{" "DM" "}" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input to type '" "{" "DM" "}" "'.");
  if (3<argc) {
    if (!casadi::to_val(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "bool" "'.");
  }
  {
    try {
      casadi::casadi_substitute_inplace((std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > const &)*arg1,*arg2,*arg3,arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg3);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'substitute_inplace'."
      "  Prototype:\n"
      "    SUBSTITUTE_INPLACE({DM},bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_extract__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > *arg1 = 0 ;
  std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > *arg2 = 0 ;
  std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > *arg3 = 0 ;
  std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > *arg4 = 0 ;
  casadi::Dict const &arg5_defvalue = casadi::Dict() ;
  casadi::Dict *arg5 = (casadi::Dict *) &arg5_defvalue ;
  std::vector< casadi::Matrix< double > > m1 ;
  std::vector< casadi::Matrix< double > > m2 ;
  std::vector< casadi::Matrix< double > > m3 ;
  std::vector< casadi::Matrix< double > > m4 ;
  std::map< std::string,casadi::GenericType > m5 ;
  mxArray * _out;
  
  arg2 = &m2;
  arg3 = &m3;
  arg4 = &m4;
  if (!SWIG_check_num_args("extract",argc,2,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "{" "DM" "}" "'.");
  if (1<argc) {
    arg5 = &m5;
    if (!casadi::to_ptr(argv[1], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "struct" "'.");
  }
  {
    try {
      casadi::casadi_extract((std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > const &)*arg1,*arg2,*arg3,*arg4,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg3);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg4);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'extract'."
      "  Prototype:\n"
      "    EXTRACT({DM},struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_shared__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > *arg1 = 0 ;
  std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > *arg2 = 0 ;
  std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > *arg3 = 0 ;
  std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > *arg4 = 0 ;
  std::string const &arg5_defvalue = "v_" ;
  std::string *arg5 = (std::string *) &arg5_defvalue ;
  std::string const &arg6_defvalue = "" ;
  std::string *arg6 = (std::string *) &arg6_defvalue ;
  std::vector< casadi::Matrix< double > > m1 ;
  std::vector< casadi::Matrix< double > > m2 ;
  std::vector< casadi::Matrix< double > > m3 ;
  std::vector< casadi::Matrix< double > > m4 ;
  std::string m5 ;
  std::string m6 ;
  mxArray * _out;
  
  arg2 = &m2;
  arg3 = &m3;
  arg4 = &m4;
  if (!SWIG_check_num_args("shared",argc,3,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "{" "DM" "}" "'.");
  if (1<argc) {
    arg5 = &m5;
    if (!casadi::to_ptr(argv[1], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "char" "'.");
  }
  if (2<argc) {
    arg6 = &m6;
    if (!casadi::to_ptr(argv[2], &arg6)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 6 to type '" "char" "'.");
  }
  {
    try {
      casadi::casadi_shared((std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > const &)*arg1,*arg2,*arg3,*arg4,(std::string const &)*arg5,(std::string const &)*arg6);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg3);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg4);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'shared'."
      "  Prototype:\n"
      "    SHARED({DM},char,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_blockcat__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > >,std::allocator< std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > > > *arg1 = 0 ;
  std::vector< std::vector< casadi::Matrix< double > > > m1 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("blockcat",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "{" "{" "DM" "}" "}" "'.");
  {
    try {
      result = casadi::casadi_blockcat((std::vector< std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > >,std::allocator< std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > > > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'blockcat'."
      "  Prototype:\n"
      "    BLOCKCAT({{DM}})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_forward__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > *arg1 = 0 ;
  std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > *arg2 = 0 ;
  std::vector< std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > >,std::allocator< std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > > > *arg3 = 0 ;
  casadi::Dict const &arg4_defvalue = casadi::Dict() ;
  casadi::Dict *arg4 = (casadi::Dict *) &arg4_defvalue ;
  std::vector< casadi::Matrix< casadi::SXElem > > m1 ;
  std::vector< casadi::Matrix< casadi::SXElem > > m2 ;
  std::vector< std::vector< casadi::Matrix< casadi::SXElem > > > m3 ;
  std::map< std::string,casadi::GenericType > m4 ;
  mxArray * _out;
  std::vector< std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > >,std::allocator< std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > > > result;
  
  if (!SWIG_check_num_args("forward",argc,4,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "{" "SX" "}" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "SX" "}" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "{" "{" "SX" "}" "}" "'.");
  if (3<argc) {
    arg4 = &m4;
    if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi::casadi_forward((std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > const &)*arg1,(std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > const &)*arg2,(std::vector< std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > >,std::allocator< std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > > > const &)*arg3,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "{" "SX" "}" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'forward'."
      "  Prototype:\n"
      "    FORWARD({SX},{SX},{{SX}},struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_forward(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 3) && (argc <= 4)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::vector< casadi::Matrix<double> > **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector< casadi::Matrix<double> > **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::vector<std::vector< casadi::Matrix<double> > > **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_forward__SWIG_1(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< std::map<std::string,casadi::GenericType> **>(0));
          if (_v) {
            return _wrap_forward__SWIG_1(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if ((argc >= 3) && (argc <= 4)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::vector< casadi::Matrix<casadi::SXElem> > **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector< casadi::Matrix<casadi::SXElem> > **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::vector<std::vector< casadi::Matrix<casadi::SXElem> > > **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_forward__SWIG_2(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< std::map<std::string,casadi::GenericType> **>(0));
          if (_v) {
            return _wrap_forward__SWIG_2(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if ((argc >= 3) && (argc <= 4)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::vector<casadi::MX> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<casadi::MX> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::vector<std::vector<casadi::MX> > **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_forward__SWIG_0(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< std::map<std::string,casadi::GenericType> **>(0));
          if (_v) {
            return _wrap_forward__SWIG_0(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'forward'."
    "  Possible prototypes are:\n"
    "    FORWARD({DM},{DM},{{DM}},struct)\n"
    "    FORWARD({SX},{SX},{{SX}},struct)\n"
    "    FORWARD({MX},{MX},{{MX}},struct)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_reverse__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > *arg1 = 0 ;
  std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > *arg2 = 0 ;
  std::vector< std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > >,std::allocator< std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > > > *arg3 = 0 ;
  casadi::Dict const &arg4_defvalue = casadi::Dict() ;
  casadi::Dict *arg4 = (casadi::Dict *) &arg4_defvalue ;
  std::vector< casadi::Matrix< casadi::SXElem > > m1 ;
  std::vector< casadi::Matrix< casadi::SXElem > > m2 ;
  std::vector< std::vector< casadi::Matrix< casadi::SXElem > > > m3 ;
  std::map< std::string,casadi::GenericType > m4 ;
  mxArray * _out;
  std::vector< std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > >,std::allocator< std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > > > result;
  
  if (!SWIG_check_num_args("reverse",argc,4,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "{" "SX" "}" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "SX" "}" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "{" "{" "SX" "}" "}" "'.");
  if (3<argc) {
    arg4 = &m4;
    if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi::casadi_reverse((std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > const &)*arg1,(std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > const &)*arg2,(std::vector< std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > >,std::allocator< std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > > > const &)*arg3,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "{" "SX" "}" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'reverse'."
      "  Prototype:\n"
      "    REVERSE({SX},{SX},{{SX}},struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_reverse(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 3) && (argc <= 4)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::vector< casadi::Matrix<double> > **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector< casadi::Matrix<double> > **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::vector<std::vector< casadi::Matrix<double> > > **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_reverse__SWIG_1(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< std::map<std::string,casadi::GenericType> **>(0));
          if (_v) {
            return _wrap_reverse__SWIG_1(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if ((argc >= 3) && (argc <= 4)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::vector< casadi::Matrix<casadi::SXElem> > **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector< casadi::Matrix<casadi::SXElem> > **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::vector<std::vector< casadi::Matrix<casadi::SXElem> > > **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_reverse__SWIG_2(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< std::map<std::string,casadi::GenericType> **>(0));
          if (_v) {
            return _wrap_reverse__SWIG_2(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if ((argc >= 3) && (argc <= 4)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::vector<casadi::MX> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<casadi::MX> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::vector<std::vector<casadi::MX> > **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_reverse__SWIG_0(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< std::map<std::string,casadi::GenericType> **>(0));
          if (_v) {
            return _wrap_reverse__SWIG_0(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'reverse'."
    "  Possible prototypes are:\n"
    "    REVERSE({DM},{DM},{{DM}},struct)\n"
    "    REVERSE({SX},{SX},{{SX}},struct)\n"
    "    REVERSE({MX},{MX},{{MX}},struct)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_substitute__SWIG_4(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Matrix< casadi::SXElem > *arg1 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  casadi::Matrix< casadi::SXElem > *arg3 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  casadi::Matrix< casadi::SXElem > m3 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("substitute",argc,3,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "SX" "'.");
  {
    try {
      result = casadi::casadi_substitute((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2,(casadi::Matrix< casadi::SXElem > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'substitute'."
      "  Prototype:\n"
      "    SUBSTITUTE(SX,SX,SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_substitute__SWIG_5(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > *arg1 = 0 ;
  std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > *arg2 = 0 ;
  std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > *arg3 = 0 ;
  std::vector< casadi::Matrix< casadi::SXElem > > m1 ;
  std::vector< casadi::Matrix< casadi::SXElem > > m2 ;
  std::vector< casadi::Matrix< casadi::SXElem > > m3 ;
  mxArray * _out;
  std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > result;
  
  if (!SWIG_check_num_args("substitute",argc,3,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "{" "SX" "}" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "SX" "}" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "{" "SX" "}" "'.");
  {
    try {
      result = casadi::casadi_substitute((std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > const &)*arg1,(std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > const &)*arg2,(std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "SX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'substitute'."
      "  Prototype:\n"
      "    SUBSTITUTE({SX},{SX},{SX})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_substitute(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 3) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<double> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<double> **>(0));
        if (_v) {
          return _wrap_substitute__SWIG_2(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::vector< casadi::Matrix<double> > **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector< casadi::Matrix<double> > **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::vector< casadi::Matrix<double> > **>(0));
        if (_v) {
          return _wrap_substitute__SWIG_3(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
        if (_v) {
          return _wrap_substitute__SWIG_4(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::vector< casadi::Matrix<casadi::SXElem> > **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector< casadi::Matrix<casadi::SXElem> > **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::vector< casadi::Matrix<casadi::SXElem> > **>(0));
        if (_v) {
          return _wrap_substitute__SWIG_5(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::MX **>(0));
        if (_v) {
          return _wrap_substitute__SWIG_0(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::vector<casadi::MX> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<casadi::MX> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::vector<casadi::MX> **>(0));
        if (_v) {
          return _wrap_substitute__SWIG_1(resc,resv,argc,argv);
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'substitute'."
    "  Possible prototypes are:\n"
    "    SUBSTITUTE(DM,DM,DM)\n"
    "    SUBSTITUTE({DM},{DM},{DM})\n"
    "    SUBSTITUTE(SX,SX,SX)\n"
    "    SUBSTITUTE({SX},{SX},{SX})\n"
    "    SUBSTITUTE(MX,MX,MX)\n"
    "    SUBSTITUTE({MX},{MX},{MX})\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_substitute_inplace__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > *arg1 = 0 ;
  std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > *arg2 = 0 ;
  std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > *arg3 = 0 ;
  bool arg4 = (bool) false ;
  std::vector< casadi::Matrix< casadi::SXElem > > m1 ;
  std::vector< casadi::Matrix< casadi::SXElem > > m2 ;
  std::vector< casadi::Matrix< casadi::SXElem > > m3 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("substitute_inplace",argc,4,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "{" "SX" "}" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input to type '" "{" "SX" "}" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input to type '" "{" "SX" "}" "'.");
  if (3<argc) {
    if (!casadi::to_val(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "bool" "'.");
  }
  {
    try {
      casadi::casadi_substitute_inplace((std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > const &)*arg1,*arg2,*arg3,arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg3);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'substitute_inplace'."
      "  Prototype:\n"
      "    SUBSTITUTE_INPLACE({SX},bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_substitute_inplace(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 3) && (argc <= 4)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::vector< casadi::Matrix<double> > **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector< casadi::Matrix<double> > **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::vector< casadi::Matrix<double> > **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_substitute_inplace__SWIG_1(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< bool **>(0));
          if (_v) {
            return _wrap_substitute_inplace__SWIG_1(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if ((argc >= 3) && (argc <= 4)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::vector< casadi::Matrix<casadi::SXElem> > **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector< casadi::Matrix<casadi::SXElem> > **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::vector< casadi::Matrix<casadi::SXElem> > **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_substitute_inplace__SWIG_2(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< bool **>(0));
          if (_v) {
            return _wrap_substitute_inplace__SWIG_2(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if ((argc >= 3) && (argc <= 4)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::vector<casadi::MX> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<casadi::MX> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::vector<casadi::MX> **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_substitute_inplace__SWIG_0(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< bool **>(0));
          if (_v) {
            return _wrap_substitute_inplace__SWIG_0(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'substitute_inplace'."
    "  Possible prototypes are:\n"
    "    SUBSTITUTE_INPLACE({DM},bool)\n"
    "    SUBSTITUTE_INPLACE({SX},bool)\n"
    "    SUBSTITUTE_INPLACE({MX},bool)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_extract__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > *arg1 = 0 ;
  std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > *arg2 = 0 ;
  std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > *arg3 = 0 ;
  std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > *arg4 = 0 ;
  casadi::Dict const &arg5_defvalue = casadi::Dict() ;
  casadi::Dict *arg5 = (casadi::Dict *) &arg5_defvalue ;
  std::vector< casadi::Matrix< casadi::SXElem > > m1 ;
  std::vector< casadi::Matrix< casadi::SXElem > > m2 ;
  std::vector< casadi::Matrix< casadi::SXElem > > m3 ;
  std::vector< casadi::Matrix< casadi::SXElem > > m4 ;
  std::map< std::string,casadi::GenericType > m5 ;
  mxArray * _out;
  
  arg2 = &m2;
  arg3 = &m3;
  arg4 = &m4;
  if (!SWIG_check_num_args("extract",argc,2,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "{" "SX" "}" "'.");
  if (1<argc) {
    arg5 = &m5;
    if (!casadi::to_ptr(argv[1], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "struct" "'.");
  }
  {
    try {
      casadi::casadi_extract((std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > const &)*arg1,*arg2,*arg3,*arg4,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg3);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg4);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'extract'."
      "  Prototype:\n"
      "    EXTRACT({SX},struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_extract(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 1) && (argc <= 2)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::vector< casadi::Matrix<double> > **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_extract__SWIG_1(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< std::map<std::string,casadi::GenericType> **>(0));
      if (_v) {
        return _wrap_extract__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if ((argc >= 1) && (argc <= 2)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::vector< casadi::Matrix<casadi::SXElem> > **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_extract__SWIG_2(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< std::map<std::string,casadi::GenericType> **>(0));
      if (_v) {
        return _wrap_extract__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if ((argc >= 1) && (argc <= 2)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::vector<casadi::MX> **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_extract__SWIG_0(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< std::map<std::string,casadi::GenericType> **>(0));
      if (_v) {
        return _wrap_extract__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'extract'."
    "  Possible prototypes are:\n"
    "    EXTRACT({DM},struct)\n"
    "    EXTRACT({SX},struct)\n"
    "    EXTRACT({MX},struct)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_shared__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > *arg1 = 0 ;
  std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > *arg2 = 0 ;
  std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > *arg3 = 0 ;
  std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > *arg4 = 0 ;
  std::string const &arg5_defvalue = "v_" ;
  std::string *arg5 = (std::string *) &arg5_defvalue ;
  std::string const &arg6_defvalue = "" ;
  std::string *arg6 = (std::string *) &arg6_defvalue ;
  std::vector< casadi::Matrix< casadi::SXElem > > m1 ;
  std::vector< casadi::Matrix< casadi::SXElem > > m2 ;
  std::vector< casadi::Matrix< casadi::SXElem > > m3 ;
  std::vector< casadi::Matrix< casadi::SXElem > > m4 ;
  std::string m5 ;
  std::string m6 ;
  mxArray * _out;
  
  arg2 = &m2;
  arg3 = &m3;
  arg4 = &m4;
  if (!SWIG_check_num_args("shared",argc,3,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "{" "SX" "}" "'.");
  if (1<argc) {
    arg5 = &m5;
    if (!casadi::to_ptr(argv[1], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "char" "'.");
  }
  if (2<argc) {
    arg6 = &m6;
    if (!casadi::to_ptr(argv[2], &arg6)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 6 to type '" "char" "'.");
  }
  {
    try {
      casadi::casadi_shared((std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > const &)*arg1,*arg2,*arg3,*arg4,(std::string const &)*arg5,(std::string const &)*arg6);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg3);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg4);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'shared'."
      "  Prototype:\n"
      "    SHARED({SX},char,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_shared(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 1) && (argc <= 3)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::vector< casadi::Matrix<double> > **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_shared__SWIG_1(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_shared__SWIG_1(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< std::string **>(0));
        if (_v) {
          return _wrap_shared__SWIG_1(resc,resv,argc,argv);
        }
      }
    }
  }
  if ((argc >= 1) && (argc <= 3)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::vector< casadi::Matrix<casadi::SXElem> > **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_shared__SWIG_2(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_shared__SWIG_2(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< std::string **>(0));
        if (_v) {
          return _wrap_shared__SWIG_2(resc,resv,argc,argv);
        }
      }
    }
  }
  if ((argc >= 1) && (argc <= 3)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::vector<casadi::MX> **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_shared__SWIG_0(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_shared__SWIG_0(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< std::string **>(0));
        if (_v) {
          return _wrap_shared__SWIG_0(resc,resv,argc,argv);
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'shared'."
    "  Possible prototypes are:\n"
    "    SHARED({DM},char,char)\n"
    "    SHARED({SX},char,char)\n"
    "    SHARED({MX},char,char)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_blockcat__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > >,std::allocator< std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > > > *arg1 = 0 ;
  std::vector< std::vector< casadi::Matrix< casadi::SXElem > > > m1 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("blockcat",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "{" "{" "SX" "}" "}" "'.");
  {
    try {
      result = casadi::casadi_blockcat((std::vector< std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > >,std::allocator< std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > > > const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'blockcat'."
      "  Prototype:\n"
      "    BLOCKCAT({{SX}})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_blockcat(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::vector<std::vector< casadi::Matrix<double> > > **>(0));
    if (_v) {
      return _wrap_blockcat__SWIG_1(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::vector<std::vector< casadi::Matrix<casadi::SXElem> > > **>(0));
    if (_v) {
      return _wrap_blockcat__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::vector<std::vector<casadi::MX> > **>(0));
    if (_v) {
      return _wrap_blockcat__SWIG_0(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'blockcat'."
    "  Possible prototypes are:\n"
    "    BLOCKCAT({{DM}})\n"
    "    BLOCKCAT({{SX}})\n"
    "    BLOCKCAT({{MX}})\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_matrix_expand__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< casadi::MX,std::allocator< casadi::MX > > *arg1 = 0 ;
  std::vector< casadi::MX,std::allocator< casadi::MX > > const &arg2_defvalue = std::vector< casadi::MX >() ;
  std::vector< casadi::MX,std::allocator< casadi::MX > > *arg2 = (std::vector< casadi::MX,std::allocator< casadi::MX > > *) &arg2_defvalue ;
  casadi::Dict const &arg3_defvalue = casadi::Dict() ;
  casadi::Dict *arg3 = (casadi::Dict *) &arg3_defvalue ;
  std::vector< casadi::MX > m1 ;
  std::vector< casadi::MX > m2 ;
  std::map< std::string,casadi::GenericType > m3 ;
  mxArray * _out;
  std::vector< casadi::MX,std::allocator< casadi::MX > > result;
  
  if (!SWIG_check_num_args("matrix_expand",argc,3,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "{" "MX" "}" "'.");
  if (1<argc) {
    arg2 = &m2;
    if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "MX" "}" "'.");
  }
  if (2<argc) {
    arg3 = &m3;
    if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi::casadi_matrix_expand((std::vector< casadi::MX,std::allocator< casadi::MX > > const &)*arg1,(std::vector< casadi::MX,std::allocator< casadi::MX > > const &)*arg2,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "MX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'matrix_expand'."
      "  Prototype:\n"
      "    MATRIX_EXPAND({MX},{MX},struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_matrix_expand__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  std::vector< casadi::MX,std::allocator< casadi::MX > > const &arg2_defvalue = std::vector< casadi::MX >() ;
  std::vector< casadi::MX,std::allocator< casadi::MX > > *arg2 = (std::vector< casadi::MX,std::allocator< casadi::MX > > *) &arg2_defvalue ;
  casadi::Dict const &arg3_defvalue = casadi::Dict() ;
  casadi::Dict *arg3 = (casadi::Dict *) &arg3_defvalue ;
  casadi::MX m1 ;
  std::vector< casadi::MX > m2 ;
  std::map< std::string,casadi::GenericType > m3 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("matrix_expand",argc,3,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  if (1<argc) {
    arg2 = &m2;
    if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "MX" "}" "'.");
  }
  if (2<argc) {
    arg3 = &m3;
    if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi::casadi_matrix_expand((casadi::MX const &)*arg1,(std::vector< casadi::MX,std::allocator< casadi::MX > > const &)*arg2,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'matrix_expand'."
      "  Prototype:\n"
      "    MATRIX_EXPAND(MX,{MX},struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_matrix_expand(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 1) && (argc <= 3)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_matrix_expand__SWIG_1(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<casadi::MX> **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_matrix_expand__SWIG_1(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< std::map<std::string,casadi::GenericType> **>(0));
        if (_v) {
          return _wrap_matrix_expand__SWIG_1(resc,resv,argc,argv);
        }
      }
    }
  }
  if ((argc >= 1) && (argc <= 3)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::vector<casadi::MX> **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_matrix_expand__SWIG_0(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<casadi::MX> **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_matrix_expand__SWIG_0(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< std::map<std::string,casadi::GenericType> **>(0));
        if (_v) {
          return _wrap_matrix_expand__SWIG_0(resc,resv,argc,argv);
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'matrix_expand'."
    "  Possible prototypes are:\n"
    "    MATRIX_EXPAND(MX,{MX},struct)\n"
    "    MATRIX_EXPAND({MX},{MX},struct)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_graph_substitute__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  std::vector< casadi::MX,std::allocator< casadi::MX > > *arg2 = 0 ;
  std::vector< casadi::MX,std::allocator< casadi::MX > > *arg3 = 0 ;
  casadi::MX m1 ;
  std::vector< casadi::MX > m2 ;
  std::vector< casadi::MX > m3 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("graph_substitute",argc,3,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "MX" "}" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "{" "MX" "}" "'.");
  {
    try {
      result = casadi::casadi_graph_substitute((casadi::MX const &)*arg1,(std::vector< casadi::MX,std::allocator< casadi::MX > > const &)*arg2,(std::vector< casadi::MX,std::allocator< casadi::MX > > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'graph_substitute'."
      "  Prototype:\n"
      "    GRAPH_SUBSTITUTE(MX,{MX},{MX})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_graph_substitute__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< casadi::MX,std::allocator< casadi::MX > > *arg1 = 0 ;
  std::vector< casadi::MX,std::allocator< casadi::MX > > *arg2 = 0 ;
  std::vector< casadi::MX,std::allocator< casadi::MX > > *arg3 = 0 ;
  std::vector< casadi::MX > m1 ;
  std::vector< casadi::MX > m2 ;
  std::vector< casadi::MX > m3 ;
  mxArray * _out;
  std::vector< casadi::MX,std::allocator< casadi::MX > > result;
  
  if (!SWIG_check_num_args("graph_substitute",argc,3,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "{" "MX" "}" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "MX" "}" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "{" "MX" "}" "'.");
  {
    try {
      result = casadi::casadi_graph_substitute((std::vector< casadi::MX,std::allocator< casadi::MX > > const &)*arg1,(std::vector< casadi::MX,std::allocator< casadi::MX > > const &)*arg2,(std::vector< casadi::MX,std::allocator< casadi::MX > > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "MX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'graph_substitute'."
      "  Prototype:\n"
      "    GRAPH_SUBSTITUTE({MX},{MX},{MX})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_graph_substitute(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 3) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<casadi::MX> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::vector<casadi::MX> **>(0));
        if (_v) {
          return _wrap_graph_substitute__SWIG_0(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::vector<casadi::MX> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<casadi::MX> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::vector<casadi::MX> **>(0));
        if (_v) {
          return _wrap_graph_substitute__SWIG_1(resc,resv,argc,argv);
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'graph_substitute'."
    "  Possible prototypes are:\n"
    "    GRAPH_SUBSTITUTE(MX,{MX},{MX})\n"
    "    GRAPH_SUBSTITUTE({MX},{MX},{MX})\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_bspline__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::DM *arg2 = 0 ;
  std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *arg3 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg4 = 0 ;
  casadi_int arg5 ;
  casadi::Dict const &arg6_defvalue = casadi::Dict() ;
  casadi::Dict *arg6 = (casadi::Dict *) &arg6_defvalue ;
  casadi::MX m1 ;
  casadi::Matrix< double > m2 ;
  std::vector< std::vector< double > > m3 ;
  std::vector< casadi_int > m4 ;
  std::map< std::string,casadi::GenericType > m6 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("bspline",argc,6,5,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "{" "[" "double" "]" "}" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "[" "int" "]" "'.");
  if (!casadi::to_val(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "int" "'.");
  if (5<argc) {
    arg6 = &m6;
    if (!casadi::to_ptr(argv[5], &arg6)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 6 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi::casadi_bspline((casadi::MX const &)*arg1,(casadi::Matrix< double > const &)*arg2,(std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > const &)*arg3,(std::vector< long long,std::allocator< long long > > const &)*arg4,arg5,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg6);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'bspline'."
      "  Prototype:\n"
      "    BSPLINE(MX,DM,{[double]},[int],int,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_bspline__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *arg3 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg4 = 0 ;
  casadi_int arg5 ;
  casadi::Dict const &arg6_defvalue = casadi::Dict() ;
  casadi::Dict *arg6 = (casadi::Dict *) &arg6_defvalue ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  std::vector< std::vector< double > > m3 ;
  std::vector< casadi_int > m4 ;
  std::map< std::string,casadi::GenericType > m6 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("bspline",argc,6,5,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "{" "[" "double" "]" "}" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "[" "int" "]" "'.");
  if (!casadi::to_val(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "int" "'.");
  if (5<argc) {
    arg6 = &m6;
    if (!casadi::to_ptr(argv[5], &arg6)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 6 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi::casadi_bspline((casadi::MX const &)*arg1,(casadi::MX const &)*arg2,(std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > const &)*arg3,(std::vector< long long,std::allocator< long long > > const &)*arg4,arg5,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg6);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'bspline'."
      "  Prototype:\n"
      "    BSPLINE(MX,MX,{[double]},[int],int,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_bspline(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 5) && (argc <= 6)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::vector<std::vector<double> > **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< std::vector<casadi_int> **>(0));
          if (_v) {
            _v = casadi::to_ptr(argv[4], static_cast< casadi_int **>(0));
            if (_v) {
              if (argc <= 5) {
                return _wrap_bspline__SWIG_0(resc,resv,argc,argv);
              }
              _v = casadi::to_ptr(argv[5], static_cast< std::map<std::string,casadi::GenericType> **>(0));
              if (_v) {
                return _wrap_bspline__SWIG_0(resc,resv,argc,argv);
              }
            }
          }
        }
      }
    }
  }
  if ((argc >= 5) && (argc <= 6)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::vector<std::vector<double> > **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< std::vector<casadi_int> **>(0));
          if (_v) {
            _v = casadi::to_ptr(argv[4], static_cast< casadi_int **>(0));
            if (_v) {
              if (argc <= 5) {
                return _wrap_bspline__SWIG_1(resc,resv,argc,argv);
              }
              _v = casadi::to_ptr(argv[5], static_cast< std::map<std::string,casadi::GenericType> **>(0));
              if (_v) {
                return _wrap_bspline__SWIG_1(resc,resv,argc,argv);
              }
            }
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'bspline'."
    "  Possible prototypes are:\n"
    "    BSPLINE(MX,DM,{[double]},[int],int,struct)\n"
    "    BSPLINE(MX,MX,{[double]},[int],int,struct)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_convexify(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::Dict const &arg2_defvalue = casadi::Dict() ;
  casadi::Dict *arg2 = (casadi::Dict *) &arg2_defvalue ;
  casadi::MX m1 ;
  std::map< std::string,casadi::GenericType > m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("convexify",argc,2,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  if (1<argc) {
    arg2 = &m2;
    if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi::casadi_convexify((casadi::MX const &)*arg1,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'convexify'."
      "  Prototype:\n"
      "    CONVEXIFY(MX,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_stop_diff__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi_int arg2 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("stop_diff",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  {
    try {
      result = casadi::casadi_stop_diff((casadi::MX const &)*arg1,arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'stop_diff'."
      "  Prototype:\n"
      "    STOP_DIFF(MX,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_stop_diff__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  casadi_int arg3 ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("stop_diff",argc,3,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  {
    try {
      result = casadi::casadi_stop_diff((casadi::MX const &)*arg1,(casadi::MX const &)*arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'stop_diff'."
      "  Prototype:\n"
      "    STOP_DIFF(MX,MX,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_stop_diff(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_stop_diff__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 3) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          return _wrap_stop_diff__SWIG_1(resc,resv,argc,argv);
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'stop_diff'."
    "  Possible prototypes are:\n"
    "    STOP_DIFF(MX,int)\n"
    "    STOP_DIFF(MX,MX,int)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_no_hess(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("no_hess",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  {
    try {
      result = casadi::casadi_no_hess((casadi::MX const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'no_hess'."
      "  Prototype:\n"
      "    NO_HESS(MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_no_grad(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX m1 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("no_grad",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  {
    try {
      result = casadi::casadi_no_grad((casadi::MX const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'no_grad'."
      "  Prototype:\n"
      "    NO_GRAD(MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Importer_type_name(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("Importer_type_name",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      result = casadi::Importer::type_name();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Importer_type_name'."
      "  Prototype:\n"
      "    TYPE_NAME()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_Importer__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  casadi::Importer *result = 0 ;
  
  if (!SWIG_check_num_args("new_Importer",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      result = (casadi::Importer *)new casadi::Importer();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__Importer, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_Importer'."
      "  Prototype:\n"
      "    IMPORTER()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_Importer__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  casadi::Dict const &arg3_defvalue = casadi::Dict() ;
  casadi::Dict *arg3 = (casadi::Dict *) &arg3_defvalue ;
  std::string m1 ;
  std::string m2 ;
  std::map< std::string,casadi::GenericType > m3 ;
  mxArray * _out;
  casadi::Importer *result = 0 ;
  
  if (!SWIG_check_num_args("new_Importer",argc,3,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  if (2<argc) {
    arg3 = &m3;
    if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "struct" "'.");
  }
  {
    try {
      result = (casadi::Importer *)new casadi::Importer((std::string const &)*arg1,(std::string const &)*arg2,(casadi::Dict const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__Importer, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_Importer'."
      "  Prototype:\n"
      "    IMPORTER(char,char,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Importer_test_cast(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::SharedObjectInternal *arg1 = (casadi::SharedObjectInternal *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("Importer_test_cast",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__SharedObjectInternal, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Importer_test_cast" "', argument " "1"" of type '" "casadi::SharedObjectInternal const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::SharedObjectInternal * >(argp1);
  {
    try {
      result = (bool)casadi::Importer::test_cast((casadi::SharedObjectInternal const *)arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Importer_test_cast'."
      "  Prototype:\n"
      "    TEST_CAST(casadi::SharedObjectInternal const *)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Importer_has_plugin(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string m1 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("Importer_has_plugin",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  {
    try {
      result = (bool)casadi::Importer::has_plugin((std::string const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Importer_has_plugin'."
      "  Prototype:\n"
      "    HAS_PLUGIN(char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Importer_load_plugin(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string m1 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("Importer_load_plugin",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  {
    try {
      casadi::Importer::load_plugin((std::string const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Importer_load_plugin'."
      "  Prototype:\n"
      "    LOAD_PLUGIN(char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Importer_doc(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string m1 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("Importer_doc",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  {
    try {
      result = casadi::Importer::doc((std::string const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Importer_doc'."
      "  Prototype:\n"
      "    DOC(char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Importer_plugin_name(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Importer *arg1 = (casadi::Importer *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("Importer_plugin_name",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Importer, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Importer_plugin_name" "', argument " "1"" of type '" "casadi::Importer const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Importer * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Importer const *)arg1)->plugin_name();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Importer_plugin_name'."
      "  Prototype:\n"
      "    PLUGIN_NAME(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Importer_has_function(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Importer *arg1 = (casadi::Importer *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("Importer_has_function",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Importer, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Importer_has_function" "', argument " "1"" of type '" "casadi::Importer const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Importer * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Importer const *)arg1)->has_function((std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Importer_has_function'."
      "  Prototype:\n"
      "    HAS_FUNCTION(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Importer_has_meta(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Importer *arg1 = (casadi::Importer *) 0 ;
  std::string *arg2 = 0 ;
  casadi_int arg3 = (casadi_int) -1 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("Importer_has_meta",argc,3,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Importer, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Importer_has_meta" "', argument " "1"" of type '" "casadi::Importer const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Importer * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Importer const *)arg1)->has_meta((std::string const &)*arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Importer_has_meta'."
      "  Prototype:\n"
      "    HAS_META(self,char,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Importer_get_meta(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Importer *arg1 = (casadi::Importer *) 0 ;
  std::string *arg2 = 0 ;
  casadi_int arg3 = (casadi_int) -1 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("Importer_get_meta",argc,3,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Importer, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Importer_get_meta" "', argument " "1"" of type '" "casadi::Importer const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Importer * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Importer const *)arg1)->get_meta((std::string const &)*arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Importer_get_meta'."
      "  Prototype:\n"
      "    GET_META(self,char,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Importer_inlined(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Importer *arg1 = (casadi::Importer *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("Importer_inlined",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Importer, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Importer_inlined" "', argument " "1"" of type '" "casadi::Importer const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Importer * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::Importer const *)arg1)->inlined((std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Importer_inlined'."
      "  Prototype:\n"
      "    INLINED(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Importer_body(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Importer *arg1 = (casadi::Importer *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("Importer_body",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Importer, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Importer_body" "', argument " "1"" of type '" "casadi::Importer const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Importer * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Importer const *)arg1)->body((std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Importer_body'."
      "  Prototype:\n"
      "    BODY(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Importer_library(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Importer *arg1 = (casadi::Importer *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("Importer_library",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Importer, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Importer_library" "', argument " "1"" of type '" "casadi::Importer const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Importer * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Importer const *)arg1)->library();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Importer_library'."
      "  Prototype:\n"
      "    LIBRARY(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Importer_serialize(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Importer *arg1 = (casadi::Importer *) 0 ;
  casadi::SerializingStream *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("Importer_serialize",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Importer, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Importer_serialize" "', argument " "1"" of type '" "casadi::Importer const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Importer * >(argp1);
  res2 = SWIG_ConvertPtr(argv[1], &argp2, SWIGTYPE_p_casadi__SerializingStream,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Importer_serialize" "', argument " "2"" of type '" "casadi::SerializingStream &""'"); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Importer_serialize" "', argument " "2"" of type '" "casadi::SerializingStream &""'"); 
  }
  arg2 = reinterpret_cast< casadi::SerializingStream * >(argp2);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Importer const *)arg1)->serialize(*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Importer_serialize'."
      "  Prototype:\n"
      "    SERIALIZE(self,casadi::SerializingStream &)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Importer_deserialize(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DeserializingStream *arg1 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Importer result;
  
  if (!SWIG_check_num_args("Importer_deserialize",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_casadi__DeserializingStream,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Importer_deserialize" "', argument " "1"" of type '" "casadi::DeserializingStream &""'"); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Importer_deserialize" "', argument " "1"" of type '" "casadi::DeserializingStream &""'"); 
  }
  arg1 = reinterpret_cast< casadi::DeserializingStream * >(argp1);
  {
    try {
      result = casadi::Importer::deserialize(*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj((new casadi::Importer(static_cast< const casadi::Importer& >(result))), SWIGTYPE_p_casadi__Importer, SWIG_POINTER_OWN |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Importer_deserialize'."
      "  Prototype:\n"
      "    DESERIALIZE(casadi::DeserializingStream &)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_Importer__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Importer *arg1 = 0 ;
  void *argp1 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Importer *result = 0 ;
  
  if (!SWIG_check_num_args("new_Importer",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_casadi__Importer,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_Importer" "', argument " "1"" of type '" "casadi::Importer const &""'"); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_Importer" "', argument " "1"" of type '" "casadi::Importer const &""'"); 
  }
  arg1 = reinterpret_cast< casadi::Importer * >(argp1);
  {
    result = (casadi::Importer *)new casadi::Importer((casadi::Importer const &)*arg1);
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__Importer, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_Importer'."
      "  Prototype:\n"
      "    IMPORTER(Importer)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_Importer(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 0) {
    return _wrap_new_Importer__SWIG_0(resc,resv,argc,argv);
  }
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Importer, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_new_Importer__SWIG_2(resc,resv,argc,argv);
    }
  }
  if ((argc >= 2) && (argc <= 3)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::string **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_new_Importer__SWIG_1(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< std::map<std::string,casadi::GenericType> **>(0));
        if (_v) {
          return _wrap_new_Importer__SWIG_1(resc,resv,argc,argv);
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_Importer'."
    "  Possible prototypes are:\n"
    "    IMPORTER()\n"
    "    IMPORTER(Importer)\n"
    "    IMPORTER(char,char,struct)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_delete_Importer(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Importer *arg1 = (casadi::Importer *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  int is_owned;
  if (!SWIG_check_num_args("delete_Importer",argc,1,1,0)) {
    SWIG_fail;
  }
  is_owned = SWIG_Matlab_isOwned(argv[0]);
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Importer, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Importer" "', argument " "1"" of type '" "casadi::Importer *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Importer * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  if (is_owned) {
    {
      delete arg1;
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'delete_Importer'."
      "  Prototype:\n"
      "    IMPORTER(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Callback_type_name(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("Callback_type_name",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      result = casadi::Callback::type_name();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Callback_type_name'."
      "  Prototype:\n"
      "    TYPE_NAME()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_Callback__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray *arg1 = (mxArray *) 0 ;
  mxArray * _out;
  casadi::Callback *result = 0 ;
  
  if (!SWIG_check_num_args("new_Callback",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = argv[0];
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      if ( !mxIsNumeric(arg1) ) {
        /* subclassed */
        result = (casadi::Callback *)new SwigDirector_Callback(arg1); 
      } else {
        result = (casadi::Callback *)new casadi::Callback(); 
      }
      
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__Callback, 1 |  0 );
  if (!mxIsNumeric(arg1)) {
    SwigPtr* thisPtr = SWIG_Matlab_getSwigPtr(_out);
    SwigPtr* thatPtr = SWIG_Matlab_getSwigPtr(arg1);
    thisPtr->next = thatPtr;
  }
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_Callback'."
      "  Prototype:\n"
      "    CALLBACK(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_Callback__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray *arg1 = (mxArray *) 0 ;
  casadi::Callback *arg2 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  mxArray * _out;
  casadi::Callback *result = 0 ;
  
  if (!SWIG_check_num_args("new_Callback",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = argv[0];
  res2 = SWIG_ConvertPtr(argv[1], &argp2, SWIGTYPE_p_casadi__Callback,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_Callback" "', argument " "2"" of type '" "casadi::Callback const &""'"); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_Callback" "', argument " "2"" of type '" "casadi::Callback const &""'"); 
  }
  arg2 = reinterpret_cast< casadi::Callback * >(argp2);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      if ( !mxIsNumeric(arg1) ) {
        /* subclassed */
        result = (casadi::Callback *)new SwigDirector_Callback(arg1,(casadi::Callback const &)*arg2); 
      } else {
        result = (casadi::Callback *)new casadi::Callback((casadi::Callback const &)*arg2); 
      }
      
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__Callback, 1 |  0 );
  if (!mxIsNumeric(arg1)) {
    SwigPtr* thisPtr = SWIG_Matlab_getSwigPtr(_out);
    SwigPtr* thatPtr = SWIG_Matlab_getSwigPtr(arg1);
    thisPtr->next = thatPtr;
  }
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_Callback'."
      "  Prototype:\n"
      "    CALLBACK(self,Callback)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_Callback(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = mxGetClassID(argv[0]) != mxUNKNOWN_CLASS;
    if (_v) {
      return _wrap_new_Callback__SWIG_0(resc,resv,argc,argv);
    }
  }
  if (argc == 2) {
    int _v;
    _v = mxGetClassID(argv[0]) != mxUNKNOWN_CLASS;
    if (_v) {
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_casadi__Callback, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap_new_Callback__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_Callback'."
    "  Possible prototypes are:\n"
    "    CALLBACK(self)\n"
    "    CALLBACK(self,Callback)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_delete_Callback(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Callback *arg1 = (casadi::Callback *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  int is_owned;
  if (!SWIG_check_num_args("delete_Callback",argc,1,1,0)) {
    SWIG_fail;
  }
  is_owned = SWIG_Matlab_isOwned(argv[0]);
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Callback, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Callback" "', argument " "1"" of type '" "casadi::Callback *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Callback * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  if (is_owned) {
    {
      try {
        delete arg1;
      } catch(const std::exception& e) {
        SWIG_exception(SWIG_RuntimeError, e.what());
      }
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'delete_Callback'."
      "  Prototype:\n"
      "    CALLBACK(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Callback_construct(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Callback *arg1 = (casadi::Callback *) 0 ;
  std::string *arg2 = 0 ;
  casadi::Dict const &arg3_defvalue = casadi::Dict() ;
  casadi::Dict *arg3 = (casadi::Dict *) &arg3_defvalue ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  std::map< std::string,casadi::GenericType > m3 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("Callback_construct",argc,3,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Callback, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Callback_construct" "', argument " "1"" of type '" "casadi::Callback *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Callback * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  if (2<argc) {
    arg3 = &m3;
    if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "struct" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->construct((std::string const &)*arg2,(casadi::Dict const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Callback_construct'."
      "  Prototype:\n"
      "    CONSTRUCT(self,char,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Callback_init(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Callback *arg1 = (casadi::Callback *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Swig::Director *director = 0;
  bool upcall = false;
  mxArray * _out;
  
  if (!SWIG_check_num_args("Callback_init",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Callback, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Callback_init" "', argument " "1"" of type '" "casadi::Callback *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Callback * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  director = SWIG_DIRECTOR_CAST(arg1);
  upcall = director;
  try {
    {
      try {
        if (upcall) {
          (arg1)->casadi::Callback::init();
        } else {
          (arg1)->init();
        }
      } catch(const std::exception& e) {
        SWIG_exception(SWIG_RuntimeError, e.what());
      }
    }
  } catch (Swig::DirectorException&) {
    SWIG_fail;
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Callback_init'."
      "  Prototype:\n"
      "    INIT(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Callback_finalize(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Callback *arg1 = (casadi::Callback *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Swig::Director *director = 0;
  bool upcall = false;
  mxArray * _out;
  
  if (!SWIG_check_num_args("Callback_finalize",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Callback, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Callback_finalize" "', argument " "1"" of type '" "casadi::Callback *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Callback * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  director = SWIG_DIRECTOR_CAST(arg1);
  upcall = director;
  try {
    {
      try {
        if (upcall) {
          (arg1)->casadi::Callback::finalize();
        } else {
          (arg1)->finalize();
        }
      } catch(const std::exception& e) {
        SWIG_exception(SWIG_RuntimeError, e.what());
      }
    }
  } catch (Swig::DirectorException&) {
    SWIG_fail;
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Callback_finalize'."
      "  Prototype:\n"
      "    FINALIZE(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Callback_eval(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Callback *arg1 = (casadi::Callback *) 0 ;
  std::vector< casadi::DM,std::allocator< casadi::DM > > *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< casadi::Matrix< double > > m2 ;
  Swig::Director *director = 0;
  bool upcall = false;
  mxArray * _out;
  std::vector< casadi::DM,std::allocator< casadi::DM > > result;
  
  if (!SWIG_check_num_args("Callback_eval",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Callback, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Callback_eval" "', argument " "1"" of type '" "casadi::Callback const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Callback * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "DM" "}" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  director = SWIG_DIRECTOR_CAST(arg1);
  upcall = director;
  try {
    {
      try {
        if (upcall) {
          result = ((casadi::Callback const *)arg1)->casadi::Callback::eval((std::vector< casadi::DM,std::allocator< casadi::DM > > const &)*arg2);
        } else {
          result = ((casadi::Callback const *)arg1)->eval((std::vector< casadi::DM,std::allocator< casadi::DM > > const &)*arg2);
        }
      } catch(const std::exception& e) {
        SWIG_exception(SWIG_RuntimeError, e.what());
      }
    }
  } catch (Swig::DirectorException&) {
    SWIG_fail;
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "DM" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Callback_eval'."
      "  Prototype:\n"
      "    EVAL(self,{DM})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Callback_eval_buffer(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Callback *arg1 = (casadi::Callback *) 0 ;
  double **arg2 = (double **) 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg3 = 0 ;
  double **arg4 = (double **) 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg5 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  std::vector< casadi_int > m3 ;
  void *argp4 = 0 ;
  int res4 = 0 ;
  std::vector< casadi_int > m5 ;
  Swig::Director *director = 0;
  bool upcall = false;
  mxArray * _out;
  int result;
  
  if (!SWIG_check_num_args("Callback_eval_buffer",argc,5,5,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Callback, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Callback_eval_buffer" "', argument " "1"" of type '" "casadi::Callback const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Callback * >(argp1);
  res2 = SWIG_ConvertPtr(argv[1], &argp2,SWIGTYPE_p_p_double, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Callback_eval_buffer" "', argument " "2"" of type '" "double const **""'"); 
  }
  arg2 = reinterpret_cast< double ** >(argp2);
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "[" "int" "]" "'.");
  res4 = SWIG_ConvertPtr(argv[3], &argp4,SWIGTYPE_p_p_double, 0 |  0 );
  if (!SWIG_IsOK(res4)) {
    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Callback_eval_buffer" "', argument " "4"" of type '" "double **""'"); 
  }
  arg4 = reinterpret_cast< double ** >(argp4);
  arg5 = &m5;
  if (!casadi::to_ptr(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "[" "int" "]" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  director = SWIG_DIRECTOR_CAST(arg1);
  upcall = director;
  try {
    {
      try {
        if (upcall) {
          result = (int)((casadi::Callback const *)arg1)->casadi::Callback::eval_buffer((double const **)arg2,(std::vector< casadi_int,std::allocator< casadi_int > > const &)*arg3,arg4,(std::vector< casadi_int,std::allocator< casadi_int > > const &)*arg5);
        } else {
          result = (int)((casadi::Callback const *)arg1)->eval_buffer((double const **)arg2,(std::vector< casadi_int,std::allocator< casadi_int > > const &)*arg3,arg4,(std::vector< casadi_int,std::allocator< casadi_int > > const &)*arg5);
        }
      } catch(const std::exception& e) {
        SWIG_exception(SWIG_RuntimeError, e.what());
      }
    }
  } catch (Swig::DirectorException&) {
    SWIG_fail;
  }
  _out = SWIG_From_int(static_cast< int >(result));
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Callback_eval_buffer'."
      "  Prototype:\n"
      "    EVAL_BUFFER(self,double const **,[int],double **,[int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Callback_has_eval_buffer(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Callback *arg1 = (casadi::Callback *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Swig::Director *director = 0;
  bool upcall = false;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("Callback_has_eval_buffer",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Callback, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Callback_has_eval_buffer" "', argument " "1"" of type '" "casadi::Callback const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Callback * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  director = SWIG_DIRECTOR_CAST(arg1);
  upcall = director;
  try {
    {
      try {
        if (upcall) {
          result = (bool)((casadi::Callback const *)arg1)->casadi::Callback::has_eval_buffer();
        } else {
          result = (bool)((casadi::Callback const *)arg1)->has_eval_buffer();
        }
      } catch(const std::exception& e) {
        SWIG_exception(SWIG_RuntimeError, e.what());
      }
    }
  } catch (Swig::DirectorException&) {
    SWIG_fail;
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Callback_has_eval_buffer'."
      "  Prototype:\n"
      "    HAS_EVAL_BUFFER(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Callback_get_n_in(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Callback *arg1 = (casadi::Callback *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Swig::Director *director = 0;
  bool upcall = false;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("Callback_get_n_in",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Callback, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Callback_get_n_in" "', argument " "1"" of type '" "casadi::Callback *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Callback * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  director = SWIG_DIRECTOR_CAST(arg1);
  upcall = director;
  try {
    {
      try {
        if (upcall) {
          result = (casadi_int)(arg1)->casadi::Callback::get_n_in();
        } else {
          result = (casadi_int)(arg1)->get_n_in();
        }
      } catch(const std::exception& e) {
        SWIG_exception(SWIG_RuntimeError, e.what());
      }
    }
  } catch (Swig::DirectorException&) {
    SWIG_fail;
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Callback_get_n_in'."
      "  Prototype:\n"
      "    GET_N_IN(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Callback_get_n_out(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Callback *arg1 = (casadi::Callback *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Swig::Director *director = 0;
  bool upcall = false;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("Callback_get_n_out",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Callback, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Callback_get_n_out" "', argument " "1"" of type '" "casadi::Callback *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Callback * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  director = SWIG_DIRECTOR_CAST(arg1);
  upcall = director;
  try {
    {
      try {
        if (upcall) {
          result = (casadi_int)(arg1)->casadi::Callback::get_n_out();
        } else {
          result = (casadi_int)(arg1)->get_n_out();
        }
      } catch(const std::exception& e) {
        SWIG_exception(SWIG_RuntimeError, e.what());
      }
    }
  } catch (Swig::DirectorException&) {
    SWIG_fail;
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Callback_get_n_out'."
      "  Prototype:\n"
      "    GET_N_OUT(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Callback_get_sparsity_in(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Callback *arg1 = (casadi::Callback *) 0 ;
  casadi_int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Swig::Director *director = 0;
  bool upcall = false;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("Callback_get_sparsity_in",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Callback, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Callback_get_sparsity_in" "', argument " "1"" of type '" "casadi::Callback *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Callback * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  director = SWIG_DIRECTOR_CAST(arg1);
  upcall = director;
  try {
    {
      try {
        if (upcall) {
          result = (arg1)->casadi::Callback::get_sparsity_in(arg2);
        } else {
          result = (arg1)->get_sparsity_in(arg2);
        }
      } catch(const std::exception& e) {
        SWIG_exception(SWIG_RuntimeError, e.what());
      }
    }
  } catch (Swig::DirectorException&) {
    SWIG_fail;
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Callback_get_sparsity_in'."
      "  Prototype:\n"
      "    GET_SPARSITY_IN(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Callback_get_sparsity_out(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Callback *arg1 = (casadi::Callback *) 0 ;
  casadi_int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Swig::Director *director = 0;
  bool upcall = false;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("Callback_get_sparsity_out",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Callback, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Callback_get_sparsity_out" "', argument " "1"" of type '" "casadi::Callback *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Callback * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  director = SWIG_DIRECTOR_CAST(arg1);
  upcall = director;
  try {
    {
      try {
        if (upcall) {
          result = (arg1)->casadi::Callback::get_sparsity_out(arg2);
        } else {
          result = (arg1)->get_sparsity_out(arg2);
        }
      } catch(const std::exception& e) {
        SWIG_exception(SWIG_RuntimeError, e.what());
      }
    }
  } catch (Swig::DirectorException&) {
    SWIG_fail;
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Callback_get_sparsity_out'."
      "  Prototype:\n"
      "    GET_SPARSITY_OUT(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Callback_get_name_in(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Callback *arg1 = (casadi::Callback *) 0 ;
  casadi_int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Swig::Director *director = 0;
  bool upcall = false;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("Callback_get_name_in",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Callback, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Callback_get_name_in" "', argument " "1"" of type '" "casadi::Callback *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Callback * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  director = SWIG_DIRECTOR_CAST(arg1);
  upcall = director;
  try {
    {
      try {
        if (upcall) {
          result = (arg1)->casadi::Callback::get_name_in(arg2);
        } else {
          result = (arg1)->get_name_in(arg2);
        }
      } catch(const std::exception& e) {
        SWIG_exception(SWIG_RuntimeError, e.what());
      }
    }
  } catch (Swig::DirectorException&) {
    SWIG_fail;
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Callback_get_name_in'."
      "  Prototype:\n"
      "    GET_NAME_IN(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Callback_get_name_out(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Callback *arg1 = (casadi::Callback *) 0 ;
  casadi_int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Swig::Director *director = 0;
  bool upcall = false;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("Callback_get_name_out",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Callback, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Callback_get_name_out" "', argument " "1"" of type '" "casadi::Callback *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Callback * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  director = SWIG_DIRECTOR_CAST(arg1);
  upcall = director;
  try {
    {
      try {
        if (upcall) {
          result = (arg1)->casadi::Callback::get_name_out(arg2);
        } else {
          result = (arg1)->get_name_out(arg2);
        }
      } catch(const std::exception& e) {
        SWIG_exception(SWIG_RuntimeError, e.what());
      }
    }
  } catch (Swig::DirectorException&) {
    SWIG_fail;
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Callback_get_name_out'."
      "  Prototype:\n"
      "    GET_NAME_OUT(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Callback_uses_output(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Callback *arg1 = (casadi::Callback *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Swig::Director *director = 0;
  bool upcall = false;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("Callback_uses_output",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Callback, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Callback_uses_output" "', argument " "1"" of type '" "casadi::Callback const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Callback * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  director = SWIG_DIRECTOR_CAST(arg1);
  upcall = director;
  try {
    {
      try {
        if (upcall) {
          result = (bool)((casadi::Callback const *)arg1)->casadi::Callback::uses_output();
        } else {
          result = (bool)((casadi::Callback const *)arg1)->uses_output();
        }
      } catch(const std::exception& e) {
        SWIG_exception(SWIG_RuntimeError, e.what());
      }
    }
  } catch (Swig::DirectorException&) {
    SWIG_fail;
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Callback_uses_output'."
      "  Prototype:\n"
      "    USES_OUTPUT(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Callback_has_jacobian(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Callback *arg1 = (casadi::Callback *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Swig::Director *director = 0;
  bool upcall = false;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("Callback_has_jacobian",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Callback, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Callback_has_jacobian" "', argument " "1"" of type '" "casadi::Callback const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Callback * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  director = SWIG_DIRECTOR_CAST(arg1);
  upcall = director;
  try {
    {
      try {
        if (upcall) {
          result = (bool)((casadi::Callback const *)arg1)->casadi::Callback::has_jacobian();
        } else {
          result = (bool)((casadi::Callback const *)arg1)->has_jacobian();
        }
      } catch(const std::exception& e) {
        SWIG_exception(SWIG_RuntimeError, e.what());
      }
    }
  } catch (Swig::DirectorException&) {
    SWIG_fail;
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Callback_has_jacobian'."
      "  Prototype:\n"
      "    HAS_JACOBIAN(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Callback_get_jacobian(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Callback *arg1 = (casadi::Callback *) 0 ;
  std::string *arg2 = 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg3 = 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg4 = 0 ;
  casadi::Dict *arg5 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  std::vector< std::string > m3 ;
  std::vector< std::string > m4 ;
  std::map< std::string,casadi::GenericType > m5 ;
  Swig::Director *director = 0;
  bool upcall = false;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("Callback_get_jacobian",argc,5,5,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Callback, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Callback_get_jacobian" "', argument " "1"" of type '" "casadi::Callback const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Callback * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "{" "char" "}" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "{" "char" "}" "'.");
  arg5 = &m5;
  if (!casadi::to_ptr(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "struct" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  director = SWIG_DIRECTOR_CAST(arg1);
  upcall = director;
  try {
    {
      try {
        if (upcall) {
          result = ((casadi::Callback const *)arg1)->casadi::Callback::get_jacobian((std::string const &)*arg2,(std::vector< std::string,std::allocator< std::string > > const &)*arg3,(std::vector< std::string,std::allocator< std::string > > const &)*arg4,(casadi::Dict const &)*arg5);
        } else {
          result = ((casadi::Callback const *)arg1)->get_jacobian((std::string const &)*arg2,(std::vector< std::string,std::allocator< std::string > > const &)*arg3,(std::vector< std::string,std::allocator< std::string > > const &)*arg4,(casadi::Dict const &)*arg5);
        }
      } catch(const std::exception& e) {
        SWIG_exception(SWIG_RuntimeError, e.what());
      }
    }
  } catch (Swig::DirectorException&) {
    SWIG_fail;
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Callback_get_jacobian'."
      "  Prototype:\n"
      "    GET_JACOBIAN(self,char,{char},{char},struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Callback_has_forward(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Callback *arg1 = (casadi::Callback *) 0 ;
  casadi_int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Swig::Director *director = 0;
  bool upcall = false;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("Callback_has_forward",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Callback, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Callback_has_forward" "', argument " "1"" of type '" "casadi::Callback const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Callback * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  director = SWIG_DIRECTOR_CAST(arg1);
  upcall = director;
  try {
    {
      try {
        if (upcall) {
          result = (bool)((casadi::Callback const *)arg1)->casadi::Callback::has_forward(arg2);
        } else {
          result = (bool)((casadi::Callback const *)arg1)->has_forward(arg2);
        }
      } catch(const std::exception& e) {
        SWIG_exception(SWIG_RuntimeError, e.what());
      }
    }
  } catch (Swig::DirectorException&) {
    SWIG_fail;
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Callback_has_forward'."
      "  Prototype:\n"
      "    HAS_FORWARD(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Callback_get_forward(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Callback *arg1 = (casadi::Callback *) 0 ;
  casadi_int arg2 ;
  std::string *arg3 = 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg4 = 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg5 = 0 ;
  casadi::Dict *arg6 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m3 ;
  std::vector< std::string > m4 ;
  std::vector< std::string > m5 ;
  std::map< std::string,casadi::GenericType > m6 ;
  Swig::Director *director = 0;
  bool upcall = false;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("Callback_get_forward",argc,6,6,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Callback, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Callback_get_forward" "', argument " "1"" of type '" "casadi::Callback const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Callback * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "char" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "{" "char" "}" "'.");
  arg5 = &m5;
  if (!casadi::to_ptr(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "{" "char" "}" "'.");
  arg6 = &m6;
  if (!casadi::to_ptr(argv[5], &arg6)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 6 to type '" "struct" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  director = SWIG_DIRECTOR_CAST(arg1);
  upcall = director;
  try {
    {
      try {
        if (upcall) {
          result = ((casadi::Callback const *)arg1)->casadi::Callback::get_forward(arg2,(std::string const &)*arg3,(std::vector< std::string,std::allocator< std::string > > const &)*arg4,(std::vector< std::string,std::allocator< std::string > > const &)*arg5,(casadi::Dict const &)*arg6);
        } else {
          result = ((casadi::Callback const *)arg1)->get_forward(arg2,(std::string const &)*arg3,(std::vector< std::string,std::allocator< std::string > > const &)*arg4,(std::vector< std::string,std::allocator< std::string > > const &)*arg5,(casadi::Dict const &)*arg6);
        }
      } catch(const std::exception& e) {
        SWIG_exception(SWIG_RuntimeError, e.what());
      }
    }
  } catch (Swig::DirectorException&) {
    SWIG_fail;
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Callback_get_forward'."
      "  Prototype:\n"
      "    GET_FORWARD(self,int,char,{char},{char},struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Callback_has_reverse(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Callback *arg1 = (casadi::Callback *) 0 ;
  casadi_int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Swig::Director *director = 0;
  bool upcall = false;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("Callback_has_reverse",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Callback, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Callback_has_reverse" "', argument " "1"" of type '" "casadi::Callback const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Callback * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  director = SWIG_DIRECTOR_CAST(arg1);
  upcall = director;
  try {
    {
      try {
        if (upcall) {
          result = (bool)((casadi::Callback const *)arg1)->casadi::Callback::has_reverse(arg2);
        } else {
          result = (bool)((casadi::Callback const *)arg1)->has_reverse(arg2);
        }
      } catch(const std::exception& e) {
        SWIG_exception(SWIG_RuntimeError, e.what());
      }
    }
  } catch (Swig::DirectorException&) {
    SWIG_fail;
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Callback_has_reverse'."
      "  Prototype:\n"
      "    HAS_REVERSE(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Callback_get_reverse(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Callback *arg1 = (casadi::Callback *) 0 ;
  casadi_int arg2 ;
  std::string *arg3 = 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg4 = 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg5 = 0 ;
  casadi::Dict *arg6 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m3 ;
  std::vector< std::string > m4 ;
  std::vector< std::string > m5 ;
  std::map< std::string,casadi::GenericType > m6 ;
  Swig::Director *director = 0;
  bool upcall = false;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("Callback_get_reverse",argc,6,6,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Callback, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Callback_get_reverse" "', argument " "1"" of type '" "casadi::Callback const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Callback * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "char" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "{" "char" "}" "'.");
  arg5 = &m5;
  if (!casadi::to_ptr(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "{" "char" "}" "'.");
  arg6 = &m6;
  if (!casadi::to_ptr(argv[5], &arg6)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 6 to type '" "struct" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  director = SWIG_DIRECTOR_CAST(arg1);
  upcall = director;
  try {
    {
      try {
        if (upcall) {
          result = ((casadi::Callback const *)arg1)->casadi::Callback::get_reverse(arg2,(std::string const &)*arg3,(std::vector< std::string,std::allocator< std::string > > const &)*arg4,(std::vector< std::string,std::allocator< std::string > > const &)*arg5,(casadi::Dict const &)*arg6);
        } else {
          result = ((casadi::Callback const *)arg1)->get_reverse(arg2,(std::string const &)*arg3,(std::vector< std::string,std::allocator< std::string > > const &)*arg4,(std::vector< std::string,std::allocator< std::string > > const &)*arg5,(casadi::Dict const &)*arg6);
        }
      } catch(const std::exception& e) {
        SWIG_exception(SWIG_RuntimeError, e.what());
      }
    }
  } catch (Swig::DirectorException&) {
    SWIG_fail;
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Callback_get_reverse'."
      "  Prototype:\n"
      "    GET_REVERSE(self,int,char,{char},{char},struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Callback_has_jac_sparsity(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Callback *arg1 = (casadi::Callback *) 0 ;
  casadi_int arg2 ;
  casadi_int arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Swig::Director *director = 0;
  bool upcall = false;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("Callback_has_jac_sparsity",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Callback, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Callback_has_jac_sparsity" "', argument " "1"" of type '" "casadi::Callback const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Callback * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  director = SWIG_DIRECTOR_CAST(arg1);
  upcall = director;
  try {
    {
      try {
        if (upcall) {
          result = (bool)((casadi::Callback const *)arg1)->casadi::Callback::has_jac_sparsity(arg2,arg3);
        } else {
          result = (bool)((casadi::Callback const *)arg1)->has_jac_sparsity(arg2,arg3);
        }
      } catch(const std::exception& e) {
        SWIG_exception(SWIG_RuntimeError, e.what());
      }
    }
  } catch (Swig::DirectorException&) {
    SWIG_fail;
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Callback_has_jac_sparsity'."
      "  Prototype:\n"
      "    HAS_JAC_SPARSITY(self,int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Callback_get_jac_sparsity(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Callback *arg1 = (casadi::Callback *) 0 ;
  casadi_int arg2 ;
  casadi_int arg3 ;
  bool arg4 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Swig::Director *director = 0;
  bool upcall = false;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("Callback_get_jac_sparsity",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Callback, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Callback_get_jac_sparsity" "', argument " "1"" of type '" "casadi::Callback const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Callback * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  if (!casadi::to_val(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "bool" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  director = SWIG_DIRECTOR_CAST(arg1);
  upcall = director;
  try {
    {
      try {
        if (upcall) {
          result = ((casadi::Callback const *)arg1)->casadi::Callback::get_jac_sparsity(arg2,arg3,arg4);
        } else {
          result = ((casadi::Callback const *)arg1)->get_jac_sparsity(arg2,arg3,arg4);
        }
      } catch(const std::exception& e) {
        SWIG_exception(SWIG_RuntimeError, e.what());
      }
    }
  } catch (Swig::DirectorException&) {
    SWIG_fail;
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Callback_get_jac_sparsity'."
      "  Prototype:\n"
      "    GET_JAC_SPARSITY(self,int,int,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_disown_Callback(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Callback *arg1 = (casadi::Callback *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("disown_Callback",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Callback, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "disown_Callback" "', argument " "1"" of type '" "casadi::Callback *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Callback * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    Swig::Director *director = SWIG_DIRECTOR_CAST(arg1);
    if (director) director->swig_disown();
  }
  
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_GlobalOptions_setSimplificationOnTheFly(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  bool arg1 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("GlobalOptions_setSimplificationOnTheFly",argc,1,1,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "bool" "'.");
  {
    try {
      casadi::GlobalOptions::setSimplificationOnTheFly(arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GlobalOptions_setSimplificationOnTheFly'."
      "  Prototype:\n"
      "    SETSIMPLIFICATIONONTHEFLY(bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GlobalOptions_getSimplificationOnTheFly(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("GlobalOptions_getSimplificationOnTheFly",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      result = (bool)casadi::GlobalOptions::getSimplificationOnTheFly();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GlobalOptions_getSimplificationOnTheFly'."
      "  Prototype:\n"
      "    GETSIMPLIFICATIONONTHEFLY()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GlobalOptions_setHierarchicalSparsity(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  bool arg1 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("GlobalOptions_setHierarchicalSparsity",argc,1,1,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "bool" "'.");
  {
    try {
      casadi::GlobalOptions::setHierarchicalSparsity(arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GlobalOptions_setHierarchicalSparsity'."
      "  Prototype:\n"
      "    SETHIERARCHICALSPARSITY(bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GlobalOptions_getHierarchicalSparsity(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("GlobalOptions_getHierarchicalSparsity",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      result = (bool)casadi::GlobalOptions::getHierarchicalSparsity();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GlobalOptions_getHierarchicalSparsity'."
      "  Prototype:\n"
      "    GETHIERARCHICALSPARSITY()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GlobalOptions_setCasadiPath(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string m1 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("GlobalOptions_setCasadiPath",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  {
    try {
      casadi::GlobalOptions::setCasadiPath((std::string const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GlobalOptions_setCasadiPath'."
      "  Prototype:\n"
      "    SETCASADIPATH(char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GlobalOptions_getCasadiPath(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("GlobalOptions_getCasadiPath",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      result = casadi::GlobalOptions::getCasadiPath();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GlobalOptions_getCasadiPath'."
      "  Prototype:\n"
      "    GETCASADIPATH()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GlobalOptions_setCasadiIncludePath(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string m1 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("GlobalOptions_setCasadiIncludePath",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  {
    try {
      casadi::GlobalOptions::setCasadiIncludePath((std::string const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GlobalOptions_setCasadiIncludePath'."
      "  Prototype:\n"
      "    SETCASADIINCLUDEPATH(char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GlobalOptions_getCasadiIncludePath(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("GlobalOptions_getCasadiIncludePath",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      result = casadi::GlobalOptions::getCasadiIncludePath();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GlobalOptions_getCasadiIncludePath'."
      "  Prototype:\n"
      "    GETCASADIINCLUDEPATH()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GlobalOptions_setMaxNumDir(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("GlobalOptions_setMaxNumDir",argc,1,1,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  {
    try {
      casadi::GlobalOptions::setMaxNumDir(arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GlobalOptions_setMaxNumDir'."
      "  Prototype:\n"
      "    SETMAXNUMDIR(int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_GlobalOptions_getMaxNumDir(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("GlobalOptions_getMaxNumDir",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      result = (casadi_int)casadi::GlobalOptions::getMaxNumDir();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'GlobalOptions_getMaxNumDir'."
      "  Prototype:\n"
      "    GETMAXNUMDIR()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_GlobalOptions(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GlobalOptions *arg1 = 0 ;
  void *argp1 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::GlobalOptions *result = 0 ;
  
  if (!SWIG_check_num_args("new_GlobalOptions",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_casadi__GlobalOptions,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_GlobalOptions" "', argument " "1"" of type '" "casadi::GlobalOptions const &""'"); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_GlobalOptions" "', argument " "1"" of type '" "casadi::GlobalOptions const &""'"); 
  }
  arg1 = reinterpret_cast< casadi::GlobalOptions * >(argp1);
  {
    result = (casadi::GlobalOptions *)new casadi::GlobalOptions((casadi::GlobalOptions const &)*arg1);
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__GlobalOptions, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_GlobalOptions'."
      "  Prototype:\n"
      "    GLOBALOPTIONS(GlobalOptions)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_delete_GlobalOptions(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::GlobalOptions *arg1 = (casadi::GlobalOptions *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  int is_owned;
  if (!SWIG_check_num_args("delete_GlobalOptions",argc,1,1,0)) {
    SWIG_fail;
  }
  is_owned = SWIG_Matlab_isOwned(argv[0]);
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__GlobalOptions, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GlobalOptions" "', argument " "1"" of type '" "casadi::GlobalOptions *""'"); 
  }
  arg1 = reinterpret_cast< casadi::GlobalOptions * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  if (is_owned) {
    {
      delete arg1;
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'delete_GlobalOptions'."
      "  Prototype:\n"
      "    GLOBALOPTIONS(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_CasadiMeta_version(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  char *result = 0 ;
  
  if (!SWIG_check_num_args("CasadiMeta_version",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      result = (char *)casadi::CasadiMeta::version();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_FromCharPtr((const char *)result);
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'CasadiMeta_version'."
      "  Prototype:\n"
      "    VERSION()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_CasadiMeta_git_revision(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  char *result = 0 ;
  
  if (!SWIG_check_num_args("CasadiMeta_git_revision",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      result = (char *)casadi::CasadiMeta::git_revision();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_FromCharPtr((const char *)result);
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'CasadiMeta_git_revision'."
      "  Prototype:\n"
      "    GIT_REVISION()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_CasadiMeta_git_describe(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  char *result = 0 ;
  
  if (!SWIG_check_num_args("CasadiMeta_git_describe",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      result = (char *)casadi::CasadiMeta::git_describe();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_FromCharPtr((const char *)result);
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'CasadiMeta_git_describe'."
      "  Prototype:\n"
      "    GIT_DESCRIBE()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_CasadiMeta_feature_list(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  char *result = 0 ;
  
  if (!SWIG_check_num_args("CasadiMeta_feature_list",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      result = (char *)casadi::CasadiMeta::feature_list();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_FromCharPtr((const char *)result);
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'CasadiMeta_feature_list'."
      "  Prototype:\n"
      "    FEATURE_LIST()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_CasadiMeta_build_type(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  char *result = 0 ;
  
  if (!SWIG_check_num_args("CasadiMeta_build_type",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      result = (char *)casadi::CasadiMeta::build_type();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_FromCharPtr((const char *)result);
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'CasadiMeta_build_type'."
      "  Prototype:\n"
      "    BUILD_TYPE()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_CasadiMeta_compiler_id(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  char *result = 0 ;
  
  if (!SWIG_check_num_args("CasadiMeta_compiler_id",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      result = (char *)casadi::CasadiMeta::compiler_id();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_FromCharPtr((const char *)result);
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'CasadiMeta_compiler_id'."
      "  Prototype:\n"
      "    COMPILER_ID()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_CasadiMeta_compiler(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  char *result = 0 ;
  
  if (!SWIG_check_num_args("CasadiMeta_compiler",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      result = (char *)casadi::CasadiMeta::compiler();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_FromCharPtr((const char *)result);
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'CasadiMeta_compiler'."
      "  Prototype:\n"
      "    COMPILER()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_CasadiMeta_compiler_flags(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  char *result = 0 ;
  
  if (!SWIG_check_num_args("CasadiMeta_compiler_flags",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      result = (char *)casadi::CasadiMeta::compiler_flags();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_FromCharPtr((const char *)result);
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'CasadiMeta_compiler_flags'."
      "  Prototype:\n"
      "    COMPILER_FLAGS()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_CasadiMeta_modules(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  char *result = 0 ;
  
  if (!SWIG_check_num_args("CasadiMeta_modules",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      result = (char *)casadi::CasadiMeta::modules();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_FromCharPtr((const char *)result);
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'CasadiMeta_modules'."
      "  Prototype:\n"
      "    MODULES()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_CasadiMeta_plugins(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  char *result = 0 ;
  
  if (!SWIG_check_num_args("CasadiMeta_plugins",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      result = (char *)casadi::CasadiMeta::plugins();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_FromCharPtr((const char *)result);
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'CasadiMeta_plugins'."
      "  Prototype:\n"
      "    PLUGINS()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_CasadiMeta_install_prefix(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  char *result = 0 ;
  
  if (!SWIG_check_num_args("CasadiMeta_install_prefix",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      result = (char *)casadi::CasadiMeta::install_prefix();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_FromCharPtr((const char *)result);
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'CasadiMeta_install_prefix'."
      "  Prototype:\n"
      "    INSTALL_PREFIX()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_CasadiMeta(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::CasadiMeta *arg1 = 0 ;
  void *argp1 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::CasadiMeta *result = 0 ;
  
  if (!SWIG_check_num_args("new_CasadiMeta",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_casadi__CasadiMeta,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_CasadiMeta" "', argument " "1"" of type '" "casadi::CasadiMeta const &""'"); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_CasadiMeta" "', argument " "1"" of type '" "casadi::CasadiMeta const &""'"); 
  }
  arg1 = reinterpret_cast< casadi::CasadiMeta * >(argp1);
  {
    result = (casadi::CasadiMeta *)new casadi::CasadiMeta((casadi::CasadiMeta const &)*arg1);
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__CasadiMeta, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_CasadiMeta'."
      "  Prototype:\n"
      "    CASADIMETA(CasadiMeta)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_delete_CasadiMeta(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::CasadiMeta *arg1 = (casadi::CasadiMeta *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  int is_owned;
  if (!SWIG_check_num_args("delete_CasadiMeta",argc,1,1,0)) {
    SWIG_fail;
  }
  is_owned = SWIG_Matlab_isOwned(argv[0]);
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__CasadiMeta, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_CasadiMeta" "', argument " "1"" of type '" "casadi::CasadiMeta *""'"); 
  }
  arg1 = reinterpret_cast< casadi::CasadiMeta * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  if (is_owned) {
    {
      delete arg1;
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'delete_CasadiMeta'."
      "  Prototype:\n"
      "    CASADIMETA(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_collocation_points(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi_int arg1 ;
  std::string const &arg2_defvalue = "radau" ;
  std::string *arg2 = (std::string *) &arg2_defvalue ;
  std::string m2 ;
  mxArray * _out;
  std::vector< double,std::allocator< double > > result;
  
  if (!SWIG_check_num_args("collocation_points",argc,2,1,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "int" "'.");
  if (1<argc) {
    arg2 = &m2;
    if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  }
  {
    try {
      result = casadi::collocation_points(arg1,(std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[" "double" "]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'collocation_points'."
      "  Prototype:\n"
      "    COLLOCATION_POINTS(int,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_collocation_interpolators(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< double,std::allocator< double > > *arg1 = 0 ;
  std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *arg2 = 0 ;
  std::vector< double,std::allocator< double > > *arg3 = 0 ;
  std::vector< double > m1 ;
  std::vector< std::vector< double > > m2 ;
  std::vector< double > m3 ;
  mxArray * _out;
  
  arg2 = &m2;
  arg3 = &m3;
  if (!SWIG_check_num_args("collocation_interpolators",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "[" "double" "]" "'.");
  {
    try {
      casadi::collocation_interpolators((std::vector< double,std::allocator< double > > const &)*arg1,*arg2,*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg3);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'collocation_interpolators'."
      "  Prototype:\n"
      "    COLLOCATION_INTERPOLATORS([double])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_collocation_coeff(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::vector< double,std::allocator< double > > *arg1 = 0 ;
  casadi::DM *arg2 = 0 ;
  casadi::DM *arg3 = 0 ;
  casadi::DM *arg4 = 0 ;
  std::vector< double > m1 ;
  casadi::Matrix< double > m2 ;
  casadi::Matrix< double > m3 ;
  casadi::Matrix< double > m4 ;
  mxArray * _out;
  
  arg2 = &m2;
  arg3 = &m3;
  arg4 = &m4;
  if (!SWIG_check_num_args("collocation_coeff",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "[" "double" "]" "'.");
  {
    try {
      casadi::collocation_coeff((std::vector< double,std::allocator< double > > const &)*arg1,*arg2,*arg3,*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg3);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg4);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'collocation_coeff'."
      "  Prototype:\n"
      "    COLLOCATION_COEFF([double])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_simpleRK(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function arg1 ;
  casadi_int arg2 = (casadi_int) 10 ;
  casadi_int arg3 = (casadi_int) 4 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("simpleRK",argc,3,1,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Function" "'.");
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  }
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  }
  {
    try {
      result = casadi::simpleRK(arg1,arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'simpleRK'."
      "  Prototype:\n"
      "    SIMPLERK(Function,int,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_simpleIRK(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function arg1 ;
  casadi_int arg2 = (casadi_int) 10 ;
  casadi_int arg3 = (casadi_int) 4 ;
  std::string const &arg4_defvalue = "radau" ;
  std::string *arg4 = (std::string *) &arg4_defvalue ;
  std::string const &arg5_defvalue = "newton" ;
  std::string *arg5 = (std::string *) &arg5_defvalue ;
  casadi::Dict const &arg6_defvalue = casadi::Dict() ;
  casadi::Dict *arg6 = (casadi::Dict *) &arg6_defvalue ;
  std::string m4 ;
  std::string m5 ;
  std::map< std::string,casadi::GenericType > m6 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("simpleIRK",argc,6,1,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Function" "'.");
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  }
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  }
  if (3<argc) {
    arg4 = &m4;
    if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "char" "'.");
  }
  if (4<argc) {
    arg5 = &m5;
    if (!casadi::to_ptr(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "char" "'.");
  }
  if (5<argc) {
    arg6 = &m6;
    if (!casadi::to_ptr(argv[5], &arg6)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 6 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi::simpleIRK(arg1,arg2,arg3,(std::string const &)*arg4,(std::string const &)*arg5,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg6);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'simpleIRK'."
      "  Prototype:\n"
      "    SIMPLEIRK(Function,int,int,char,char,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_simpleIntegrator(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Function arg1 ;
  std::string const &arg2_defvalue = "cvodes" ;
  std::string *arg2 = (std::string *) &arg2_defvalue ;
  casadi::Dict const &arg3_defvalue = casadi::Dict() ;
  casadi::Dict *arg3 = (casadi::Dict *) &arg3_defvalue ;
  std::string m2 ;
  std::map< std::string,casadi::GenericType > m3 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("simpleIntegrator",argc,3,1,0)) {
    SWIG_fail;
  }
  if (!casadi::to_val(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "Function" "'.");
  if (1<argc) {
    arg2 = &m2;
    if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  }
  if (2<argc) {
    arg3 = &m3;
    if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi::simpleIntegrator(arg1,(std::string const &)*arg2,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'simpleIntegrator'."
      "  Prototype:\n"
      "    SIMPLEINTEGRATOR(Function,char,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_dae_reduce_index__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MXDict *arg1 = 0 ;
  casadi::Dict *arg2 = 0 ;
  casadi::Dict const &arg3_defvalue = {
    
  } ;
  casadi::Dict *arg3 = (casadi::Dict *) &arg3_defvalue ;
  std::map< std::string,casadi::MX > m1 ;
  std::map< std::string,casadi::GenericType > m2 ;
  std::map< std::string,casadi::GenericType > m3 ;
  mxArray * _out;
  casadi::MXDict result;
  
  arg2 = &m2;
  if (!SWIG_check_num_args("dae_reduce_index",argc,2,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "struct" ":" "MX" "'.");
  if (1<argc) {
    arg3 = &m3;
    if (!casadi::to_ptr(argv[1], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi::dae_reduce_index((std::map< std::string,casadi::MX,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::MX > > > const &)*arg1,*arg2,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "struct" ":" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'dae_reduce_index'."
      "  Prototype:\n"
      "    DAE_REDUCE_INDEX(struct:MX,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_dae_reduce_index__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::SXDict *arg1 = 0 ;
  casadi::Dict *arg2 = 0 ;
  casadi::Dict const &arg3_defvalue = {
    
  } ;
  casadi::Dict *arg3 = (casadi::Dict *) &arg3_defvalue ;
  std::map< std::string,casadi::Matrix< casadi::SXElem > > m1 ;
  std::map< std::string,casadi::GenericType > m2 ;
  std::map< std::string,casadi::GenericType > m3 ;
  mxArray * _out;
  casadi::SXDict result;
  
  arg2 = &m2;
  if (!SWIG_check_num_args("dae_reduce_index",argc,2,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "struct" ":" "SX" "'.");
  if (1<argc) {
    arg3 = &m3;
    if (!casadi::to_ptr(argv[1], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi::dae_reduce_index((std::map< std::string,casadi::Matrix< casadi::SXElem >,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::Matrix< casadi::SXElem > > > > const &)*arg1,*arg2,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "struct" ":" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg2);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'dae_reduce_index'."
      "  Prototype:\n"
      "    DAE_REDUCE_INDEX(struct:SX,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_dae_reduce_index(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 1) && (argc <= 2)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::map<std::string,casadi::Matrix<casadi::SXElem> > **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_dae_reduce_index__SWIG_1(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< std::map<std::string,casadi::GenericType> **>(0));
      if (_v) {
        return _wrap_dae_reduce_index__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if ((argc >= 1) && (argc <= 2)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::map<std::string,casadi::MX> **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_dae_reduce_index__SWIG_0(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< std::map<std::string,casadi::GenericType> **>(0));
      if (_v) {
        return _wrap_dae_reduce_index__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'dae_reduce_index'."
    "  Possible prototypes are:\n"
    "    DAE_REDUCE_INDEX(struct:SX,struct)\n"
    "    DAE_REDUCE_INDEX(struct:MX,struct)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_dae_map_semi_expl__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MXDict *arg1 = 0 ;
  casadi::MXDict *arg2 = 0 ;
  casadi::Function *arg3 = 0 ;
  casadi::Function *arg4 = 0 ;
  std::map< std::string,casadi::MX > m1 ;
  std::map< std::string,casadi::MX > m2 ;
  casadi::Function m3 ;
  casadi::Function m4 ;
  mxArray * _out;
  casadi::MXDict result;
  
  arg3 = &m3;
  arg4 = &m4;
  if (!SWIG_check_num_args("dae_map_semi_expl",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "struct" ":" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "struct" ":" "MX" "'.");
  {
    try {
      result = casadi::dae_map_semi_expl((std::map< std::string,casadi::MX,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::MX > > > const &)*arg1,(std::map< std::string,casadi::MX,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::MX > > > const &)*arg2,*arg3,*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "struct" ":" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg3);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg4);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'dae_map_semi_expl'."
      "  Prototype:\n"
      "    DAE_MAP_SEMI_EXPL(struct:MX,struct:MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_dae_map_semi_expl__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::SXDict *arg1 = 0 ;
  casadi::SXDict *arg2 = 0 ;
  casadi::Function *arg3 = 0 ;
  casadi::Function *arg4 = 0 ;
  std::map< std::string,casadi::Matrix< casadi::SXElem > > m1 ;
  std::map< std::string,casadi::Matrix< casadi::SXElem > > m2 ;
  casadi::Function m3 ;
  casadi::Function m4 ;
  mxArray * _out;
  casadi::SXDict result;
  
  arg3 = &m3;
  arg4 = &m4;
  if (!SWIG_check_num_args("dae_map_semi_expl",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "struct" ":" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "struct" ":" "SX" "'.");
  {
    try {
      result = casadi::dae_map_semi_expl((std::map< std::string,casadi::Matrix< casadi::SXElem >,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::Matrix< casadi::SXElem > > > > const &)*arg1,(std::map< std::string,casadi::Matrix< casadi::SXElem >,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::Matrix< casadi::SXElem > > > > const &)*arg2,*arg3,*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "struct" ":" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg3);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg4);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'dae_map_semi_expl'."
      "  Prototype:\n"
      "    DAE_MAP_SEMI_EXPL(struct:SX,struct:SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_dae_map_semi_expl(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::map<std::string,casadi::Matrix<casadi::SXElem> > **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::map<std::string,casadi::Matrix<casadi::SXElem> > **>(0));
      if (_v) {
        return _wrap_dae_map_semi_expl__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::map<std::string,casadi::MX> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::map<std::string,casadi::MX> **>(0));
      if (_v) {
        return _wrap_dae_map_semi_expl__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'dae_map_semi_expl'."
    "  Possible prototypes are:\n"
    "    DAE_MAP_SEMI_EXPL(struct:SX,struct:SX)\n"
    "    DAE_MAP_SEMI_EXPL(struct:MX,struct:MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_dae_init_gen__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MXDict *arg1 = 0 ;
  casadi::MXDict *arg2 = 0 ;
  std::string *arg3 = 0 ;
  casadi::DMDict const &arg4_defvalue = casadi::DMDict() ;
  casadi::DMDict *arg4 = (casadi::DMDict *) &arg4_defvalue ;
  casadi::Dict const &arg5_defvalue = casadi::Dict() ;
  casadi::Dict *arg5 = (casadi::Dict *) &arg5_defvalue ;
  std::map< std::string,casadi::MX > m1 ;
  std::map< std::string,casadi::MX > m2 ;
  std::string m3 ;
  std::map< std::string,casadi::Matrix< double > > m4 ;
  std::map< std::string,casadi::GenericType > m5 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("dae_init_gen",argc,5,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "struct" ":" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "struct" ":" "MX" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "char" "'.");
  if (3<argc) {
    arg4 = &m4;
    if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "struct" ":" "DM" "'.");
  }
  if (4<argc) {
    arg5 = &m5;
    if (!casadi::to_ptr(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi::dae_init_gen((std::map< std::string,casadi::MX,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::MX > > > const &)*arg1,(std::map< std::string,casadi::MX,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::MX > > > const &)*arg2,(std::string const &)*arg3,(std::map< std::string,casadi::Matrix< double >,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::Matrix< double > > > > const &)*arg4,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'dae_init_gen'."
      "  Prototype:\n"
      "    DAE_INIT_GEN(struct:MX,struct:MX,char,struct:DM,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_dae_init_gen__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::SXDict *arg1 = 0 ;
  casadi::SXDict *arg2 = 0 ;
  std::string *arg3 = 0 ;
  casadi::DMDict const &arg4_defvalue = casadi::DMDict() ;
  casadi::DMDict *arg4 = (casadi::DMDict *) &arg4_defvalue ;
  casadi::Dict const &arg5_defvalue = casadi::Dict() ;
  casadi::Dict *arg5 = (casadi::Dict *) &arg5_defvalue ;
  std::map< std::string,casadi::Matrix< casadi::SXElem > > m1 ;
  std::map< std::string,casadi::Matrix< casadi::SXElem > > m2 ;
  std::string m3 ;
  std::map< std::string,casadi::Matrix< double > > m4 ;
  std::map< std::string,casadi::GenericType > m5 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("dae_init_gen",argc,5,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "struct" ":" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "struct" ":" "SX" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "char" "'.");
  if (3<argc) {
    arg4 = &m4;
    if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "struct" ":" "DM" "'.");
  }
  if (4<argc) {
    arg5 = &m5;
    if (!casadi::to_ptr(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi::dae_init_gen((std::map< std::string,casadi::Matrix< casadi::SXElem >,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::Matrix< casadi::SXElem > > > > const &)*arg1,(std::map< std::string,casadi::Matrix< casadi::SXElem >,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::Matrix< casadi::SXElem > > > > const &)*arg2,(std::string const &)*arg3,(std::map< std::string,casadi::Matrix< double >,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::Matrix< double > > > > const &)*arg4,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'dae_init_gen'."
      "  Prototype:\n"
      "    DAE_INIT_GEN(struct:SX,struct:SX,char,struct:DM,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_dae_init_gen(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 3) && (argc <= 5)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::map<std::string,casadi::Matrix<casadi::SXElem> > **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::map<std::string,casadi::Matrix<casadi::SXElem> > **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::string **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_dae_init_gen__SWIG_1(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< std::map<std::string,casadi::Matrix<double> > **>(0));
          if (_v) {
            if (argc <= 4) {
              return _wrap_dae_init_gen__SWIG_1(resc,resv,argc,argv);
            }
            _v = casadi::to_ptr(argv[4], static_cast< std::map<std::string,casadi::GenericType> **>(0));
            if (_v) {
              return _wrap_dae_init_gen__SWIG_1(resc,resv,argc,argv);
            }
          }
        }
      }
    }
  }
  if ((argc >= 3) && (argc <= 5)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::map<std::string,casadi::MX> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::map<std::string,casadi::MX> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::string **>(0));
        if (_v) {
          if (argc <= 3) {
            return _wrap_dae_init_gen__SWIG_0(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< std::map<std::string,casadi::Matrix<double> > **>(0));
          if (_v) {
            if (argc <= 4) {
              return _wrap_dae_init_gen__SWIG_0(resc,resv,argc,argv);
            }
            _v = casadi::to_ptr(argv[4], static_cast< std::map<std::string,casadi::GenericType> **>(0));
            if (_v) {
              return _wrap_dae_init_gen__SWIG_0(resc,resv,argc,argv);
            }
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'dae_init_gen'."
    "  Possible prototypes are:\n"
    "    DAE_INIT_GEN(struct:SX,struct:SX,char,struct:DM,struct)\n"
    "    DAE_INIT_GEN(struct:MX,struct:MX,char,struct:DM,struct)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_detect_simple_bounds__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::SX *arg1 = 0 ;
  casadi::SX *arg2 = 0 ;
  casadi::SX *arg3 = 0 ;
  casadi::SX *arg4 = 0 ;
  casadi::SX *arg5 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg6 = 0 ;
  casadi::SX *arg7 = 0 ;
  casadi::SX *arg8 = 0 ;
  casadi::Function *arg9 = 0 ;
  casadi::Function *arg10 = 0 ;
  casadi::Matrix< casadi::SXElem > m1 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  casadi::Matrix< casadi::SXElem > m3 ;
  casadi::Matrix< casadi::SXElem > m4 ;
  casadi::Matrix< casadi::SXElem > m5 ;
  std::vector< casadi_int > m6 ;
  casadi::Matrix< casadi::SXElem > m7 ;
  casadi::Matrix< casadi::SXElem > m8 ;
  casadi::Function m9 ;
  casadi::Function m10 ;
  mxArray * _out;
  
  arg6 = &m6;
  arg7 = &m7;
  arg8 = &m8;
  arg9 = &m9;
  arg10 = &m10;
  if (!SWIG_check_num_args("detect_simple_bounds",argc,5,5,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "SX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "SX" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "SX" "'.");
  arg5 = &m5;
  if (!casadi::to_ptr(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "SX" "'.");
  {
    try {
      casadi::detect_simple_bounds((casadi::Matrix< casadi::SXElem > const &)*arg1,(casadi::Matrix< casadi::SXElem > const &)*arg2,(casadi::Matrix< casadi::SXElem > const &)*arg3,(casadi::Matrix< casadi::SXElem > const &)*arg4,(casadi::Matrix< casadi::SXElem > const &)*arg5,*arg6,*arg7,*arg8,*arg9,*arg10);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg6);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg7);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg8);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg9);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg10);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'detect_simple_bounds'."
      "  Prototype:\n"
      "    DETECT_SIMPLE_BOUNDS(SX,SX,SX,SX,SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_detect_simple_bounds__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MX *arg1 = 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::MX *arg3 = 0 ;
  casadi::MX *arg4 = 0 ;
  casadi::MX *arg5 = 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg6 = 0 ;
  casadi::MX *arg7 = 0 ;
  casadi::MX *arg8 = 0 ;
  casadi::Function *arg9 = 0 ;
  casadi::Function *arg10 = 0 ;
  casadi::MX m1 ;
  casadi::MX m2 ;
  casadi::MX m3 ;
  casadi::MX m4 ;
  casadi::MX m5 ;
  std::vector< casadi_int > m6 ;
  casadi::MX m7 ;
  casadi::MX m8 ;
  casadi::Function m9 ;
  casadi::Function m10 ;
  mxArray * _out;
  
  arg6 = &m6;
  arg7 = &m7;
  arg8 = &m8;
  arg9 = &m9;
  arg10 = &m10;
  if (!SWIG_check_num_args("detect_simple_bounds",argc,5,5,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "MX" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "MX" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "MX" "'.");
  arg5 = &m5;
  if (!casadi::to_ptr(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "MX" "'.");
  {
    try {
      casadi::detect_simple_bounds((casadi::MX const &)*arg1,(casadi::MX const &)*arg2,(casadi::MX const &)*arg3,(casadi::MX const &)*arg4,(casadi::MX const &)*arg5,*arg6,*arg7,*arg8,*arg9,*arg10);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (--resc>=0) *resv++ = casadi::from_ptr(arg6);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg7);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg8);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg9);
  if (--resc>=0) *resv++ = casadi::from_ptr(arg10);
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'detect_simple_bounds'."
      "  Prototype:\n"
      "    DETECT_SIMPLE_BOUNDS(MX,MX,MX,MX,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_detect_simple_bounds(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 5) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
          if (_v) {
            _v = casadi::to_ptr(argv[4], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
            if (_v) {
              return _wrap_detect_simple_bounds__SWIG_0(resc,resv,argc,argv);
            }
          }
        }
      }
    }
  }
  if (argc == 5) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< casadi::MX **>(0));
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::MX **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< casadi::MX **>(0));
          if (_v) {
            _v = casadi::to_ptr(argv[4], static_cast< casadi::MX **>(0));
            if (_v) {
              return _wrap_detect_simple_bounds__SWIG_1(resc,resv,argc,argv);
            }
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'detect_simple_bounds'."
    "  Possible prototypes are:\n"
    "    DETECT_SIMPLE_BOUNDS(SX,SX,SX,SX,SX)\n"
    "    DETECT_SIMPLE_BOUNDS(MX,MX,MX,MX,MX)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_external_transform(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string *arg2 = 0 ;
  casadi::Function *arg3 = 0 ;
  casadi::Dict const &arg4_defvalue = casadi::Dict() ;
  casadi::Dict *arg4 = (casadi::Dict *) &arg4_defvalue ;
  std::string m1 ;
  std::string m2 ;
  casadi::Function m3 ;
  std::map< std::string,casadi::GenericType > m4 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("external_transform",argc,4,3,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "Function" "'.");
  if (3<argc) {
    arg4 = &m4;
    if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "struct" "'.");
  }
  {
    try {
      result = casadi::external_transform((std::string const &)*arg1,(std::string const &)*arg2,(casadi::Function const &)*arg3,(std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'external_transform'."
      "  Prototype:\n"
      "    EXTERNAL_TRANSFORM(char,char,Function,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_NlpBuilder_x_get(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::NlpBuilder *arg1 = (casadi::NlpBuilder *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi::MX,std::allocator< casadi::MX > > *result = 0 ;
  
  if (!SWIG_check_num_args("NlpBuilder_x_get",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__NlpBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "NlpBuilder_x_get" "', argument " "1"" of type '" "casadi::NlpBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::NlpBuilder * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  result = (std::vector< casadi::MX,std::allocator< casadi::MX > > *) & ((arg1)->x);
  if(!(_out = casadi::from_ptr(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "MX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'NlpBuilder_x_get'."
      "  Prototype:\n"
      "    NLPBUILDER_X_GET(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_NlpBuilder_f_get(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::NlpBuilder *arg1 = (casadi::NlpBuilder *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::MX *result = 0 ;
  
  if (!SWIG_check_num_args("NlpBuilder_f_get",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__NlpBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "NlpBuilder_f_get" "', argument " "1"" of type '" "casadi::NlpBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::NlpBuilder * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  result = (casadi::MX *) & ((arg1)->f);
  if(!(_out = casadi::from_ptr(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'NlpBuilder_f_get'."
      "  Prototype:\n"
      "    NLPBUILDER_F_GET(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_NlpBuilder_g_get(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::NlpBuilder *arg1 = (casadi::NlpBuilder *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi::MX,std::allocator< casadi::MX > > *result = 0 ;
  
  if (!SWIG_check_num_args("NlpBuilder_g_get",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__NlpBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "NlpBuilder_g_get" "', argument " "1"" of type '" "casadi::NlpBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::NlpBuilder * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  result = (std::vector< casadi::MX,std::allocator< casadi::MX > > *) & ((arg1)->g);
  if(!(_out = casadi::from_ptr(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "MX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'NlpBuilder_g_get'."
      "  Prototype:\n"
      "    NLPBUILDER_G_GET(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_NlpBuilder_x_lb_get(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::NlpBuilder *arg1 = (casadi::NlpBuilder *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< double,std::allocator< double > > *result = 0 ;
  
  if (!SWIG_check_num_args("NlpBuilder_x_lb_get",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__NlpBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "NlpBuilder_x_lb_get" "', argument " "1"" of type '" "casadi::NlpBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::NlpBuilder * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  result = (std::vector< double,std::allocator< double > > *) & ((arg1)->x_lb);
  if(!(_out = casadi::from_ptr(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[" "double" "]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'NlpBuilder_x_lb_get'."
      "  Prototype:\n"
      "    NLPBUILDER_X_LB_GET(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_NlpBuilder_x_ub_get(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::NlpBuilder *arg1 = (casadi::NlpBuilder *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< double,std::allocator< double > > *result = 0 ;
  
  if (!SWIG_check_num_args("NlpBuilder_x_ub_get",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__NlpBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "NlpBuilder_x_ub_get" "', argument " "1"" of type '" "casadi::NlpBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::NlpBuilder * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  result = (std::vector< double,std::allocator< double > > *) & ((arg1)->x_ub);
  if(!(_out = casadi::from_ptr(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[" "double" "]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'NlpBuilder_x_ub_get'."
      "  Prototype:\n"
      "    NLPBUILDER_X_UB_GET(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_NlpBuilder_g_lb_get(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::NlpBuilder *arg1 = (casadi::NlpBuilder *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< double,std::allocator< double > > *result = 0 ;
  
  if (!SWIG_check_num_args("NlpBuilder_g_lb_get",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__NlpBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "NlpBuilder_g_lb_get" "', argument " "1"" of type '" "casadi::NlpBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::NlpBuilder * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  result = (std::vector< double,std::allocator< double > > *) & ((arg1)->g_lb);
  if(!(_out = casadi::from_ptr(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[" "double" "]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'NlpBuilder_g_lb_get'."
      "  Prototype:\n"
      "    NLPBUILDER_G_LB_GET(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_NlpBuilder_g_ub_get(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::NlpBuilder *arg1 = (casadi::NlpBuilder *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< double,std::allocator< double > > *result = 0 ;
  
  if (!SWIG_check_num_args("NlpBuilder_g_ub_get",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__NlpBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "NlpBuilder_g_ub_get" "', argument " "1"" of type '" "casadi::NlpBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::NlpBuilder * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  result = (std::vector< double,std::allocator< double > > *) & ((arg1)->g_ub);
  if(!(_out = casadi::from_ptr(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[" "double" "]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'NlpBuilder_g_ub_get'."
      "  Prototype:\n"
      "    NLPBUILDER_G_UB_GET(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_NlpBuilder_x_init_get(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::NlpBuilder *arg1 = (casadi::NlpBuilder *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< double,std::allocator< double > > *result = 0 ;
  
  if (!SWIG_check_num_args("NlpBuilder_x_init_get",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__NlpBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "NlpBuilder_x_init_get" "', argument " "1"" of type '" "casadi::NlpBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::NlpBuilder * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  result = (std::vector< double,std::allocator< double > > *) & ((arg1)->x_init);
  if(!(_out = casadi::from_ptr(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[" "double" "]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'NlpBuilder_x_init_get'."
      "  Prototype:\n"
      "    NLPBUILDER_X_INIT_GET(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_NlpBuilder_lambda_init_get(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::NlpBuilder *arg1 = (casadi::NlpBuilder *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< double,std::allocator< double > > *result = 0 ;
  
  if (!SWIG_check_num_args("NlpBuilder_lambda_init_get",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__NlpBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "NlpBuilder_lambda_init_get" "', argument " "1"" of type '" "casadi::NlpBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::NlpBuilder * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  result = (std::vector< double,std::allocator< double > > *) & ((arg1)->lambda_init);
  if(!(_out = casadi::from_ptr(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[" "double" "]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'NlpBuilder_lambda_init_get'."
      "  Prototype:\n"
      "    NLPBUILDER_LAMBDA_INIT_GET(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_NlpBuilder_discrete_get(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::NlpBuilder *arg1 = (casadi::NlpBuilder *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< bool,std::allocator< bool > > *result = 0 ;
  
  if (!SWIG_check_num_args("NlpBuilder_discrete_get",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__NlpBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "NlpBuilder_discrete_get" "', argument " "1"" of type '" "casadi::NlpBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::NlpBuilder * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  result = (std::vector< bool,std::allocator< bool > > *) & ((arg1)->discrete);
  if(!(_out = casadi::from_ptr(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[" "bool" "]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'NlpBuilder_discrete_get'."
      "  Prototype:\n"
      "    NLPBUILDER_DISCRETE_GET(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_NlpBuilder_import_nl(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::NlpBuilder *arg1 = (casadi::NlpBuilder *) 0 ;
  std::string *arg2 = 0 ;
  casadi::Dict const &arg3_defvalue = casadi::Dict() ;
  casadi::Dict *arg3 = (casadi::Dict *) &arg3_defvalue ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  std::map< std::string,casadi::GenericType > m3 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("NlpBuilder_import_nl",argc,3,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__NlpBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "NlpBuilder_import_nl" "', argument " "1"" of type '" "casadi::NlpBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::NlpBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  if (2<argc) {
    arg3 = &m3;
    if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "struct" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->import_nl((std::string const &)*arg2,(casadi::Dict const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'NlpBuilder_import_nl'."
      "  Prototype:\n"
      "    IMPORT_NL(self,char,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_NlpBuilder_type_name(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::NlpBuilder *arg1 = (casadi::NlpBuilder *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("NlpBuilder_type_name",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__NlpBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "NlpBuilder_type_name" "', argument " "1"" of type '" "casadi::NlpBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::NlpBuilder * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::NlpBuilder const *)arg1)->type_name();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'NlpBuilder_type_name'."
      "  Prototype:\n"
      "    TYPE_NAME(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_NlpBuilder_disp(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::NlpBuilder *arg1 = (casadi::NlpBuilder *) 0 ;
  std::ostream *arg2 = 0 ;
  bool arg3 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  arg2 = &casadi::uout();
  if (!SWIG_check_num_args("NlpBuilder_disp",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__NlpBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "NlpBuilder_disp" "', argument " "1"" of type '" "casadi::NlpBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::NlpBuilder * >(argp1);
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::NlpBuilder const *)arg1)->disp(*arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  *arg2 << "\n" << std::flush;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'NlpBuilder_disp'."
      "  Prototype:\n"
      "    DISP(self,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_NlpBuilder_str(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::NlpBuilder *arg1 = (casadi::NlpBuilder *) 0 ;
  bool arg2 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("NlpBuilder_str",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__NlpBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "NlpBuilder_str" "', argument " "1"" of type '" "casadi::NlpBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::NlpBuilder * >(argp1);
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::NlpBuilder const *)arg1)->get_str(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'NlpBuilder_str'."
      "  Prototype:\n"
      "    STR(self,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_NlpBuilder__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  casadi::NlpBuilder *result = 0 ;
  
  if (!SWIG_check_num_args("new_NlpBuilder",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    result = (casadi::NlpBuilder *)new casadi::NlpBuilder();
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__NlpBuilder, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_NlpBuilder'."
      "  Prototype:\n"
      "    NLPBUILDER()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_NlpBuilder__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::NlpBuilder *arg1 = 0 ;
  void *argp1 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::NlpBuilder *result = 0 ;
  
  if (!SWIG_check_num_args("new_NlpBuilder",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_casadi__NlpBuilder,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_NlpBuilder" "', argument " "1"" of type '" "casadi::NlpBuilder const &""'"); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_NlpBuilder" "', argument " "1"" of type '" "casadi::NlpBuilder const &""'"); 
  }
  arg1 = reinterpret_cast< casadi::NlpBuilder * >(argp1);
  {
    result = (casadi::NlpBuilder *)new casadi::NlpBuilder((casadi::NlpBuilder const &)*arg1);
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__NlpBuilder, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_NlpBuilder'."
      "  Prototype:\n"
      "    NLPBUILDER(NlpBuilder)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_NlpBuilder(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 0) {
    return _wrap_new_NlpBuilder__SWIG_0(resc,resv,argc,argv);
  }
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__NlpBuilder, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_new_NlpBuilder__SWIG_1(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_NlpBuilder'."
    "  Possible prototypes are:\n"
    "    NLPBUILDER()\n"
    "    NLPBUILDER(NlpBuilder)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_delete_NlpBuilder(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::NlpBuilder *arg1 = (casadi::NlpBuilder *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  int is_owned;
  if (!SWIG_check_num_args("delete_NlpBuilder",argc,1,1,0)) {
    SWIG_fail;
  }
  is_owned = SWIG_Matlab_isOwned(argv[0]);
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__NlpBuilder, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_NlpBuilder" "', argument " "1"" of type '" "casadi::NlpBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::NlpBuilder * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  if (is_owned) {
    {
      delete arg1;
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'delete_NlpBuilder'."
      "  Prototype:\n"
      "    NLPBUILDER(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_type_name(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("DaeBuilder_type_name",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_type_name" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::DaeBuilder const *)arg1)->type_name();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_type_name'."
      "  Prototype:\n"
      "    TYPE_NAME(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_DaeBuilder__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  casadi::DaeBuilder *result = 0 ;
  
  if (!SWIG_check_num_args("new_DaeBuilder",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      result = (casadi::DaeBuilder *)new casadi::DaeBuilder();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__DaeBuilder, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_DaeBuilder'."
      "  Prototype:\n"
      "    DAEBUILDER()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_DaeBuilder__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string const &arg2_defvalue = "" ;
  std::string *arg2 = (std::string *) &arg2_defvalue ;
  casadi::Dict const &arg3_defvalue = casadi::Dict() ;
  casadi::Dict *arg3 = (casadi::Dict *) &arg3_defvalue ;
  std::string m1 ;
  std::string m2 ;
  std::map< std::string,casadi::GenericType > m3 ;
  mxArray * _out;
  casadi::DaeBuilder *result = 0 ;
  
  if (!SWIG_check_num_args("new_DaeBuilder",argc,3,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  if (1<argc) {
    arg2 = &m2;
    if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  }
  if (2<argc) {
    arg3 = &m3;
    if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "struct" "'.");
  }
  {
    try {
      result = (casadi::DaeBuilder *)new casadi::DaeBuilder((std::string const &)*arg1,(std::string const &)*arg2,(casadi::Dict const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__DaeBuilder, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_DaeBuilder'."
      "  Prototype:\n"
      "    DAEBUILDER(char,char,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_name(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::string *result = 0 ;
  
  if (!SWIG_check_num_args("DaeBuilder_name",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_name" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (std::string *) &((casadi::DaeBuilder const *)arg1)->name();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ptr(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_name'."
      "  Prototype:\n"
      "    NAME(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_t(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::MX *result = 0 ;
  
  if (!SWIG_check_num_args("DaeBuilder_t",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_t" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi::MX *) &((casadi::DaeBuilder const *)arg1)->t();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ptr(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_t'."
      "  Prototype:\n"
      "    T(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_x(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< std::string,std::allocator< std::string > > result;
  
  if (!SWIG_check_num_args("DaeBuilder_x",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_x" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::DaeBuilder const *)arg1)->x();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "char" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_x'."
      "  Prototype:\n"
      "    X(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_ode(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi::MX,std::allocator< casadi::MX > > result;
  
  if (!SWIG_check_num_args("DaeBuilder_ode",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_ode" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::DaeBuilder const *)arg1)->ode();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "MX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_ode'."
      "  Prototype:\n"
      "    ODE(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_z(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< std::string,std::allocator< std::string > > result;
  
  if (!SWIG_check_num_args("DaeBuilder_z",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_z" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::DaeBuilder const *)arg1)->z();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "char" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_z'."
      "  Prototype:\n"
      "    Z(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_alg(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi::MX,std::allocator< casadi::MX > > result;
  
  if (!SWIG_check_num_args("DaeBuilder_alg",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_alg" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::DaeBuilder const *)arg1)->alg();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "MX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_alg'."
      "  Prototype:\n"
      "    ALG(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_q(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< std::string,std::allocator< std::string > > result;
  
  if (!SWIG_check_num_args("DaeBuilder_q",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_q" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::DaeBuilder const *)arg1)->q();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "char" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_q'."
      "  Prototype:\n"
      "    Q(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_quad(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi::MX,std::allocator< casadi::MX > > result;
  
  if (!SWIG_check_num_args("DaeBuilder_quad",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_quad" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::DaeBuilder const *)arg1)->quad();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "MX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_quad'."
      "  Prototype:\n"
      "    QUAD(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_y(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< std::string,std::allocator< std::string > > result;
  
  if (!SWIG_check_num_args("DaeBuilder_y",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_y" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::DaeBuilder const *)arg1)->y();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "char" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_y'."
      "  Prototype:\n"
      "    Y(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_ydef(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi::MX,std::allocator< casadi::MX > > result;
  
  if (!SWIG_check_num_args("DaeBuilder_ydef",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_ydef" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::DaeBuilder const *)arg1)->ydef();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "MX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_ydef'."
      "  Prototype:\n"
      "    YDEF(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_u(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< std::string,std::allocator< std::string > > result;
  
  if (!SWIG_check_num_args("DaeBuilder_u",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_u" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::DaeBuilder const *)arg1)->u();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "char" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_u'."
      "  Prototype:\n"
      "    U(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_p(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< std::string,std::allocator< std::string > > result;
  
  if (!SWIG_check_num_args("DaeBuilder_p",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_p" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::DaeBuilder const *)arg1)->p();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "char" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_p'."
      "  Prototype:\n"
      "    P(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_c(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< std::string,std::allocator< std::string > > result;
  
  if (!SWIG_check_num_args("DaeBuilder_c",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_c" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::DaeBuilder const *)arg1)->c();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "char" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_c'."
      "  Prototype:\n"
      "    C(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_cdef(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi::MX,std::allocator< casadi::MX > > result;
  
  if (!SWIG_check_num_args("DaeBuilder_cdef",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_cdef" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::DaeBuilder const *)arg1)->cdef();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "MX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_cdef'."
      "  Prototype:\n"
      "    CDEF(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_d(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< std::string,std::allocator< std::string > > result;
  
  if (!SWIG_check_num_args("DaeBuilder_d",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_d" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::DaeBuilder const *)arg1)->d();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "char" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_d'."
      "  Prototype:\n"
      "    D(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_ddef(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi::MX,std::allocator< casadi::MX > > result;
  
  if (!SWIG_check_num_args("DaeBuilder_ddef",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_ddef" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::DaeBuilder const *)arg1)->ddef();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "MX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_ddef'."
      "  Prototype:\n"
      "    DDEF(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_w(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< std::string,std::allocator< std::string > > result;
  
  if (!SWIG_check_num_args("DaeBuilder_w",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_w" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::DaeBuilder const *)arg1)->w();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "char" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_w'."
      "  Prototype:\n"
      "    W(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_wdef(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi::MX,std::allocator< casadi::MX > > result;
  
  if (!SWIG_check_num_args("DaeBuilder_wdef",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_wdef" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::DaeBuilder const *)arg1)->wdef();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "MX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_wdef'."
      "  Prototype:\n"
      "    WDEF(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_aux(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi::MX,std::allocator< casadi::MX > > *result = 0 ;
  
  if (!SWIG_check_num_args("DaeBuilder_aux",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_aux" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (std::vector< casadi::MX,std::allocator< casadi::MX > > *) &((casadi::DaeBuilder const *)arg1)->aux();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ptr(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "MX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_aux'."
      "  Prototype:\n"
      "    AUX(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_init_lhs(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi::MX,std::allocator< casadi::MX > > *result = 0 ;
  
  if (!SWIG_check_num_args("DaeBuilder_init_lhs",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_init_lhs" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (std::vector< casadi::MX,std::allocator< casadi::MX > > *) &((casadi::DaeBuilder const *)arg1)->init_lhs();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ptr(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "MX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_init_lhs'."
      "  Prototype:\n"
      "    INIT_LHS(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_init_rhs(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi::MX,std::allocator< casadi::MX > > *result = 0 ;
  
  if (!SWIG_check_num_args("DaeBuilder_init_rhs",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_init_rhs" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (std::vector< casadi::MX,std::allocator< casadi::MX > > *) &((casadi::DaeBuilder const *)arg1)->init_rhs();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ptr(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "MX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_init_rhs'."
      "  Prototype:\n"
      "    INIT_RHS(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_when_cond(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi::MX,std::allocator< casadi::MX > > *result = 0 ;
  
  if (!SWIG_check_num_args("DaeBuilder_when_cond",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_when_cond" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (std::vector< casadi::MX,std::allocator< casadi::MX > > *) &((casadi::DaeBuilder const *)arg1)->when_cond();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ptr(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "MX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_when_cond'."
      "  Prototype:\n"
      "    WHEN_COND(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_when_lhs(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi::MX,std::allocator< casadi::MX > > *result = 0 ;
  
  if (!SWIG_check_num_args("DaeBuilder_when_lhs",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_when_lhs" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (std::vector< casadi::MX,std::allocator< casadi::MX > > *) &((casadi::DaeBuilder const *)arg1)->when_lhs();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ptr(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "MX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_when_lhs'."
      "  Prototype:\n"
      "    WHEN_LHS(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_when_rhs(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi::MX,std::allocator< casadi::MX > > *result = 0 ;
  
  if (!SWIG_check_num_args("DaeBuilder_when_rhs",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_when_rhs" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (std::vector< casadi::MX,std::allocator< casadi::MX > > *) &((casadi::DaeBuilder const *)arg1)->when_rhs();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ptr(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "MX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_when_rhs'."
      "  Prototype:\n"
      "    WHEN_RHS(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_outputs(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< std::string,std::allocator< std::string > > result;
  
  if (!SWIG_check_num_args("DaeBuilder_outputs",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_outputs" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::DaeBuilder const *)arg1)->outputs();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "char" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_outputs'."
      "  Prototype:\n"
      "    OUTPUTS(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_derivatives(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< std::string,std::allocator< std::string > > result;
  
  if (!SWIG_check_num_args("DaeBuilder_derivatives",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_derivatives" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::DaeBuilder const *)arg1)->derivatives();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "char" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_derivatives'."
      "  Prototype:\n"
      "    DERIVATIVES(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_initial_unknowns(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< std::string,std::allocator< std::string > > result;
  
  if (!SWIG_check_num_args("DaeBuilder_initial_unknowns",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_initial_unknowns" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::DaeBuilder const *)arg1)->initial_unknowns();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "char" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_initial_unknowns'."
      "  Prototype:\n"
      "    INITIAL_UNKNOWNS(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_has_t(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("DaeBuilder_has_t",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_has_t" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::DaeBuilder const *)arg1)->has_t();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_has_t'."
      "  Prototype:\n"
      "    HAS_T(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_nx(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("DaeBuilder_nx",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_nx" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::DaeBuilder const *)arg1)->nx();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_nx'."
      "  Prototype:\n"
      "    NX(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_nz(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("DaeBuilder_nz",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_nz" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::DaeBuilder const *)arg1)->nz();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_nz'."
      "  Prototype:\n"
      "    NZ(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_nq(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("DaeBuilder_nq",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_nq" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::DaeBuilder const *)arg1)->nq();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_nq'."
      "  Prototype:\n"
      "    NQ(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_ny(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("DaeBuilder_ny",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_ny" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::DaeBuilder const *)arg1)->ny();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_ny'."
      "  Prototype:\n"
      "    NY(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_nu(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("DaeBuilder_nu",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_nu" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::DaeBuilder const *)arg1)->nu();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_nu'."
      "  Prototype:\n"
      "    NU(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_np(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("DaeBuilder_np",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_np" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::DaeBuilder const *)arg1)->np();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_np'."
      "  Prototype:\n"
      "    NP(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_nc(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("DaeBuilder_nc",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_nc" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::DaeBuilder const *)arg1)->nc();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_nc'."
      "  Prototype:\n"
      "    NC(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_nd(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("DaeBuilder_nd",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_nd" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::DaeBuilder const *)arg1)->nd();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_nd'."
      "  Prototype:\n"
      "    ND(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_nw(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("DaeBuilder_nw",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_nw" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::DaeBuilder const *)arg1)->nw();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_nw'."
      "  Prototype:\n"
      "    NW(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_add_t(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::string const &arg2_defvalue = "t" ;
  std::string *arg2 = (std::string *) &arg2_defvalue ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("DaeBuilder_add_t",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_add_t" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  if (1<argc) {
    arg2 = &m2;
    if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->add_t((std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_add_t'."
      "  Prototype:\n"
      "    ADD_T(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_add_p(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::string const &arg2_defvalue = std::string() ;
  std::string *arg2 = (std::string *) &arg2_defvalue ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("DaeBuilder_add_p",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_add_p" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  if (1<argc) {
    arg2 = &m2;
    if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->add_p((std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_add_p'."
      "  Prototype:\n"
      "    ADD_P(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_add_u(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::string const &arg2_defvalue = std::string() ;
  std::string *arg2 = (std::string *) &arg2_defvalue ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("DaeBuilder_add_u",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_add_u" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  if (1<argc) {
    arg2 = &m2;
    if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->add_u((std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_add_u'."
      "  Prototype:\n"
      "    ADD_U(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_add_x(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::string const &arg2_defvalue = std::string() ;
  std::string *arg2 = (std::string *) &arg2_defvalue ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("DaeBuilder_add_x",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_add_x" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  if (1<argc) {
    arg2 = &m2;
    if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->add_x((std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_add_x'."
      "  Prototype:\n"
      "    ADD_X(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_add_z(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::string const &arg2_defvalue = std::string() ;
  std::string *arg2 = (std::string *) &arg2_defvalue ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("DaeBuilder_add_z",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_add_z" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  if (1<argc) {
    arg2 = &m2;
    if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->add_z((std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_add_z'."
      "  Prototype:\n"
      "    ADD_Z(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_add_q(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::string const &arg2_defvalue = std::string() ;
  std::string *arg2 = (std::string *) &arg2_defvalue ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("DaeBuilder_add_q",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_add_q" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  if (1<argc) {
    arg2 = &m2;
    if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->add_q((std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_add_q'."
      "  Prototype:\n"
      "    ADD_Q(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_add_c(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::string *arg2 = 0 ;
  casadi::MX *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  casadi::MX m3 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("DaeBuilder_add_c",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_add_c" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "MX" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->add_c((std::string const &)*arg2,(casadi::MX const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_add_c'."
      "  Prototype:\n"
      "    ADD_C(self,char,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_add_d(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::string *arg2 = 0 ;
  casadi::MX *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  casadi::MX m3 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("DaeBuilder_add_d",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_add_d" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "MX" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->add_d((std::string const &)*arg2,(casadi::MX const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_add_d'."
      "  Prototype:\n"
      "    ADD_D(self,char,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_add_w(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::string *arg2 = 0 ;
  casadi::MX *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  casadi::MX m3 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("DaeBuilder_add_w",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_add_w" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "MX" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->add_w((std::string const &)*arg2,(casadi::MX const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_add_w'."
      "  Prototype:\n"
      "    ADD_W(self,char,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_add_y(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::string *arg2 = 0 ;
  casadi::MX *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  casadi::MX m3 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("DaeBuilder_add_y",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_add_y" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "MX" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->add_y((std::string const &)*arg2,(casadi::MX const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_add_y'."
      "  Prototype:\n"
      "    ADD_Y(self,char,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_set_ode(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::string *arg2 = 0 ;
  casadi::MX *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  casadi::MX m3 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DaeBuilder_set_ode",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_set_ode" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "MX" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->set_ode((std::string const &)*arg2,(casadi::MX const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_set_ode'."
      "  Prototype:\n"
      "    SET_ODE(self,char,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_set_alg(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::string *arg2 = 0 ;
  casadi::MX *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  casadi::MX m3 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DaeBuilder_set_alg",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_set_alg" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "MX" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->set_alg((std::string const &)*arg2,(casadi::MX const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_set_alg'."
      "  Prototype:\n"
      "    SET_ALG(self,char,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_add_aux(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::string const &arg2_defvalue = std::string() ;
  std::string *arg2 = (std::string *) &arg2_defvalue ;
  casadi_int arg3 = (casadi_int) 1 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("DaeBuilder_add_aux",argc,3,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_add_aux" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  if (1<argc) {
    arg2 = &m2;
    if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  }
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->add_aux((std::string const &)*arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_add_aux'."
      "  Prototype:\n"
      "    ADD_AUX(self,char,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_add_init(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::MX *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  casadi::MX m3 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DaeBuilder_add_init",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_add_init" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "MX" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->add_init((casadi::MX const &)*arg2,(casadi::MX const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_add_init'."
      "  Prototype:\n"
      "    ADD_INIT(self,MX,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_add_when(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::MX *arg3 = 0 ;
  casadi::MX *arg4 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  casadi::MX m3 ;
  casadi::MX m4 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DaeBuilder_add_when",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_add_when" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "MX" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "MX" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->add_when((casadi::MX const &)*arg2,(casadi::MX const &)*arg3,(casadi::MX const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_add_when'."
      "  Prototype:\n"
      "    ADD_WHEN(self,MX,MX,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_sanity_check(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DaeBuilder_sanity_check",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_sanity_check" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::DaeBuilder const *)arg1)->sanity_check();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_sanity_check'."
      "  Prototype:\n"
      "    SANITY_CHECK(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_clear_all(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DaeBuilder_clear_all",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_clear_all" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->clear_all((std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_clear_all'."
      "  Prototype:\n"
      "    CLEAR_ALL(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_set_all(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::string *arg2 = 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  std::vector< std::string > m3 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DaeBuilder_set_all",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_set_all" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "{" "char" "}" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->set_all((std::string const &)*arg2,(std::vector< std::string,std::allocator< std::string > > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_set_all'."
      "  Prototype:\n"
      "    SET_ALL(self,char,{char})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_register_t(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DaeBuilder_register_t",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_register_t" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->register_t((std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_register_t'."
      "  Prototype:\n"
      "    REGISTER_T(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_register_p(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DaeBuilder_register_p",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_register_p" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->register_p((std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_register_p'."
      "  Prototype:\n"
      "    REGISTER_P(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_register_u(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DaeBuilder_register_u",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_register_u" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->register_u((std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_register_u'."
      "  Prototype:\n"
      "    REGISTER_U(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_register_x(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DaeBuilder_register_x",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_register_x" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->register_x((std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_register_x'."
      "  Prototype:\n"
      "    REGISTER_X(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_register_z(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DaeBuilder_register_z",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_register_z" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->register_z((std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_register_z'."
      "  Prototype:\n"
      "    REGISTER_Z(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_register_q(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DaeBuilder_register_q",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_register_q" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->register_q((std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_register_q'."
      "  Prototype:\n"
      "    REGISTER_Q(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_register_c(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DaeBuilder_register_c",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_register_c" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->register_c((std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_register_c'."
      "  Prototype:\n"
      "    REGISTER_C(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_register_d(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DaeBuilder_register_d",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_register_d" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->register_d((std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_register_d'."
      "  Prototype:\n"
      "    REGISTER_D(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_register_w(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DaeBuilder_register_w",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_register_w" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->register_w((std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_register_w'."
      "  Prototype:\n"
      "    REGISTER_W(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_register_y(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DaeBuilder_register_y",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_register_y" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->register_y((std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_register_y'."
      "  Prototype:\n"
      "    REGISTER_Y(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_set_u(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< std::string > m2 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DaeBuilder_set_u",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_set_u" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "char" "}" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->set_u((std::vector< std::string,std::allocator< std::string > > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_set_u'."
      "  Prototype:\n"
      "    SET_U(self,{char})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_set_x(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< std::string > m2 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DaeBuilder_set_x",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_set_x" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "char" "}" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->set_x((std::vector< std::string,std::allocator< std::string > > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_set_x'."
      "  Prototype:\n"
      "    SET_X(self,{char})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_set_z(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg2 = 0 ;
  std::vector< std::string,std::allocator< std::string > > const &arg3_defvalue = std::vector< std::string >() ;
  std::vector< std::string,std::allocator< std::string > > *arg3 = (std::vector< std::string,std::allocator< std::string > > *) &arg3_defvalue ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< std::string > m2 ;
  std::vector< std::string > m3 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DaeBuilder_set_z",argc,3,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_set_z" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "char" "}" "'.");
  if (2<argc) {
    arg3 = &m3;
    if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "{" "char" "}" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->set_z((std::vector< std::string,std::allocator< std::string > > const &)*arg2,(std::vector< std::string,std::allocator< std::string > > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_set_z'."
      "  Prototype:\n"
      "    SET_Z(self,{char},{char})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_set_q(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< std::string > m2 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DaeBuilder_set_q",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_set_q" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "char" "}" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->set_q((std::vector< std::string,std::allocator< std::string > > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_set_q'."
      "  Prototype:\n"
      "    SET_Q(self,{char})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_set_y(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< std::string > m2 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DaeBuilder_set_y",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_set_y" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "char" "}" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->set_y((std::vector< std::string,std::allocator< std::string > > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_set_y'."
      "  Prototype:\n"
      "    SET_Y(self,{char})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_clear_in(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DaeBuilder_clear_in",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_clear_in" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->clear_in((std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_clear_in'."
      "  Prototype:\n"
      "    CLEAR_IN(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_eliminate_w(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DaeBuilder_eliminate_w",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_eliminate_w" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->eliminate_w();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_eliminate_w'."
      "  Prototype:\n"
      "    ELIMINATE_W(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_lift(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  bool arg2 = (bool) true ;
  bool arg3 = (bool) true ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DaeBuilder_lift",argc,3,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_lift" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "bool" "'.");
  }
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->lift(arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_lift'."
      "  Prototype:\n"
      "    LIFT(self,bool,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_eliminate_quad(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DaeBuilder_eliminate_quad",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_eliminate_quad" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->eliminate_quad();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_eliminate_quad'."
      "  Prototype:\n"
      "    ELIMINATE_QUAD(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_sort_d(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DaeBuilder_sort_d",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_sort_d" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->sort_d();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_sort_d'."
      "  Prototype:\n"
      "    SORT_D(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_sort_w(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DaeBuilder_sort_w",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_sort_w" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->sort_w();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_sort_w'."
      "  Prototype:\n"
      "    SORT_W(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_sort_z(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< std::string > m2 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DaeBuilder_sort_z",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_sort_z" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "char" "}" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->sort_z((std::vector< std::string,std::allocator< std::string > > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_sort_z'."
      "  Prototype:\n"
      "    SORT_Z(self,{char})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_prune(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  bool arg2 = (bool) true ;
  bool arg3 = (bool) true ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DaeBuilder_prune",argc,3,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_prune" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "bool" "'.");
  }
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->prune(arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_prune'."
      "  Prototype:\n"
      "    PRUNE(self,bool,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_tear(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DaeBuilder_tear",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_tear" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->tear();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_tear'."
      "  Prototype:\n"
      "    TEAR(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_add_fun__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::string *arg2 = 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg3 = 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg4 = 0 ;
  casadi::Dict const &arg5_defvalue = casadi::Dict() ;
  casadi::Dict *arg5 = (casadi::Dict *) &arg5_defvalue ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  std::vector< std::string > m3 ;
  std::vector< std::string > m4 ;
  std::map< std::string,casadi::GenericType > m5 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("DaeBuilder_add_fun",argc,5,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_add_fun" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "{" "char" "}" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "{" "char" "}" "'.");
  if (4<argc) {
    arg5 = &m5;
    if (!casadi::to_ptr(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "struct" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->add_fun((std::string const &)*arg2,(std::vector< std::string,std::allocator< std::string > > const &)*arg3,(std::vector< std::string,std::allocator< std::string > > const &)*arg4,(casadi::Dict const &)*arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_add_fun'."
      "  Prototype:\n"
      "    ADD_FUN(self,char,{char},{char},struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_add_fun__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  casadi::Function *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Function m2 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("DaeBuilder_add_fun",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_add_fun" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "Function" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->add_fun((casadi::Function const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_add_fun'."
      "  Prototype:\n"
      "    ADD_FUN(self,Function)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_add_fun__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::string *arg2 = 0 ;
  casadi::Importer *arg3 = 0 ;
  casadi::Dict const &arg4_defvalue = casadi::Dict() ;
  casadi::Dict *arg4 = (casadi::Dict *) &arg4_defvalue ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  void *argp3 ;
  int res3 = 0 ;
  std::map< std::string,casadi::GenericType > m4 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("DaeBuilder_add_fun",argc,4,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_add_fun" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  res3 = SWIG_ConvertPtr(argv[2], &argp3, SWIGTYPE_p_casadi__Importer,  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "DaeBuilder_add_fun" "', argument " "3"" of type '" "casadi::Importer const &""'"); 
  }
  if (!argp3) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "DaeBuilder_add_fun" "', argument " "3"" of type '" "casadi::Importer const &""'"); 
  }
  arg3 = reinterpret_cast< casadi::Importer * >(argp3);
  if (3<argc) {
    arg4 = &m4;
    if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "struct" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->add_fun((std::string const &)*arg2,(casadi::Importer const &)*arg3,(casadi::Dict const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_add_fun'."
      "  Prototype:\n"
      "    ADD_FUN(self,char,Importer,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_add_fun(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__DaeBuilder, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Function **>(0));
      if (_v) {
        return _wrap_DaeBuilder_add_fun__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if ((argc >= 3) && (argc <= 4)) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__DaeBuilder, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        void *vptr = 0;
        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_casadi__Importer, 0);
        _v = SWIG_CheckState(res);
        if (_v) {
          if (argc <= 3) {
            return _wrap_DaeBuilder_add_fun__SWIG_2(resc,resv,argc,argv);
          }
          _v = casadi::to_ptr(argv[3], static_cast< std::map<std::string,casadi::GenericType> **>(0));
          if (_v) {
            return _wrap_DaeBuilder_add_fun__SWIG_2(resc,resv,argc,argv);
          }
        }
      }
    }
  }
  if ((argc >= 4) && (argc <= 5)) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__DaeBuilder, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::vector<std::string> **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< std::vector<std::string> **>(0));
          if (_v) {
            if (argc <= 4) {
              return _wrap_DaeBuilder_add_fun__SWIG_0(resc,resv,argc,argv);
            }
            _v = casadi::to_ptr(argv[4], static_cast< std::map<std::string,casadi::GenericType> **>(0));
            if (_v) {
              return _wrap_DaeBuilder_add_fun__SWIG_0(resc,resv,argc,argv);
            }
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_add_fun'."
    "  Possible prototypes are:\n"
    "    ADD_FUN(self,Function)\n"
    "    ADD_FUN(self,char,Importer,struct)\n"
    "    ADD_FUN(self,char,{char},{char},struct)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_DaeBuilder_has_fun(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("DaeBuilder_has_fun",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_has_fun" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::DaeBuilder const *)arg1)->has_fun((std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_has_fun'."
      "  Prototype:\n"
      "    HAS_FUN(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_fun__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("DaeBuilder_fun",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_fun" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::DaeBuilder const *)arg1)->fun((std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_fun'."
      "  Prototype:\n"
      "    FUN(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_fun__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi::Function,std::allocator< casadi::Function > > result;
  
  if (!SWIG_check_num_args("DaeBuilder_fun",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_fun" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::DaeBuilder const *)arg1)->fun();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "Function" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_fun'."
      "  Prototype:\n"
      "    FUN(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_fun(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__DaeBuilder, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_DaeBuilder_fun__SWIG_1(resc,resv,argc,argv);
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__DaeBuilder, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        return _wrap_DaeBuilder_fun__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_fun'."
    "  Possible prototypes are:\n"
    "    FUN(self)\n"
    "    FUN(self,char)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_DaeBuilder_gather_fun(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  casadi_int arg2 = (casadi_int) -1 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DaeBuilder_gather_fun",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_gather_fun" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->gather_fun(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_gather_fun'."
      "  Prototype:\n"
      "    GATHER_FUN(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_parse_fmi(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DaeBuilder_parse_fmi",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_parse_fmi" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->parse_fmi((std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_parse_fmi'."
      "  Prototype:\n"
      "    PARSE_FMI(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_provides_directional_derivative(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("DaeBuilder_provides_directional_derivative",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_provides_directional_derivative" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::DaeBuilder const *)arg1)->provides_directional_derivative();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_provides_directional_derivative'."
      "  Prototype:\n"
      "    PROVIDES_DIRECTIONAL_DERIVATIVE(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_load_fmi_description(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DaeBuilder_load_fmi_description",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_load_fmi_description" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->load_fmi_description((std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_load_fmi_description'."
      "  Prototype:\n"
      "    LOAD_FMI_DESCRIPTION(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_export_fmu(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  casadi::Dict const &arg2_defvalue = casadi::Dict() ;
  casadi::Dict *arg2 = (casadi::Dict *) &arg2_defvalue ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::map< std::string,casadi::GenericType > m2 ;
  mxArray * _out;
  std::vector< std::string,std::allocator< std::string > > result;
  
  if (!SWIG_check_num_args("DaeBuilder_export_fmu",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_export_fmu" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  if (1<argc) {
    arg2 = &m2;
    if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "struct" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->export_fmu((casadi::Dict const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "char" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_export_fmu'."
      "  Prototype:\n"
      "    EXPORT_FMU(self,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_add_lc(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::string *arg2 = 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  std::vector< std::string > m3 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DaeBuilder_add_lc",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_add_lc" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "{" "char" "}" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->add_lc((std::string const &)*arg2,(std::vector< std::string,std::allocator< std::string > > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_add_lc'."
      "  Prototype:\n"
      "    ADD_LC(self,char,{char})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_create__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::string *arg2 = 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg3 = 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg4 = 0 ;
  bool arg5 ;
  bool arg6 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  std::vector< std::string > m3 ;
  std::vector< std::string > m4 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("DaeBuilder_create",argc,6,5,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_create" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "{" "char" "}" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "{" "char" "}" "'.");
  if (!casadi::to_val(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "bool" "'.");
  if (5<argc) {
    if (!casadi::to_val(argv[5], &arg6)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 6 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::DaeBuilder const *)arg1)->create((std::string const &)*arg2,(std::vector< std::string,std::allocator< std::string > > const &)*arg3,(std::vector< std::string,std::allocator< std::string > > const &)*arg4,arg5,arg6);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_create'."
      "  Prototype:\n"
      "    CREATE(self,char,{char},{char},bool,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_create__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::string *arg2 = 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg3 = 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg4 = 0 ;
  casadi::Dict const &arg5_defvalue = casadi::Dict() ;
  casadi::Dict *arg5 = (casadi::Dict *) &arg5_defvalue ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  std::vector< std::string > m3 ;
  std::vector< std::string > m4 ;
  std::map< std::string,casadi::GenericType > m5 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("DaeBuilder_create",argc,5,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_create" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "{" "char" "}" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "{" "char" "}" "'.");
  if (4<argc) {
    arg5 = &m5;
    if (!casadi::to_ptr(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "struct" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::DaeBuilder const *)arg1)->create((std::string const &)*arg2,(std::vector< std::string,std::allocator< std::string > > const &)*arg3,(std::vector< std::string,std::allocator< std::string > > const &)*arg4,(casadi::Dict const &)*arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_create'."
      "  Prototype:\n"
      "    CREATE(self,char,{char},{char},struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_create__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::string *arg2 = 0 ;
  casadi::Dict const &arg3_defvalue = casadi::Dict() ;
  casadi::Dict *arg3 = (casadi::Dict *) &arg3_defvalue ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  std::map< std::string,casadi::GenericType > m3 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("DaeBuilder_create",argc,3,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_create" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  if (2<argc) {
    arg3 = &m3;
    if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "struct" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::DaeBuilder const *)arg1)->create((std::string const &)*arg2,(casadi::Dict const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_create'."
      "  Prototype:\n"
      "    CREATE(self,char,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_create(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 2) && (argc <= 3)) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__DaeBuilder, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_DaeBuilder_create__SWIG_2(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< std::map<std::string,casadi::GenericType> **>(0));
        if (_v) {
          return _wrap_DaeBuilder_create__SWIG_2(resc,resv,argc,argv);
        }
      }
    }
  }
  if ((argc >= 4) && (argc <= 5)) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__DaeBuilder, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::vector<std::string> **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< std::vector<std::string> **>(0));
          if (_v) {
            if (argc <= 4) {
              return _wrap_DaeBuilder_create__SWIG_1(resc,resv,argc,argv);
            }
            _v = casadi::to_ptr(argv[4], static_cast< std::map<std::string,casadi::GenericType> **>(0));
            if (_v) {
              return _wrap_DaeBuilder_create__SWIG_1(resc,resv,argc,argv);
            }
          }
        }
      }
    }
  }
  if ((argc >= 5) && (argc <= 6)) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__DaeBuilder, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::vector<std::string> **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< std::vector<std::string> **>(0));
          if (_v) {
            _v = casadi::to_ptr(argv[4], static_cast< bool **>(0));
            if (_v) {
              if (argc <= 5) {
                return _wrap_DaeBuilder_create__SWIG_0(resc,resv,argc,argv);
              }
              _v = casadi::to_ptr(argv[5], static_cast< bool **>(0));
              if (_v) {
                return _wrap_DaeBuilder_create__SWIG_0(resc,resv,argc,argv);
              }
            }
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_create'."
    "  Possible prototypes are:\n"
    "    CREATE(self,char,struct)\n"
    "    CREATE(self,char,{char},{char},struct)\n"
    "    CREATE(self,char,{char},{char},bool,bool)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_DaeBuilder_dependent_fun(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::string *arg2 = 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg3 = 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg4 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  std::vector< std::string > m3 ;
  std::vector< std::string > m4 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("DaeBuilder_dependent_fun",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_dependent_fun" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "{" "char" "}" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "{" "char" "}" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::DaeBuilder const *)arg1)->dependent_fun((std::string const &)*arg2,(std::vector< std::string,std::allocator< std::string > > const &)*arg3,(std::vector< std::string,std::allocator< std::string > > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_dependent_fun'."
      "  Prototype:\n"
      "    DEPENDENT_FUN(self,char,{char},{char})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_var(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("DaeBuilder_var",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_var" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::DaeBuilder const *)arg1)->var((std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_var'."
      "  Prototype:\n"
      "    VAR(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_paren(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("DaeBuilder_paren",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_paren" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::DaeBuilder const *)arg1)->operator ()((std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_paren'."
      "  Prototype:\n"
      "    PAREN(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_der(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< std::string > m2 ;
  mxArray * _out;
  std::vector< std::string,std::allocator< std::string > > result;
  
  if (!SWIG_check_num_args("DaeBuilder_der",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_der" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "char" "}" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::DaeBuilder const *)arg1)->der((std::vector< std::string,std::allocator< std::string > > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "char" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_der'."
      "  Prototype:\n"
      "    DER(self,{char})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_beq(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("DaeBuilder_beq",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_beq" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::DaeBuilder const *)arg1)->beq((std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_beq'."
      "  Prototype:\n"
      "    BEQ(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_set_beq(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::string *arg2 = 0 ;
  casadi::MX *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  casadi::MX m3 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DaeBuilder_set_beq",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_set_beq" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "MX" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->set_beq((std::string const &)*arg2,(casadi::MX const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_set_beq'."
      "  Prototype:\n"
      "    SET_BEQ(self,char,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_value_reference(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("DaeBuilder_value_reference",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_value_reference" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::DaeBuilder const *)arg1)->value_reference((std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_value_reference'."
      "  Prototype:\n"
      "    VALUE_REFERENCE(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_set_value_reference(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::string *arg2 = 0 ;
  casadi_int arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DaeBuilder_set_value_reference",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_set_value_reference" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->set_value_reference((std::string const &)*arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_set_value_reference'."
      "  Prototype:\n"
      "    SET_VALUE_REFERENCE(self,char,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_description(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("DaeBuilder_description",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_description" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::DaeBuilder const *)arg1)->description((std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_description'."
      "  Prototype:\n"
      "    DESCRIPTION(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_set_description(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::string *arg2 = 0 ;
  std::string *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  std::string m3 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DaeBuilder_set_description",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_set_description" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->set_description((std::string const &)*arg2,(std::string const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_set_description'."
      "  Prototype:\n"
      "    SET_DESCRIPTION(self,char,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_type(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::string *arg2 = 0 ;
  casadi_int arg3 = (casadi_int) 3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("DaeBuilder_type",argc,3,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_type" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::DaeBuilder const *)arg1)->type((std::string const &)*arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_type'."
      "  Prototype:\n"
      "    TYPE(self,char,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_set_type(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::string *arg2 = 0 ;
  std::string *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  std::string m3 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DaeBuilder_set_type",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_set_type" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->set_type((std::string const &)*arg2,(std::string const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_set_type'."
      "  Prototype:\n"
      "    SET_TYPE(self,char,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_causality(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("DaeBuilder_causality",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_causality" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::DaeBuilder const *)arg1)->causality((std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_causality'."
      "  Prototype:\n"
      "    CAUSALITY(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_set_causality(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::string *arg2 = 0 ;
  std::string *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  std::string m3 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DaeBuilder_set_causality",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_set_causality" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->set_causality((std::string const &)*arg2,(std::string const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_set_causality'."
      "  Prototype:\n"
      "    SET_CAUSALITY(self,char,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_variability(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("DaeBuilder_variability",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_variability" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::DaeBuilder const *)arg1)->variability((std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_variability'."
      "  Prototype:\n"
      "    VARIABILITY(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_set_variability(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::string *arg2 = 0 ;
  std::string *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  std::string m3 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DaeBuilder_set_variability",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_set_variability" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->set_variability((std::string const &)*arg2,(std::string const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_set_variability'."
      "  Prototype:\n"
      "    SET_VARIABILITY(self,char,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_initial(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("DaeBuilder_initial",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_initial" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::DaeBuilder const *)arg1)->initial((std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_initial'."
      "  Prototype:\n"
      "    INITIAL(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_set_initial(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::string *arg2 = 0 ;
  std::string *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  std::string m3 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DaeBuilder_set_initial",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_set_initial" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->set_initial((std::string const &)*arg2,(std::string const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_set_initial'."
      "  Prototype:\n"
      "    SET_INITIAL(self,char,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_unit(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("DaeBuilder_unit",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_unit" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::DaeBuilder const *)arg1)->unit((std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_unit'."
      "  Prototype:\n"
      "    UNIT(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_set_unit(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::string *arg2 = 0 ;
  std::string *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  std::string m3 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DaeBuilder_set_unit",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_set_unit" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->set_unit((std::string const &)*arg2,(std::string const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_set_unit'."
      "  Prototype:\n"
      "    SET_UNIT(self,char,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_display_unit(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("DaeBuilder_display_unit",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_display_unit" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::DaeBuilder const *)arg1)->display_unit((std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_display_unit'."
      "  Prototype:\n"
      "    DISPLAY_UNIT(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_set_display_unit(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::string *arg2 = 0 ;
  std::string *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  std::string m3 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DaeBuilder_set_display_unit",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_set_display_unit" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->set_display_unit((std::string const &)*arg2,(std::string const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_set_display_unit'."
      "  Prototype:\n"
      "    SET_DISPLAY_UNIT(self,char,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_numel(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("DaeBuilder_numel",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_numel" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::DaeBuilder const *)arg1)->numel((std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_numel'."
      "  Prototype:\n"
      "    NUMEL(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_dimension(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  std::vector< casadi_int,std::allocator< casadi_int > > result;
  
  if (!SWIG_check_num_args("DaeBuilder_dimension",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_dimension" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::DaeBuilder const *)arg1)->dimension((std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[" "int" "]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_dimension'."
      "  Prototype:\n"
      "    DIMENSION(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_attribute(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::string *arg2 = 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  std::vector< std::string > m3 ;
  mxArray * _out;
  std::vector< double,std::allocator< double > > result;
  
  if (!SWIG_check_num_args("DaeBuilder_attribute",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_attribute" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "{" "char" "}" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::DaeBuilder const *)arg1)->attribute((std::string const &)*arg2,(std::vector< std::string,std::allocator< std::string > > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[" "double" "]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_attribute'."
      "  Prototype:\n"
      "    ATTRIBUTE(self,char,{char})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_set_attribute(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::string *arg2 = 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg3 = 0 ;
  std::vector< double,std::allocator< double > > *arg4 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  std::vector< std::string > m3 ;
  std::vector< double > m4 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DaeBuilder_set_attribute",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_set_attribute" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "{" "char" "}" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "[" "double" "]" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->set_attribute((std::string const &)*arg2,(std::vector< std::string,std::allocator< std::string > > const &)*arg3,(std::vector< double,std::allocator< double > > const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_set_attribute'."
      "  Prototype:\n"
      "    SET_ATTRIBUTE(self,char,{char},[double])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_min(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< std::string > m2 ;
  mxArray * _out;
  std::vector< double,std::allocator< double > > result;
  
  if (!SWIG_check_num_args("DaeBuilder_min",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_min" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "char" "}" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::DaeBuilder const *)arg1)->min((std::vector< std::string,std::allocator< std::string > > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[" "double" "]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_min'."
      "  Prototype:\n"
      "    MIN(self,{char})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_set_min(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg2 = 0 ;
  std::vector< double,std::allocator< double > > *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< std::string > m2 ;
  std::vector< double > m3 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DaeBuilder_set_min",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_set_min" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "char" "}" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "[" "double" "]" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->set_min((std::vector< std::string,std::allocator< std::string > > const &)*arg2,(std::vector< double,std::allocator< double > > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_set_min'."
      "  Prototype:\n"
      "    SET_MIN(self,{char},[double])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_max(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< std::string > m2 ;
  mxArray * _out;
  std::vector< double,std::allocator< double > > result;
  
  if (!SWIG_check_num_args("DaeBuilder_max",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_max" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "char" "}" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::DaeBuilder const *)arg1)->max((std::vector< std::string,std::allocator< std::string > > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[" "double" "]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_max'."
      "  Prototype:\n"
      "    MAX(self,{char})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_set_max(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg2 = 0 ;
  std::vector< double,std::allocator< double > > *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< std::string > m2 ;
  std::vector< double > m3 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DaeBuilder_set_max",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_set_max" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "char" "}" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "[" "double" "]" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->set_max((std::vector< std::string,std::allocator< std::string > > const &)*arg2,(std::vector< double,std::allocator< double > > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_set_max'."
      "  Prototype:\n"
      "    SET_MAX(self,{char},[double])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_nominal(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< std::string > m2 ;
  mxArray * _out;
  std::vector< double,std::allocator< double > > result;
  
  if (!SWIG_check_num_args("DaeBuilder_nominal",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_nominal" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "char" "}" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::DaeBuilder const *)arg1)->nominal((std::vector< std::string,std::allocator< std::string > > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[" "double" "]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_nominal'."
      "  Prototype:\n"
      "    NOMINAL(self,{char})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_set_nominal(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg2 = 0 ;
  std::vector< double,std::allocator< double > > *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< std::string > m2 ;
  std::vector< double > m3 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DaeBuilder_set_nominal",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_set_nominal" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "char" "}" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "[" "double" "]" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->set_nominal((std::vector< std::string,std::allocator< std::string > > const &)*arg2,(std::vector< double,std::allocator< double > > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_set_nominal'."
      "  Prototype:\n"
      "    SET_NOMINAL(self,{char},[double])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_start(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< std::string > m2 ;
  mxArray * _out;
  std::vector< double,std::allocator< double > > result;
  
  if (!SWIG_check_num_args("DaeBuilder_start",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_start" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "char" "}" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::DaeBuilder const *)arg1)->start((std::vector< std::string,std::allocator< std::string > > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[" "double" "]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_start'."
      "  Prototype:\n"
      "    START(self,{char})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_set_start(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg2 = 0 ;
  std::vector< double,std::allocator< double > > *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< std::string > m2 ;
  std::vector< double > m3 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DaeBuilder_set_start",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_set_start" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "char" "}" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "[" "double" "]" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->set_start((std::vector< std::string,std::allocator< std::string > > const &)*arg2,(std::vector< double,std::allocator< double > > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_set_start'."
      "  Prototype:\n"
      "    SET_START(self,{char},[double])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_set__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg2 = 0 ;
  std::vector< double,std::allocator< double > > *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< std::string > m2 ;
  std::vector< double > m3 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DaeBuilder_set",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_set" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "char" "}" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "[" "double" "]" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->set((std::vector< std::string,std::allocator< std::string > > const &)*arg2,(std::vector< double,std::allocator< double > > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_set'."
      "  Prototype:\n"
      "    SET(self,{char},[double])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_set__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg2 = 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< std::string > m2 ;
  std::vector< std::string > m3 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DaeBuilder_set",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_set" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "char" "}" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "{" "char" "}" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->set((std::vector< std::string,std::allocator< std::string > > const &)*arg2,(std::vector< std::string,std::allocator< std::string > > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_set'."
      "  Prototype:\n"
      "    SET(self,{char},{char})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_set(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__DaeBuilder, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<std::string> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::vector<double> **>(0));
        if (_v) {
          return _wrap_DaeBuilder_set__SWIG_0(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__DaeBuilder, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<std::string> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::vector<std::string> **>(0));
        if (_v) {
          return _wrap_DaeBuilder_set__SWIG_1(resc,resv,argc,argv);
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_set'."
    "  Possible prototypes are:\n"
    "    SET(self,{char},[double])\n"
    "    SET(self,{char},{char})\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_DaeBuilder_get(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< std::string > m2 ;
  mxArray * _out;
  std::vector< casadi::GenericType,std::allocator< casadi::GenericType > > result;
  
  if (!SWIG_check_num_args("DaeBuilder_get",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_get" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "char" "}" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::DaeBuilder const *)arg1)->get((std::vector< std::string,std::allocator< std::string > > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "GenericType" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_get'."
      "  Prototype:\n"
      "    GET(self,{char})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_add_variable__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::string *arg2 = 0 ;
  casadi_int arg3 = (casadi_int) 1 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("DaeBuilder_add_variable",argc,3,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_add_variable" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->add_variable((std::string const &)*arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_add_variable'."
      "  Prototype:\n"
      "    ADD_VARIABLE(self,char,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_add_variable__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::string *arg2 = 0 ;
  casadi::Sparsity *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  casadi::Sparsity m3 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("DaeBuilder_add_variable",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_add_variable" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "Sparsity" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->add_variable((std::string const &)*arg2,(casadi::Sparsity const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_add_variable'."
      "  Prototype:\n"
      "    ADD_VARIABLE(self,char,Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_add_variable__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  casadi::MX *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DaeBuilder_add_variable",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_add_variable" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->add_variable((casadi::MX const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_add_variable'."
      "  Prototype:\n"
      "    ADD_VARIABLE(self,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_add_variable(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__DaeBuilder, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        return _wrap_DaeBuilder_add_variable__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if ((argc >= 2) && (argc <= 3)) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__DaeBuilder, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_DaeBuilder_add_variable__SWIG_0(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          return _wrap_DaeBuilder_add_variable__SWIG_0(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__DaeBuilder, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Sparsity **>(0));
        if (_v) {
          return _wrap_DaeBuilder_add_variable__SWIG_1(resc,resv,argc,argv);
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_add_variable'."
    "  Possible prototypes are:\n"
    "    ADD_VARIABLE(self,MX)\n"
    "    ADD_VARIABLE(self,char,int)\n"
    "    ADD_VARIABLE(self,char,Sparsity)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_DaeBuilder_add_variable_new__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::string *arg2 = 0 ;
  casadi_int arg3 = (casadi_int) 1 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  size_t result;
  
  if (!SWIG_check_num_args("DaeBuilder_add_variable_new",argc,3,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_add_variable_new" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->add_variable_new((std::string const &)*arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_From_size_t(static_cast< size_t >(result));
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_add_variable_new'."
      "  Prototype:\n"
      "    ADD_VARIABLE_NEW(self,char,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_add_variable_new__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::string *arg2 = 0 ;
  casadi::Sparsity *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  casadi::Sparsity m3 ;
  mxArray * _out;
  size_t result;
  
  if (!SWIG_check_num_args("DaeBuilder_add_variable_new",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_add_variable_new" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "Sparsity" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->add_variable_new((std::string const &)*arg2,(casadi::Sparsity const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_From_size_t(static_cast< size_t >(result));
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_add_variable_new'."
      "  Prototype:\n"
      "    ADD_VARIABLE_NEW(self,char,Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_add_variable_new__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  casadi::MX *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  mxArray * _out;
  size_t result;
  
  if (!SWIG_check_num_args("DaeBuilder_add_variable_new",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_add_variable_new" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->add_variable_new((casadi::MX const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_From_size_t(static_cast< size_t >(result));
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_add_variable_new'."
      "  Prototype:\n"
      "    ADD_VARIABLE_NEW(self,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_add_variable_new(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__DaeBuilder, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        return _wrap_DaeBuilder_add_variable_new__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if ((argc >= 2) && (argc <= 3)) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__DaeBuilder, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_DaeBuilder_add_variable_new__SWIG_0(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< casadi_int **>(0));
        if (_v) {
          return _wrap_DaeBuilder_add_variable_new__SWIG_0(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__DaeBuilder, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Sparsity **>(0));
        if (_v) {
          return _wrap_DaeBuilder_add_variable_new__SWIG_1(resc,resv,argc,argv);
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_add_variable_new'."
    "  Possible prototypes are:\n"
    "    ADD_VARIABLE_NEW(self,MX)\n"
    "    ADD_VARIABLE_NEW(self,char,int)\n"
    "    ADD_VARIABLE_NEW(self,char,Sparsity)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_DaeBuilder_has_variable(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("DaeBuilder_has_variable",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_has_variable" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::DaeBuilder const *)arg1)->has_variable((std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_has_variable'."
      "  Prototype:\n"
      "    HAS_VARIABLE(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_all_variables(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< std::string,std::allocator< std::string > > result;
  
  if (!SWIG_check_num_args("DaeBuilder_all_variables",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_all_variables" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::DaeBuilder const *)arg1)->all_variables();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "char" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_all_variables'."
      "  Prototype:\n"
      "    ALL_VARIABLES(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_oracle(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  bool arg2 = (bool) false ;
  bool arg3 = (bool) false ;
  bool arg4 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("DaeBuilder_oracle",argc,4,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_oracle" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "bool" "'.");
  }
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  }
  if (3<argc) {
    if (!casadi::to_val(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::DaeBuilder const *)arg1)->oracle(arg2,arg3,arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_oracle'."
      "  Prototype:\n"
      "    ORACLE(self,bool,bool,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DaeBuilder_jac_sparsity(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg2 = 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< std::string > m2 ;
  std::vector< std::string > m3 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("DaeBuilder_jac_sparsity",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DaeBuilder_jac_sparsity" "', argument " "1"" of type '" "casadi::DaeBuilder const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "char" "}" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "{" "char" "}" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::DaeBuilder const *)arg1)->jac_sparsity((std::vector< std::string,std::allocator< std::string > > const &)*arg2,(std::vector< std::string,std::allocator< std::string > > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DaeBuilder_jac_sparsity'."
      "  Prototype:\n"
      "    JAC_SPARSITY(self,{char},{char})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_DaeBuilder__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = 0 ;
  void *argp1 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::DaeBuilder *result = 0 ;
  
  if (!SWIG_check_num_args("new_DaeBuilder",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_casadi__DaeBuilder,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_DaeBuilder" "', argument " "1"" of type '" "casadi::DaeBuilder const &""'"); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_DaeBuilder" "', argument " "1"" of type '" "casadi::DaeBuilder const &""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  {
    result = (casadi::DaeBuilder *)new casadi::DaeBuilder((casadi::DaeBuilder const &)*arg1);
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__DaeBuilder, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_DaeBuilder'."
      "  Prototype:\n"
      "    DAEBUILDER(DaeBuilder)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_DaeBuilder(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 0) {
    return _wrap_new_DaeBuilder__SWIG_0(resc,resv,argc,argv);
  }
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__DaeBuilder, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_new_DaeBuilder__SWIG_2(resc,resv,argc,argv);
    }
  }
  if ((argc >= 1) && (argc <= 3)) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::string **>(0));
    if (_v) {
      if (argc <= 1) {
        return _wrap_new_DaeBuilder__SWIG_1(resc,resv,argc,argv);
      }
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_new_DaeBuilder__SWIG_1(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< std::map<std::string,casadi::GenericType> **>(0));
        if (_v) {
          return _wrap_new_DaeBuilder__SWIG_1(resc,resv,argc,argv);
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_DaeBuilder'."
    "  Possible prototypes are:\n"
    "    DAEBUILDER()\n"
    "    DAEBUILDER(DaeBuilder)\n"
    "    DAEBUILDER(char,char,struct)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_delete_DaeBuilder(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DaeBuilder *arg1 = (casadi::DaeBuilder *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  int is_owned;
  if (!SWIG_check_num_args("delete_DaeBuilder",argc,1,1,0)) {
    SWIG_fail;
  }
  is_owned = SWIG_Matlab_isOwned(argv[0]);
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DaeBuilder, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_DaeBuilder" "', argument " "1"" of type '" "casadi::DaeBuilder *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DaeBuilder * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  if (is_owned) {
    {
      delete arg1;
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'delete_DaeBuilder'."
      "  Prototype:\n"
      "    DAEBUILDER(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_XmlFile_type_name(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("XmlFile_type_name",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      result = casadi::XmlFile::type_name();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'XmlFile_type_name'."
      "  Prototype:\n"
      "    TYPE_NAME()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_XmlFile__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  casadi::XmlFile *result = 0 ;
  
  if (!SWIG_check_num_args("new_XmlFile",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      result = (casadi::XmlFile *)new casadi::XmlFile();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__XmlFile, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_XmlFile'."
      "  Prototype:\n"
      "    XMLFILE()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_XmlFile__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string m1 ;
  mxArray * _out;
  casadi::XmlFile *result = 0 ;
  
  if (!SWIG_check_num_args("new_XmlFile",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  {
    try {
      result = (casadi::XmlFile *)new casadi::XmlFile((std::string const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__XmlFile, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_XmlFile'."
      "  Prototype:\n"
      "    XMLFILE(char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_delete_XmlFile(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::XmlFile *arg1 = (casadi::XmlFile *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  int is_owned;
  if (!SWIG_check_num_args("delete_XmlFile",argc,1,1,0)) {
    SWIG_fail;
  }
  is_owned = SWIG_Matlab_isOwned(argv[0]);
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__XmlFile, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_XmlFile" "', argument " "1"" of type '" "casadi::XmlFile *""'"); 
  }
  arg1 = reinterpret_cast< casadi::XmlFile * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  if (is_owned) {
    {
      try {
        delete arg1;
      } catch(const std::exception& e) {
        SWIG_exception(SWIG_RuntimeError, e.what());
      }
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'delete_XmlFile'."
      "  Prototype:\n"
      "    XMLFILE(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_XmlFile_load_plugin(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string m1 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("XmlFile_load_plugin",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  {
    try {
      casadi::XmlFile::load_plugin((std::string const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'XmlFile_load_plugin'."
      "  Prototype:\n"
      "    LOAD_PLUGIN(char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_XmlFile_doc(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string m1 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("XmlFile_doc",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  {
    try {
      result = casadi::XmlFile::doc((std::string const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'XmlFile_doc'."
      "  Prototype:\n"
      "    DOC(char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_XmlFile__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::XmlFile *arg1 = 0 ;
  void *argp1 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::XmlFile *result = 0 ;
  
  if (!SWIG_check_num_args("new_XmlFile",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_casadi__XmlFile,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_XmlFile" "', argument " "1"" of type '" "casadi::XmlFile const &""'"); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_XmlFile" "', argument " "1"" of type '" "casadi::XmlFile const &""'"); 
  }
  arg1 = reinterpret_cast< casadi::XmlFile * >(argp1);
  {
    result = (casadi::XmlFile *)new casadi::XmlFile((casadi::XmlFile const &)*arg1);
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__XmlFile, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_XmlFile'."
      "  Prototype:\n"
      "    XMLFILE(XmlFile)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_XmlFile(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 0) {
    return _wrap_new_XmlFile__SWIG_0(resc,resv,argc,argv);
  }
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__XmlFile, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_new_XmlFile__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    _v = casadi::to_ptr(argv[0], static_cast< std::string **>(0));
    if (_v) {
      return _wrap_new_XmlFile__SWIG_1(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_XmlFile'."
    "  Possible prototypes are:\n"
    "    XMLFILE()\n"
    "    XMLFILE(XmlFile)\n"
    "    XMLFILE(char)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_delete_SerializerBase(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::SerializerBase *arg1 = (casadi::SerializerBase *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  int is_owned;
  if (!SWIG_check_num_args("delete_SerializerBase",argc,1,1,0)) {
    SWIG_fail;
  }
  is_owned = SWIG_Matlab_isOwned(argv[0]);
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__SerializerBase, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_SerializerBase" "', argument " "1"" of type '" "casadi::SerializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::SerializerBase * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  if (is_owned) {
    {
      try {
        delete arg1;
      } catch(const std::exception& e) {
        SWIG_exception(SWIG_RuntimeError, e.what());
      }
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'delete_SerializerBase'."
      "  Prototype:\n"
      "    SERIALIZERBASE(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SerializerBase_pack__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::SerializerBase *arg1 = (casadi::SerializerBase *) 0 ;
  casadi::Sparsity *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Sparsity m2 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("SerializerBase_pack",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__SerializerBase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerializerBase_pack" "', argument " "1"" of type '" "casadi::SerializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::SerializerBase * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "Sparsity" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->pack((casadi::Sparsity const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SerializerBase_pack'."
      "  Prototype:\n"
      "    PACK(self,Sparsity)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SerializerBase_pack__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::SerializerBase *arg1 = (casadi::SerializerBase *) 0 ;
  casadi::MX *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("SerializerBase_pack",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__SerializerBase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerializerBase_pack" "', argument " "1"" of type '" "casadi::SerializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::SerializerBase * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->pack((casadi::MX const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SerializerBase_pack'."
      "  Prototype:\n"
      "    PACK(self,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SerializerBase_pack__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::SerializerBase *arg1 = (casadi::SerializerBase *) 0 ;
  casadi::Matrix< double > *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< double > m2 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("SerializerBase_pack",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__SerializerBase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerializerBase_pack" "', argument " "1"" of type '" "casadi::SerializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::SerializerBase * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->pack((casadi::Matrix< double > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SerializerBase_pack'."
      "  Prototype:\n"
      "    PACK(self,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SerializerBase_pack__SWIG_3(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::SerializerBase *arg1 = (casadi::SerializerBase *) 0 ;
  casadi::Matrix< casadi::SXElem > *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("SerializerBase_pack",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__SerializerBase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerializerBase_pack" "', argument " "1"" of type '" "casadi::SerializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::SerializerBase * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->pack((casadi::Matrix< casadi::SXElem > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SerializerBase_pack'."
      "  Prototype:\n"
      "    PACK(self,SX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SerializerBase_pack__SWIG_4(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::SerializerBase *arg1 = (casadi::SerializerBase *) 0 ;
  casadi::Linsol *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("SerializerBase_pack",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__SerializerBase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerializerBase_pack" "', argument " "1"" of type '" "casadi::SerializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::SerializerBase * >(argp1);
  res2 = SWIG_ConvertPtr(argv[1], &argp2, SWIGTYPE_p_casadi__Linsol,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SerializerBase_pack" "', argument " "2"" of type '" "casadi::Linsol const &""'"); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "SerializerBase_pack" "', argument " "2"" of type '" "casadi::Linsol const &""'"); 
  }
  arg2 = reinterpret_cast< casadi::Linsol * >(argp2);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->pack((casadi::Linsol const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SerializerBase_pack'."
      "  Prototype:\n"
      "    PACK(self,Linsol)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SerializerBase_pack__SWIG_5(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::SerializerBase *arg1 = (casadi::SerializerBase *) 0 ;
  casadi::Function *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Function m2 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("SerializerBase_pack",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__SerializerBase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerializerBase_pack" "', argument " "1"" of type '" "casadi::SerializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::SerializerBase * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "Function" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->pack((casadi::Function const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SerializerBase_pack'."
      "  Prototype:\n"
      "    PACK(self,Function)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SerializerBase_pack__SWIG_6(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::SerializerBase *arg1 = (casadi::SerializerBase *) 0 ;
  casadi::GenericType *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::GenericType m2 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("SerializerBase_pack",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__SerializerBase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerializerBase_pack" "', argument " "1"" of type '" "casadi::SerializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::SerializerBase * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "GenericType" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->pack((casadi::GenericType const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SerializerBase_pack'."
      "  Prototype:\n"
      "    PACK(self,GenericType)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SerializerBase_pack__SWIG_7(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::SerializerBase *arg1 = (casadi::SerializerBase *) 0 ;
  casadi_int *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi_int m2 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("SerializerBase_pack",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__SerializerBase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerializerBase_pack" "', argument " "1"" of type '" "casadi::SerializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::SerializerBase * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->pack((casadi_int const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SerializerBase_pack'."
      "  Prototype:\n"
      "    PACK(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SerializerBase_pack__SWIG_8(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::SerializerBase *arg1 = (casadi::SerializerBase *) 0 ;
  double *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double m2 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("SerializerBase_pack",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__SerializerBase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerializerBase_pack" "', argument " "1"" of type '" "casadi::SerializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::SerializerBase * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "double" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->pack((double const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SerializerBase_pack'."
      "  Prototype:\n"
      "    PACK(self,double)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SerializerBase_pack__SWIG_9(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::SerializerBase *arg1 = (casadi::SerializerBase *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("SerializerBase_pack",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__SerializerBase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerializerBase_pack" "', argument " "1"" of type '" "casadi::SerializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::SerializerBase * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->pack((std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SerializerBase_pack'."
      "  Prototype:\n"
      "    PACK(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SerializerBase_pack__SWIG_10(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::SerializerBase *arg1 = (casadi::SerializerBase *) 0 ;
  std::vector< casadi::Sparsity,std::allocator< casadi::Sparsity > > *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< casadi::Sparsity > m2 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("SerializerBase_pack",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__SerializerBase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerializerBase_pack" "', argument " "1"" of type '" "casadi::SerializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::SerializerBase * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "Sparsity" "}" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->pack((std::vector< casadi::Sparsity,std::allocator< casadi::Sparsity > > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SerializerBase_pack'."
      "  Prototype:\n"
      "    PACK(self,{Sparsity})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SerializerBase_pack__SWIG_11(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::SerializerBase *arg1 = (casadi::SerializerBase *) 0 ;
  std::vector< casadi::MX,std::allocator< casadi::MX > > *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< casadi::MX > m2 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("SerializerBase_pack",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__SerializerBase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerializerBase_pack" "', argument " "1"" of type '" "casadi::SerializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::SerializerBase * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "MX" "}" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->pack((std::vector< casadi::MX,std::allocator< casadi::MX > > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SerializerBase_pack'."
      "  Prototype:\n"
      "    PACK(self,{MX})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SerializerBase_pack__SWIG_12(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::SerializerBase *arg1 = (casadi::SerializerBase *) 0 ;
  std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< casadi::Matrix< double > > m2 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("SerializerBase_pack",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__SerializerBase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerializerBase_pack" "', argument " "1"" of type '" "casadi::SerializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::SerializerBase * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "DM" "}" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->pack((std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SerializerBase_pack'."
      "  Prototype:\n"
      "    PACK(self,{DM})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SerializerBase_pack__SWIG_13(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::SerializerBase *arg1 = (casadi::SerializerBase *) 0 ;
  std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< casadi::Matrix< casadi::SXElem > > m2 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("SerializerBase_pack",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__SerializerBase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerializerBase_pack" "', argument " "1"" of type '" "casadi::SerializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::SerializerBase * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "SX" "}" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->pack((std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SerializerBase_pack'."
      "  Prototype:\n"
      "    PACK(self,{SX})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SerializerBase_pack__SWIG_14(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::SerializerBase *arg1 = (casadi::SerializerBase *) 0 ;
  std::vector< casadi::Linsol,std::allocator< casadi::Linsol > > *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("SerializerBase_pack",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__SerializerBase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerializerBase_pack" "', argument " "1"" of type '" "casadi::SerializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::SerializerBase * >(argp1);
  res2 = SWIG_ConvertPtr(argv[1], &argp2, SWIGTYPE_p_std__vectorT_casadi__Linsol_std__allocatorT_casadi__Linsol_t_t,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SerializerBase_pack" "', argument " "2"" of type '" "std::vector< casadi::Linsol,std::allocator< casadi::Linsol > > const &""'"); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "SerializerBase_pack" "', argument " "2"" of type '" "std::vector< casadi::Linsol,std::allocator< casadi::Linsol > > const &""'"); 
  }
  arg2 = reinterpret_cast< std::vector< casadi::Linsol,std::allocator< casadi::Linsol > > * >(argp2);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->pack((std::vector< casadi::Linsol,std::allocator< casadi::Linsol > > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SerializerBase_pack'."
      "  Prototype:\n"
      "    PACK(self,std::vector< casadi::Linsol,std::allocator< casadi::Linsol > > const &)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SerializerBase_pack__SWIG_15(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::SerializerBase *arg1 = (casadi::SerializerBase *) 0 ;
  std::vector< casadi::Function,std::allocator< casadi::Function > > *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< casadi::Function > m2 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("SerializerBase_pack",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__SerializerBase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerializerBase_pack" "', argument " "1"" of type '" "casadi::SerializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::SerializerBase * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "Function" "}" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->pack((std::vector< casadi::Function,std::allocator< casadi::Function > > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SerializerBase_pack'."
      "  Prototype:\n"
      "    PACK(self,{Function})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SerializerBase_pack__SWIG_16(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::SerializerBase *arg1 = (casadi::SerializerBase *) 0 ;
  std::vector< casadi::GenericType,std::allocator< casadi::GenericType > > *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< casadi::GenericType > m2 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("SerializerBase_pack",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__SerializerBase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerializerBase_pack" "', argument " "1"" of type '" "casadi::SerializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::SerializerBase * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "GenericType" "}" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->pack((std::vector< casadi::GenericType,std::allocator< casadi::GenericType > > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SerializerBase_pack'."
      "  Prototype:\n"
      "    PACK(self,{GenericType})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SerializerBase_pack__SWIG_17(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::SerializerBase *arg1 = (casadi::SerializerBase *) 0 ;
  std::vector< casadi_int,std::allocator< casadi_int > > *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< casadi_int > m2 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("SerializerBase_pack",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__SerializerBase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerializerBase_pack" "', argument " "1"" of type '" "casadi::SerializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::SerializerBase * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "[" "int" "]" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->pack((std::vector< casadi_int,std::allocator< casadi_int > > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SerializerBase_pack'."
      "  Prototype:\n"
      "    PACK(self,[int])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SerializerBase_pack__SWIG_18(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::SerializerBase *arg1 = (casadi::SerializerBase *) 0 ;
  std::vector< double,std::allocator< double > > *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< double > m2 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("SerializerBase_pack",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__SerializerBase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerializerBase_pack" "', argument " "1"" of type '" "casadi::SerializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::SerializerBase * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "[" "double" "]" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->pack((std::vector< double,std::allocator< double > > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SerializerBase_pack'."
      "  Prototype:\n"
      "    PACK(self,[double])\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SerializerBase_pack__SWIG_19(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::SerializerBase *arg1 = (casadi::SerializerBase *) 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< std::string > m2 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("SerializerBase_pack",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__SerializerBase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerializerBase_pack" "', argument " "1"" of type '" "casadi::SerializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::SerializerBase * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "char" "}" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->pack((std::vector< std::string,std::allocator< std::string > > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SerializerBase_pack'."
      "  Prototype:\n"
      "    PACK(self,{char})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SerializerBase_pack(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__SerializerBase, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_casadi__Linsol, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap_SerializerBase_pack__SWIG_4(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__SerializerBase, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_std__vectorT_casadi__Linsol_std__allocatorT_casadi__Linsol_t_t, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap_SerializerBase_pack__SWIG_14(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__SerializerBase, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi_int **>(0));
      if (_v) {
        return _wrap_SerializerBase_pack__SWIG_7(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__SerializerBase, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< double **>(0));
      if (_v) {
        return _wrap_SerializerBase_pack__SWIG_8(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__SerializerBase, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector< casadi::Sparsity> **>(0));
      if (_v) {
        return _wrap_SerializerBase_pack__SWIG_10(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__SerializerBase, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Sparsity **>(0));
      if (_v) {
        return _wrap_SerializerBase_pack__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__SerializerBase, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<double> **>(0));
      if (_v) {
        return _wrap_SerializerBase_pack__SWIG_18(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__SerializerBase, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<casadi_int> **>(0));
      if (_v) {
        return _wrap_SerializerBase_pack__SWIG_17(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__SerializerBase, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<std::string> **>(0));
      if (_v) {
        return _wrap_SerializerBase_pack__SWIG_19(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__SerializerBase, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        return _wrap_SerializerBase_pack__SWIG_2(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__SerializerBase, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector< casadi::Matrix<double> > **>(0));
      if (_v) {
        return _wrap_SerializerBase_pack__SWIG_12(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__SerializerBase, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        return _wrap_SerializerBase_pack__SWIG_3(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__SerializerBase, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector< casadi::Matrix<casadi::SXElem> > **>(0));
      if (_v) {
        return _wrap_SerializerBase_pack__SWIG_13(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__SerializerBase, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        return _wrap_SerializerBase_pack__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__SerializerBase, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<casadi::MX> **>(0));
      if (_v) {
        return _wrap_SerializerBase_pack__SWIG_11(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__SerializerBase, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        return _wrap_SerializerBase_pack__SWIG_9(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__SerializerBase, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<casadi::Function> **>(0));
      if (_v) {
        return _wrap_SerializerBase_pack__SWIG_15(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__SerializerBase, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Function **>(0));
      if (_v) {
        return _wrap_SerializerBase_pack__SWIG_5(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__SerializerBase, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<casadi::GenericType> **>(0));
      if (_v) {
        return _wrap_SerializerBase_pack__SWIG_16(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__SerializerBase, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::GenericType **>(0));
      if (_v) {
        return _wrap_SerializerBase_pack__SWIG_6(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SerializerBase_pack'."
    "  Possible prototypes are:\n"
    "    PACK(self,Linsol)\n"
    "    PACK(self,std::vector< casadi::Linsol,std::allocator< casadi::Linsol > > const &)\n"
    "    PACK(self,int)\n"
    "    PACK(self,double)\n"
    "    PACK(self,{Sparsity})\n"
    "    PACK(self,Sparsity)\n"
    "    PACK(self,[double])\n"
    "    PACK(self,[int])\n"
    "    PACK(self,{char})\n"
    "    PACK(self,DM)\n"
    "    PACK(self,{DM})\n"
    "    PACK(self,SX)\n"
    "    PACK(self,{SX})\n"
    "    PACK(self,MX)\n"
    "    PACK(self,{MX})\n"
    "    PACK(self,char)\n"
    "    PACK(self,{Function})\n"
    "    PACK(self,Function)\n"
    "    PACK(self,{GenericType})\n"
    "    PACK(self,GenericType)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_SerializerBase_type_to_string(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::SerializerBase::SerializationType arg1 ;
  int val1 ;
  int ecode1 = 0 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("SerializerBase_type_to_string",argc,1,1,0)) {
    SWIG_fail;
  }
  ecode1 = SWIG_AsVal_int(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "SerializerBase_type_to_string" "', argument " "1"" of type '" "casadi::SerializerBase::SerializationType""'");
  } 
  arg1 = static_cast< casadi::SerializerBase::SerializationType >(val1);
  {
    try {
      result = casadi::SerializerBase::type_to_string(arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SerializerBase_type_to_string'."
      "  Prototype:\n"
      "    TYPE_TO_STRING(casadi::SerializerBase::SerializationType)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SerializerBase_connect(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::SerializerBase *arg1 = (casadi::SerializerBase *) 0 ;
  casadi::DeserializerBase *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("SerializerBase_connect",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__SerializerBase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerializerBase_connect" "', argument " "1"" of type '" "casadi::SerializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::SerializerBase * >(argp1);
  res2 = SWIG_ConvertPtr(argv[1], &argp2, SWIGTYPE_p_casadi__DeserializerBase,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SerializerBase_connect" "', argument " "2"" of type '" "casadi::DeserializerBase &""'"); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "SerializerBase_connect" "', argument " "2"" of type '" "casadi::DeserializerBase &""'"); 
  }
  arg2 = reinterpret_cast< casadi::DeserializerBase * >(argp2);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->connect(*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SerializerBase_connect'."
      "  Prototype:\n"
      "    CONNECT(self,DeserializerBase)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_SerializerBase_reset(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::SerializerBase *arg1 = (casadi::SerializerBase *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("SerializerBase_reset",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__SerializerBase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SerializerBase_reset" "', argument " "1"" of type '" "casadi::SerializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::SerializerBase * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->reset();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'SerializerBase_reset'."
      "  Prototype:\n"
      "    RESET(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_delete_DeserializerBase(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DeserializerBase *arg1 = (casadi::DeserializerBase *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  int is_owned;
  if (!SWIG_check_num_args("delete_DeserializerBase",argc,1,1,0)) {
    SWIG_fail;
  }
  is_owned = SWIG_Matlab_isOwned(argv[0]);
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DeserializerBase, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_DeserializerBase" "', argument " "1"" of type '" "casadi::DeserializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DeserializerBase * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  if (is_owned) {
    {
      try {
        delete arg1;
      } catch(const std::exception& e) {
        SWIG_exception(SWIG_RuntimeError, e.what());
      }
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'delete_DeserializerBase'."
      "  Prototype:\n"
      "    DESERIALIZERBASE(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DeserializerBase_internal_pop_type(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DeserializerBase *arg1 = (casadi::DeserializerBase *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::SerializerBase::SerializationType result;
  
  if (!SWIG_check_num_args("DeserializerBase_internal_pop_type",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DeserializerBase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DeserializerBase_internal_pop_type" "', argument " "1"" of type '" "casadi::DeserializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DeserializerBase * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi::SerializerBase::SerializationType)(arg1)->pop_type();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_From_int(static_cast< int >(result));
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DeserializerBase_internal_pop_type'."
      "  Prototype:\n"
      "    INTERNAL_POP_TYPE(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DeserializerBase_blind_unpack_sparsity(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DeserializerBase *arg1 = (casadi::DeserializerBase *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("DeserializerBase_blind_unpack_sparsity",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DeserializerBase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DeserializerBase_blind_unpack_sparsity" "', argument " "1"" of type '" "casadi::DeserializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DeserializerBase * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->blind_unpack_sparsity();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DeserializerBase_blind_unpack_sparsity'."
      "  Prototype:\n"
      "    BLIND_UNPACK_SPARSITY(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DeserializerBase_blind_unpack_mx(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DeserializerBase *arg1 = (casadi::DeserializerBase *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("DeserializerBase_blind_unpack_mx",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DeserializerBase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DeserializerBase_blind_unpack_mx" "', argument " "1"" of type '" "casadi::DeserializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DeserializerBase * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->blind_unpack_mx();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DeserializerBase_blind_unpack_mx'."
      "  Prototype:\n"
      "    BLIND_UNPACK_MX(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DeserializerBase_blind_unpack_dm(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DeserializerBase *arg1 = (casadi::DeserializerBase *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("DeserializerBase_blind_unpack_dm",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DeserializerBase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DeserializerBase_blind_unpack_dm" "', argument " "1"" of type '" "casadi::DeserializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DeserializerBase * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->blind_unpack_dm();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DeserializerBase_blind_unpack_dm'."
      "  Prototype:\n"
      "    BLIND_UNPACK_DM(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DeserializerBase_blind_unpack_sx(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DeserializerBase *arg1 = (casadi::DeserializerBase *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("DeserializerBase_blind_unpack_sx",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DeserializerBase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DeserializerBase_blind_unpack_sx" "', argument " "1"" of type '" "casadi::DeserializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DeserializerBase * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->blind_unpack_sx();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DeserializerBase_blind_unpack_sx'."
      "  Prototype:\n"
      "    BLIND_UNPACK_SX(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DeserializerBase_blind_unpack_linsol(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DeserializerBase *arg1 = (casadi::DeserializerBase *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Linsol result;
  
  if (!SWIG_check_num_args("DeserializerBase_blind_unpack_linsol",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DeserializerBase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DeserializerBase_blind_unpack_linsol" "', argument " "1"" of type '" "casadi::DeserializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DeserializerBase * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->blind_unpack_linsol();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj((new casadi::Linsol(static_cast< const casadi::Linsol& >(result))), SWIGTYPE_p_casadi__Linsol, SWIG_POINTER_OWN |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DeserializerBase_blind_unpack_linsol'."
      "  Prototype:\n"
      "    BLIND_UNPACK_LINSOL(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DeserializerBase_blind_unpack_function(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DeserializerBase *arg1 = (casadi::DeserializerBase *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("DeserializerBase_blind_unpack_function",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DeserializerBase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DeserializerBase_blind_unpack_function" "', argument " "1"" of type '" "casadi::DeserializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DeserializerBase * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->blind_unpack_function();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DeserializerBase_blind_unpack_function'."
      "  Prototype:\n"
      "    BLIND_UNPACK_FUNCTION(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DeserializerBase_blind_unpack_generictype(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DeserializerBase *arg1 = (casadi::DeserializerBase *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::GenericType result;
  
  if (!SWIG_check_num_args("DeserializerBase_blind_unpack_generictype",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DeserializerBase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DeserializerBase_blind_unpack_generictype" "', argument " "1"" of type '" "casadi::DeserializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DeserializerBase * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->blind_unpack_generictype();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "GenericType" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DeserializerBase_blind_unpack_generictype'."
      "  Prototype:\n"
      "    BLIND_UNPACK_GENERICTYPE(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DeserializerBase_blind_unpack_int(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DeserializerBase *arg1 = (casadi::DeserializerBase *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("DeserializerBase_blind_unpack_int",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DeserializerBase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DeserializerBase_blind_unpack_int" "', argument " "1"" of type '" "casadi::DeserializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DeserializerBase * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)(arg1)->blind_unpack_int();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DeserializerBase_blind_unpack_int'."
      "  Prototype:\n"
      "    BLIND_UNPACK_INT(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DeserializerBase_blind_unpack_double(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DeserializerBase *arg1 = (casadi::DeserializerBase *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  double result;
  
  if (!SWIG_check_num_args("DeserializerBase_blind_unpack_double",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DeserializerBase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DeserializerBase_blind_unpack_double" "', argument " "1"" of type '" "casadi::DeserializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DeserializerBase * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (double)(arg1)->blind_unpack_double();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "double" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DeserializerBase_blind_unpack_double'."
      "  Prototype:\n"
      "    BLIND_UNPACK_DOUBLE(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DeserializerBase_blind_unpack_string(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DeserializerBase *arg1 = (casadi::DeserializerBase *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("DeserializerBase_blind_unpack_string",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DeserializerBase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DeserializerBase_blind_unpack_string" "', argument " "1"" of type '" "casadi::DeserializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DeserializerBase * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->blind_unpack_string();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DeserializerBase_blind_unpack_string'."
      "  Prototype:\n"
      "    BLIND_UNPACK_STRING(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DeserializerBase_blind_unpack_sparsity_vector(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DeserializerBase *arg1 = (casadi::DeserializerBase *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi::Sparsity,std::allocator< casadi::Sparsity > > result;
  
  if (!SWIG_check_num_args("DeserializerBase_blind_unpack_sparsity_vector",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DeserializerBase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DeserializerBase_blind_unpack_sparsity_vector" "', argument " "1"" of type '" "casadi::DeserializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DeserializerBase * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->blind_unpack_sparsity_vector();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "Sparsity" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DeserializerBase_blind_unpack_sparsity_vector'."
      "  Prototype:\n"
      "    BLIND_UNPACK_SPARSITY_VECTOR(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DeserializerBase_blind_unpack_mx_vector(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DeserializerBase *arg1 = (casadi::DeserializerBase *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi::MX,std::allocator< casadi::MX > > result;
  
  if (!SWIG_check_num_args("DeserializerBase_blind_unpack_mx_vector",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DeserializerBase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DeserializerBase_blind_unpack_mx_vector" "', argument " "1"" of type '" "casadi::DeserializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DeserializerBase * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->blind_unpack_mx_vector();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "MX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DeserializerBase_blind_unpack_mx_vector'."
      "  Prototype:\n"
      "    BLIND_UNPACK_MX_VECTOR(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DeserializerBase_blind_unpack_dm_vector(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DeserializerBase *arg1 = (casadi::DeserializerBase *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > result;
  
  if (!SWIG_check_num_args("DeserializerBase_blind_unpack_dm_vector",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DeserializerBase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DeserializerBase_blind_unpack_dm_vector" "', argument " "1"" of type '" "casadi::DeserializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DeserializerBase * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->blind_unpack_dm_vector();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "DM" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DeserializerBase_blind_unpack_dm_vector'."
      "  Prototype:\n"
      "    BLIND_UNPACK_DM_VECTOR(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DeserializerBase_blind_unpack_sx_vector(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DeserializerBase *arg1 = (casadi::DeserializerBase *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > result;
  
  if (!SWIG_check_num_args("DeserializerBase_blind_unpack_sx_vector",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DeserializerBase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DeserializerBase_blind_unpack_sx_vector" "', argument " "1"" of type '" "casadi::DeserializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DeserializerBase * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->blind_unpack_sx_vector();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "SX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DeserializerBase_blind_unpack_sx_vector'."
      "  Prototype:\n"
      "    BLIND_UNPACK_SX_VECTOR(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DeserializerBase_blind_unpack_linsol_vector(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DeserializerBase *arg1 = (casadi::DeserializerBase *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  SwigValueWrapper< std::vector< casadi::Linsol,std::allocator< casadi::Linsol > > > result;
  
  if (!SWIG_check_num_args("DeserializerBase_blind_unpack_linsol_vector",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DeserializerBase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DeserializerBase_blind_unpack_linsol_vector" "', argument " "1"" of type '" "casadi::DeserializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DeserializerBase * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->blind_unpack_linsol_vector();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj((new std::vector< casadi::Linsol,std::allocator< casadi::Linsol > >(static_cast< const std::vector< casadi::Linsol,std::allocator< casadi::Linsol > >& >(result))), SWIGTYPE_p_std__vectorT_casadi__Linsol_std__allocatorT_casadi__Linsol_t_t, SWIG_POINTER_OWN |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DeserializerBase_blind_unpack_linsol_vector'."
      "  Prototype:\n"
      "    BLIND_UNPACK_LINSOL_VECTOR(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DeserializerBase_blind_unpack_function_vector(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DeserializerBase *arg1 = (casadi::DeserializerBase *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi::Function,std::allocator< casadi::Function > > result;
  
  if (!SWIG_check_num_args("DeserializerBase_blind_unpack_function_vector",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DeserializerBase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DeserializerBase_blind_unpack_function_vector" "', argument " "1"" of type '" "casadi::DeserializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DeserializerBase * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->blind_unpack_function_vector();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "Function" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DeserializerBase_blind_unpack_function_vector'."
      "  Prototype:\n"
      "    BLIND_UNPACK_FUNCTION_VECTOR(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DeserializerBase_blind_unpack_generictype_vector(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DeserializerBase *arg1 = (casadi::DeserializerBase *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi::GenericType,std::allocator< casadi::GenericType > > result;
  
  if (!SWIG_check_num_args("DeserializerBase_blind_unpack_generictype_vector",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DeserializerBase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DeserializerBase_blind_unpack_generictype_vector" "', argument " "1"" of type '" "casadi::DeserializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DeserializerBase * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->blind_unpack_generictype_vector();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "GenericType" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DeserializerBase_blind_unpack_generictype_vector'."
      "  Prototype:\n"
      "    BLIND_UNPACK_GENERICTYPE_VECTOR(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DeserializerBase_blind_unpack_int_vector(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DeserializerBase *arg1 = (casadi::DeserializerBase *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi_int,std::allocator< casadi_int > > result;
  
  if (!SWIG_check_num_args("DeserializerBase_blind_unpack_int_vector",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DeserializerBase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DeserializerBase_blind_unpack_int_vector" "', argument " "1"" of type '" "casadi::DeserializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DeserializerBase * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->blind_unpack_int_vector();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[" "int" "]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DeserializerBase_blind_unpack_int_vector'."
      "  Prototype:\n"
      "    BLIND_UNPACK_INT_VECTOR(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DeserializerBase_blind_unpack_double_vector(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DeserializerBase *arg1 = (casadi::DeserializerBase *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< double,std::allocator< double > > result;
  
  if (!SWIG_check_num_args("DeserializerBase_blind_unpack_double_vector",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DeserializerBase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DeserializerBase_blind_unpack_double_vector" "', argument " "1"" of type '" "casadi::DeserializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DeserializerBase * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->blind_unpack_double_vector();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[" "double" "]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DeserializerBase_blind_unpack_double_vector'."
      "  Prototype:\n"
      "    BLIND_UNPACK_DOUBLE_VECTOR(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DeserializerBase_blind_unpack_string_vector(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DeserializerBase *arg1 = (casadi::DeserializerBase *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< std::string,std::allocator< std::string > > result;
  
  if (!SWIG_check_num_args("DeserializerBase_blind_unpack_string_vector",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DeserializerBase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DeserializerBase_blind_unpack_string_vector" "', argument " "1"" of type '" "casadi::DeserializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DeserializerBase * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->blind_unpack_string_vector();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "char" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DeserializerBase_blind_unpack_string_vector'."
      "  Prototype:\n"
      "    BLIND_UNPACK_STRING_VECTOR(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DeserializerBase_unpack_sparsity(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DeserializerBase *arg1 = (casadi::DeserializerBase *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Sparsity result;
  
  if (!SWIG_check_num_args("DeserializerBase_unpack_sparsity",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DeserializerBase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DeserializerBase_unpack_sparsity" "', argument " "1"" of type '" "casadi::DeserializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DeserializerBase * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->unpack_sparsity();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Sparsity" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DeserializerBase_unpack_sparsity'."
      "  Prototype:\n"
      "    UNPACK_SPARSITY(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DeserializerBase_unpack_mx(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DeserializerBase *arg1 = (casadi::DeserializerBase *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("DeserializerBase_unpack_mx",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DeserializerBase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DeserializerBase_unpack_mx" "', argument " "1"" of type '" "casadi::DeserializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DeserializerBase * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->unpack_mx();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DeserializerBase_unpack_mx'."
      "  Prototype:\n"
      "    UNPACK_MX(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DeserializerBase_unpack_dm(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DeserializerBase *arg1 = (casadi::DeserializerBase *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Matrix< double > result;
  
  if (!SWIG_check_num_args("DeserializerBase_unpack_dm",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DeserializerBase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DeserializerBase_unpack_dm" "', argument " "1"" of type '" "casadi::DeserializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DeserializerBase * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->unpack_dm();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DeserializerBase_unpack_dm'."
      "  Prototype:\n"
      "    UNPACK_DM(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DeserializerBase_unpack_sx(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DeserializerBase *arg1 = (casadi::DeserializerBase *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Matrix< casadi::SXElem > result;
  
  if (!SWIG_check_num_args("DeserializerBase_unpack_sx",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DeserializerBase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DeserializerBase_unpack_sx" "', argument " "1"" of type '" "casadi::DeserializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DeserializerBase * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->unpack_sx();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "SX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DeserializerBase_unpack_sx'."
      "  Prototype:\n"
      "    UNPACK_SX(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DeserializerBase_unpack_linsol(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DeserializerBase *arg1 = (casadi::DeserializerBase *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Linsol result;
  
  if (!SWIG_check_num_args("DeserializerBase_unpack_linsol",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DeserializerBase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DeserializerBase_unpack_linsol" "', argument " "1"" of type '" "casadi::DeserializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DeserializerBase * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->unpack_linsol();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj((new casadi::Linsol(static_cast< const casadi::Linsol& >(result))), SWIGTYPE_p_casadi__Linsol, SWIG_POINTER_OWN |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DeserializerBase_unpack_linsol'."
      "  Prototype:\n"
      "    UNPACK_LINSOL(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DeserializerBase_unpack_function(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DeserializerBase *arg1 = (casadi::DeserializerBase *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("DeserializerBase_unpack_function",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DeserializerBase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DeserializerBase_unpack_function" "', argument " "1"" of type '" "casadi::DeserializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DeserializerBase * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->unpack_function();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DeserializerBase_unpack_function'."
      "  Prototype:\n"
      "    UNPACK_FUNCTION(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DeserializerBase_unpack_generictype(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DeserializerBase *arg1 = (casadi::DeserializerBase *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::GenericType result;
  
  if (!SWIG_check_num_args("DeserializerBase_unpack_generictype",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DeserializerBase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DeserializerBase_unpack_generictype" "', argument " "1"" of type '" "casadi::DeserializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DeserializerBase * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->unpack_generictype();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "GenericType" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DeserializerBase_unpack_generictype'."
      "  Prototype:\n"
      "    UNPACK_GENERICTYPE(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DeserializerBase_unpack_int(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DeserializerBase *arg1 = (casadi::DeserializerBase *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("DeserializerBase_unpack_int",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DeserializerBase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DeserializerBase_unpack_int" "', argument " "1"" of type '" "casadi::DeserializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DeserializerBase * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)(arg1)->unpack_int();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DeserializerBase_unpack_int'."
      "  Prototype:\n"
      "    UNPACK_INT(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DeserializerBase_unpack_double(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DeserializerBase *arg1 = (casadi::DeserializerBase *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  double result;
  
  if (!SWIG_check_num_args("DeserializerBase_unpack_double",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DeserializerBase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DeserializerBase_unpack_double" "', argument " "1"" of type '" "casadi::DeserializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DeserializerBase * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (double)(arg1)->unpack_double();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "double" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DeserializerBase_unpack_double'."
      "  Prototype:\n"
      "    UNPACK_DOUBLE(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DeserializerBase_unpack_string(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DeserializerBase *arg1 = (casadi::DeserializerBase *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("DeserializerBase_unpack_string",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DeserializerBase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DeserializerBase_unpack_string" "', argument " "1"" of type '" "casadi::DeserializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DeserializerBase * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->unpack_string();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DeserializerBase_unpack_string'."
      "  Prototype:\n"
      "    UNPACK_STRING(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DeserializerBase_unpack_sparsity_vector(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DeserializerBase *arg1 = (casadi::DeserializerBase *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi::Sparsity,std::allocator< casadi::Sparsity > > result;
  
  if (!SWIG_check_num_args("DeserializerBase_unpack_sparsity_vector",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DeserializerBase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DeserializerBase_unpack_sparsity_vector" "', argument " "1"" of type '" "casadi::DeserializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DeserializerBase * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->unpack_sparsity_vector();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "Sparsity" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DeserializerBase_unpack_sparsity_vector'."
      "  Prototype:\n"
      "    UNPACK_SPARSITY_VECTOR(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DeserializerBase_unpack_mx_vector(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DeserializerBase *arg1 = (casadi::DeserializerBase *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi::MX,std::allocator< casadi::MX > > result;
  
  if (!SWIG_check_num_args("DeserializerBase_unpack_mx_vector",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DeserializerBase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DeserializerBase_unpack_mx_vector" "', argument " "1"" of type '" "casadi::DeserializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DeserializerBase * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->unpack_mx_vector();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "MX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DeserializerBase_unpack_mx_vector'."
      "  Prototype:\n"
      "    UNPACK_MX_VECTOR(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DeserializerBase_unpack_dm_vector(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DeserializerBase *arg1 = (casadi::DeserializerBase *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > result;
  
  if (!SWIG_check_num_args("DeserializerBase_unpack_dm_vector",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DeserializerBase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DeserializerBase_unpack_dm_vector" "', argument " "1"" of type '" "casadi::DeserializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DeserializerBase * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->unpack_dm_vector();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "DM" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DeserializerBase_unpack_dm_vector'."
      "  Prototype:\n"
      "    UNPACK_DM_VECTOR(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DeserializerBase_unpack_sx_vector(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DeserializerBase *arg1 = (casadi::DeserializerBase *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > result;
  
  if (!SWIG_check_num_args("DeserializerBase_unpack_sx_vector",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DeserializerBase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DeserializerBase_unpack_sx_vector" "', argument " "1"" of type '" "casadi::DeserializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DeserializerBase * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->unpack_sx_vector();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "SX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DeserializerBase_unpack_sx_vector'."
      "  Prototype:\n"
      "    UNPACK_SX_VECTOR(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DeserializerBase_unpack_linsol_vector(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DeserializerBase *arg1 = (casadi::DeserializerBase *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  SwigValueWrapper< std::vector< casadi::Linsol,std::allocator< casadi::Linsol > > > result;
  
  if (!SWIG_check_num_args("DeserializerBase_unpack_linsol_vector",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DeserializerBase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DeserializerBase_unpack_linsol_vector" "', argument " "1"" of type '" "casadi::DeserializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DeserializerBase * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->unpack_linsol_vector();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj((new std::vector< casadi::Linsol,std::allocator< casadi::Linsol > >(static_cast< const std::vector< casadi::Linsol,std::allocator< casadi::Linsol > >& >(result))), SWIGTYPE_p_std__vectorT_casadi__Linsol_std__allocatorT_casadi__Linsol_t_t, SWIG_POINTER_OWN |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DeserializerBase_unpack_linsol_vector'."
      "  Prototype:\n"
      "    UNPACK_LINSOL_VECTOR(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DeserializerBase_unpack_function_vector(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DeserializerBase *arg1 = (casadi::DeserializerBase *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi::Function,std::allocator< casadi::Function > > result;
  
  if (!SWIG_check_num_args("DeserializerBase_unpack_function_vector",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DeserializerBase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DeserializerBase_unpack_function_vector" "', argument " "1"" of type '" "casadi::DeserializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DeserializerBase * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->unpack_function_vector();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "Function" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DeserializerBase_unpack_function_vector'."
      "  Prototype:\n"
      "    UNPACK_FUNCTION_VECTOR(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DeserializerBase_unpack_generictype_vector(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DeserializerBase *arg1 = (casadi::DeserializerBase *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi::GenericType,std::allocator< casadi::GenericType > > result;
  
  if (!SWIG_check_num_args("DeserializerBase_unpack_generictype_vector",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DeserializerBase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DeserializerBase_unpack_generictype_vector" "', argument " "1"" of type '" "casadi::DeserializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DeserializerBase * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->unpack_generictype_vector();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "GenericType" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DeserializerBase_unpack_generictype_vector'."
      "  Prototype:\n"
      "    UNPACK_GENERICTYPE_VECTOR(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DeserializerBase_unpack_int_vector(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DeserializerBase *arg1 = (casadi::DeserializerBase *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi_int,std::allocator< casadi_int > > result;
  
  if (!SWIG_check_num_args("DeserializerBase_unpack_int_vector",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DeserializerBase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DeserializerBase_unpack_int_vector" "', argument " "1"" of type '" "casadi::DeserializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DeserializerBase * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->unpack_int_vector();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[" "int" "]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DeserializerBase_unpack_int_vector'."
      "  Prototype:\n"
      "    UNPACK_INT_VECTOR(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DeserializerBase_unpack_double_vector(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DeserializerBase *arg1 = (casadi::DeserializerBase *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< double,std::allocator< double > > result;
  
  if (!SWIG_check_num_args("DeserializerBase_unpack_double_vector",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DeserializerBase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DeserializerBase_unpack_double_vector" "', argument " "1"" of type '" "casadi::DeserializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DeserializerBase * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->unpack_double_vector();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "[" "double" "]" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DeserializerBase_unpack_double_vector'."
      "  Prototype:\n"
      "    UNPACK_DOUBLE_VECTOR(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DeserializerBase_unpack_string_vector(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DeserializerBase *arg1 = (casadi::DeserializerBase *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< std::string,std::allocator< std::string > > result;
  
  if (!SWIG_check_num_args("DeserializerBase_unpack_string_vector",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DeserializerBase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DeserializerBase_unpack_string_vector" "', argument " "1"" of type '" "casadi::DeserializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DeserializerBase * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->unpack_string_vector();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "char" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DeserializerBase_unpack_string_vector'."
      "  Prototype:\n"
      "    UNPACK_STRING_VECTOR(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DeserializerBase_connect(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DeserializerBase *arg1 = (casadi::DeserializerBase *) 0 ;
  casadi::SerializerBase *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DeserializerBase_connect",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DeserializerBase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DeserializerBase_connect" "', argument " "1"" of type '" "casadi::DeserializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DeserializerBase * >(argp1);
  res2 = SWIG_ConvertPtr(argv[1], &argp2, SWIGTYPE_p_casadi__SerializerBase,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "DeserializerBase_connect" "', argument " "2"" of type '" "casadi::SerializerBase &""'"); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "DeserializerBase_connect" "', argument " "2"" of type '" "casadi::SerializerBase &""'"); 
  }
  arg2 = reinterpret_cast< casadi::SerializerBase * >(argp2);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->connect(*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DeserializerBase_connect'."
      "  Prototype:\n"
      "    CONNECT(self,SerializerBase)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_DeserializerBase_reset(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::DeserializerBase *arg1 = (casadi::DeserializerBase *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("DeserializerBase_reset",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__DeserializerBase, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DeserializerBase_reset" "', argument " "1"" of type '" "casadi::DeserializerBase *""'"); 
  }
  arg1 = reinterpret_cast< casadi::DeserializerBase * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->reset();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'DeserializerBase_reset'."
      "  Prototype:\n"
      "    RESET(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_StringSerializer(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Dict const &arg1_defvalue = casadi::Dict() ;
  casadi::Dict *arg1 = (casadi::Dict *) &arg1_defvalue ;
  std::map< std::string,casadi::GenericType > m1 ;
  mxArray * _out;
  casadi::StringSerializer *result = 0 ;
  
  if (!SWIG_check_num_args("new_StringSerializer",argc,1,0,0)) {
    SWIG_fail;
  }
  if (0<argc) {
    arg1 = &m1;
    if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "struct" "'.");
  }
  {
    try {
      result = (casadi::StringSerializer *)new casadi::StringSerializer((casadi::Dict const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__StringSerializer, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_StringSerializer'."
      "  Prototype:\n"
      "    STRINGSERIALIZER(struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_delete_StringSerializer(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::StringSerializer *arg1 = (casadi::StringSerializer *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  int is_owned;
  if (!SWIG_check_num_args("delete_StringSerializer",argc,1,1,0)) {
    SWIG_fail;
  }
  is_owned = SWIG_Matlab_isOwned(argv[0]);
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__StringSerializer, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_StringSerializer" "', argument " "1"" of type '" "casadi::StringSerializer *""'"); 
  }
  arg1 = reinterpret_cast< casadi::StringSerializer * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  if (is_owned) {
    {
      try {
        delete arg1;
      } catch(const std::exception& e) {
        SWIG_exception(SWIG_RuntimeError, e.what());
      }
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'delete_StringSerializer'."
      "  Prototype:\n"
      "    STRINGSERIALIZER(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_StringSerializer_encode(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::StringSerializer *arg1 = (casadi::StringSerializer *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("StringSerializer_encode",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__StringSerializer, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringSerializer_encode" "', argument " "1"" of type '" "casadi::StringSerializer *""'"); 
  }
  arg1 = reinterpret_cast< casadi::StringSerializer * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->encode();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'StringSerializer_encode'."
      "  Prototype:\n"
      "    ENCODE(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_FileSerializer(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  casadi::Dict const &arg2_defvalue = casadi::Dict() ;
  casadi::Dict *arg2 = (casadi::Dict *) &arg2_defvalue ;
  std::string m1 ;
  std::map< std::string,casadi::GenericType > m2 ;
  mxArray * _out;
  casadi::FileSerializer *result = 0 ;
  
  if (!SWIG_check_num_args("new_FileSerializer",argc,2,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  if (1<argc) {
    arg2 = &m2;
    if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "struct" "'.");
  }
  {
    try {
      result = (casadi::FileSerializer *)new casadi::FileSerializer((std::string const &)*arg1,(casadi::Dict const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__FileSerializer, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_FileSerializer'."
      "  Prototype:\n"
      "    FILESERIALIZER(char,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_delete_FileSerializer(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::FileSerializer *arg1 = (casadi::FileSerializer *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  int is_owned;
  if (!SWIG_check_num_args("delete_FileSerializer",argc,1,1,0)) {
    SWIG_fail;
  }
  is_owned = SWIG_Matlab_isOwned(argv[0]);
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__FileSerializer, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_FileSerializer" "', argument " "1"" of type '" "casadi::FileSerializer *""'"); 
  }
  arg1 = reinterpret_cast< casadi::FileSerializer * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  if (is_owned) {
    {
      try {
        delete arg1;
      } catch(const std::exception& e) {
        SWIG_exception(SWIG_RuntimeError, e.what());
      }
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'delete_FileSerializer'."
      "  Prototype:\n"
      "    FILESERIALIZER(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_StringDeserializer(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string m1 ;
  mxArray * _out;
  casadi::StringDeserializer *result = 0 ;
  
  if (!SWIG_check_num_args("new_StringDeserializer",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  {
    try {
      result = (casadi::StringDeserializer *)new casadi::StringDeserializer((std::string const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__StringDeserializer, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_StringDeserializer'."
      "  Prototype:\n"
      "    STRINGDESERIALIZER(char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_delete_StringDeserializer(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::StringDeserializer *arg1 = (casadi::StringDeserializer *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  int is_owned;
  if (!SWIG_check_num_args("delete_StringDeserializer",argc,1,1,0)) {
    SWIG_fail;
  }
  is_owned = SWIG_Matlab_isOwned(argv[0]);
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__StringDeserializer, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_StringDeserializer" "', argument " "1"" of type '" "casadi::StringDeserializer *""'"); 
  }
  arg1 = reinterpret_cast< casadi::StringDeserializer * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  if (is_owned) {
    {
      try {
        delete arg1;
      } catch(const std::exception& e) {
        SWIG_exception(SWIG_RuntimeError, e.what());
      }
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'delete_StringDeserializer'."
      "  Prototype:\n"
      "    STRINGDESERIALIZER(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_StringDeserializer_decode(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::StringDeserializer *arg1 = (casadi::StringDeserializer *) 0 ;
  std::string *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("StringDeserializer_decode",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__StringDeserializer, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringDeserializer_decode" "', argument " "1"" of type '" "casadi::StringDeserializer *""'"); 
  }
  arg1 = reinterpret_cast< casadi::StringDeserializer * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->decode((std::string const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'StringDeserializer_decode'."
      "  Prototype:\n"
      "    DECODE(self,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_FileDeserializer(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string *arg1 = 0 ;
  std::string m1 ;
  mxArray * _out;
  casadi::FileDeserializer *result = 0 ;
  
  if (!SWIG_check_num_args("new_FileDeserializer",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = &m1;
  if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  {
    try {
      result = (casadi::FileDeserializer *)new casadi::FileDeserializer((std::string const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__FileDeserializer, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_FileDeserializer'."
      "  Prototype:\n"
      "    FILEDESERIALIZER(char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_delete_FileDeserializer(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::FileDeserializer *arg1 = (casadi::FileDeserializer *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  int is_owned;
  if (!SWIG_check_num_args("delete_FileDeserializer",argc,1,1,0)) {
    SWIG_fail;
  }
  is_owned = SWIG_Matlab_isOwned(argv[0]);
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__FileDeserializer, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_FileDeserializer" "', argument " "1"" of type '" "casadi::FileDeserializer *""'"); 
  }
  arg1 = reinterpret_cast< casadi::FileDeserializer * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  if (is_owned) {
    {
      try {
        delete arg1;
      } catch(const std::exception& e) {
        SWIG_exception(SWIG_RuntimeError, e.what());
      }
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'delete_FileDeserializer'."
      "  Prototype:\n"
      "    FILEDESERIALIZER(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_Opti__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  std::string const &arg1_defvalue = "nlp" ;
  std::string *arg1 = (std::string *) &arg1_defvalue ;
  std::string m1 ;
  mxArray * _out;
  casadi::Opti *result = 0 ;
  
  if (!SWIG_check_num_args("new_Opti",argc,1,0,0)) {
    SWIG_fail;
  }
  if (0<argc) {
    arg1 = &m1;
    if (!casadi::to_ptr(argv[0], &arg1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 1 to type '" "char" "'.");
  }
  {
    try {
      result = (casadi::Opti *)new casadi::Opti((std::string const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__Opti, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_Opti'."
      "  Prototype:\n"
      "    OPTI(char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Opti_internal_variable(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Opti *arg1 = (casadi::Opti *) 0 ;
  casadi_int arg2 = (casadi_int) 1 ;
  casadi_int arg3 = (casadi_int) 1 ;
  std::string const &arg4_defvalue = "full" ;
  std::string *arg4 = (std::string *) &arg4_defvalue ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m4 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("Opti_internal_variable",argc,4,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Opti, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Opti_internal_variable" "', argument " "1"" of type '" "casadi::Opti *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Opti * >(argp1);
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  }
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  }
  if (3<argc) {
    arg4 = &m4;
    if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "char" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->variable(arg2,arg3,(std::string const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Opti_internal_variable'."
      "  Prototype:\n"
      "    INTERNAL_VARIABLE(self,int,int,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Opti_internal_parameter(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Opti *arg1 = (casadi::Opti *) 0 ;
  casadi_int arg2 = (casadi_int) 1 ;
  casadi_int arg3 = (casadi_int) 1 ;
  std::string const &arg4_defvalue = "full" ;
  std::string *arg4 = (std::string *) &arg4_defvalue ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m4 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("Opti_internal_parameter",argc,4,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Opti, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Opti_internal_parameter" "', argument " "1"" of type '" "casadi::Opti *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Opti * >(argp1);
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  }
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "int" "'.");
  }
  if (3<argc) {
    arg4 = &m4;
    if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "char" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->parameter(arg2,arg3,(std::string const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Opti_internal_parameter'."
      "  Prototype:\n"
      "    INTERNAL_PARAMETER(self,int,int,char)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Opti_minimize(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Opti *arg1 = (casadi::Opti *) 0 ;
  casadi::MX *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("Opti_minimize",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Opti, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Opti_minimize" "', argument " "1"" of type '" "casadi::Opti *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Opti * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->minimize((casadi::MX const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Opti_minimize'."
      "  Prototype:\n"
      "    MINIMIZE(self,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Opti_internal_subject_to__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Opti *arg1 = (casadi::Opti *) 0 ;
  casadi::MX *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("Opti_internal_subject_to",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Opti, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Opti_internal_subject_to" "', argument " "1"" of type '" "casadi::Opti *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Opti * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->subject_to((casadi::MX const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Opti_internal_subject_to'."
      "  Prototype:\n"
      "    INTERNAL_SUBJECT_TO(self,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Opti_internal_subject_to__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Opti *arg1 = (casadi::Opti *) 0 ;
  std::vector< casadi::MX,std::allocator< casadi::MX > > *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< casadi::MX > m2 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("Opti_internal_subject_to",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Opti, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Opti_internal_subject_to" "', argument " "1"" of type '" "casadi::Opti *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Opti * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "MX" "}" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->subject_to((std::vector< casadi::MX,std::allocator< casadi::MX > > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Opti_internal_subject_to'."
      "  Prototype:\n"
      "    INTERNAL_SUBJECT_TO(self,{MX})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Opti_internal_subject_to__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Opti *arg1 = (casadi::Opti *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("Opti_internal_subject_to",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Opti, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Opti_internal_subject_to" "', argument " "1"" of type '" "casadi::Opti *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Opti * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->subject_to();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Opti_internal_subject_to'."
      "  Prototype:\n"
      "    INTERNAL_SUBJECT_TO(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Opti_internal_subject_to(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Opti, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_Opti_internal_subject_to__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Opti, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        return _wrap_Opti_internal_subject_to__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Opti, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<casadi::MX> **>(0));
      if (_v) {
        return _wrap_Opti_internal_subject_to__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Opti_internal_subject_to'."
    "  Possible prototypes are:\n"
    "    INTERNAL_SUBJECT_TO(self)\n"
    "    INTERNAL_SUBJECT_TO(self,MX)\n"
    "    INTERNAL_SUBJECT_TO(self,{MX})\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_Opti_solver(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Opti *arg1 = (casadi::Opti *) 0 ;
  std::string *arg2 = 0 ;
  casadi::Dict const &arg3_defvalue = casadi::Dict() ;
  casadi::Dict *arg3 = (casadi::Dict *) &arg3_defvalue ;
  casadi::Dict const &arg4_defvalue = casadi::Dict() ;
  casadi::Dict *arg4 = (casadi::Dict *) &arg4_defvalue ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  std::map< std::string,casadi::GenericType > m3 ;
  std::map< std::string,casadi::GenericType > m4 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("Opti_solver",argc,4,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Opti, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Opti_solver" "', argument " "1"" of type '" "casadi::Opti *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Opti * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  if (2<argc) {
    arg3 = &m3;
    if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "struct" "'.");
  }
  if (3<argc) {
    arg4 = &m4;
    if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "struct" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->solver((std::string const &)*arg2,(casadi::Dict const &)*arg3,(casadi::Dict const &)*arg4);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Opti_solver'."
      "  Prototype:\n"
      "    SOLVER(self,char,struct,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Opti_set_initial__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Opti *arg1 = (casadi::Opti *) 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::DM *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  casadi::Matrix< double > m3 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("Opti_set_initial",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Opti, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Opti_set_initial" "', argument " "1"" of type '" "casadi::Opti *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Opti * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "DM" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->set_initial((casadi::MX const &)*arg2,(casadi::DM const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Opti_set_initial'."
      "  Prototype:\n"
      "    SET_INITIAL(self,MX,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Opti_set_initial__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Opti *arg1 = (casadi::Opti *) 0 ;
  std::vector< casadi::MX,std::allocator< casadi::MX > > *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< casadi::MX > m2 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("Opti_set_initial",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Opti, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Opti_set_initial" "', argument " "1"" of type '" "casadi::Opti *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Opti * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "MX" "}" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->set_initial((std::vector< casadi::MX,std::allocator< casadi::MX > > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Opti_set_initial'."
      "  Prototype:\n"
      "    SET_INITIAL(self,{MX})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Opti_set_initial(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Opti, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<casadi::MX> **>(0));
      if (_v) {
        return _wrap_Opti_set_initial__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Opti, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<double> **>(0));
        if (_v) {
          return _wrap_Opti_set_initial__SWIG_0(resc,resv,argc,argv);
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Opti_set_initial'."
    "  Possible prototypes are:\n"
    "    SET_INITIAL(self,{MX})\n"
    "    SET_INITIAL(self,MX,DM)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_Opti_set_value__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Opti *arg1 = (casadi::Opti *) 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::DM *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  casadi::Matrix< double > m3 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("Opti_set_value",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Opti, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Opti_set_value" "', argument " "1"" of type '" "casadi::Opti *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Opti * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "DM" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->set_value((casadi::MX const &)*arg2,(casadi::DM const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Opti_set_value'."
      "  Prototype:\n"
      "    SET_VALUE(self,MX,DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Opti_set_value__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Opti *arg1 = (casadi::Opti *) 0 ;
  std::vector< casadi::MX,std::allocator< casadi::MX > > *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< casadi::MX > m2 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("Opti_set_value",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Opti, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Opti_set_value" "', argument " "1"" of type '" "casadi::Opti *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Opti * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "MX" "}" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->set_value((std::vector< casadi::MX,std::allocator< casadi::MX > > const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Opti_set_value'."
      "  Prototype:\n"
      "    SET_VALUE(self,{MX})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Opti_set_value(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Opti, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<casadi::MX> **>(0));
      if (_v) {
        return _wrap_Opti_set_value__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Opti, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< casadi::Matrix<double> **>(0));
        if (_v) {
          return _wrap_Opti_set_value__SWIG_0(resc,resv,argc,argv);
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Opti_set_value'."
    "  Possible prototypes are:\n"
    "    SET_VALUE(self,{MX})\n"
    "    SET_VALUE(self,MX,DM)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_Opti_solve(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Opti *arg1 = (casadi::Opti *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  SwigValueWrapper< casadi::OptiSol > result;
  
  if (!SWIG_check_num_args("Opti_solve",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Opti, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Opti_solve" "', argument " "1"" of type '" "casadi::Opti *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Opti * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->solve();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj((new casadi::OptiSol(static_cast< const casadi::OptiSol& >(result))), SWIGTYPE_p_casadi__OptiSol, SWIG_POINTER_OWN |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Opti_solve'."
      "  Prototype:\n"
      "    SOLVE(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Opti_solve_limited(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Opti *arg1 = (casadi::Opti *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  SwigValueWrapper< casadi::OptiSol > result;
  
  if (!SWIG_check_num_args("Opti_solve_limited",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Opti, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Opti_solve_limited" "', argument " "1"" of type '" "casadi::Opti *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Opti * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->solve_limited();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj((new casadi::OptiSol(static_cast< const casadi::OptiSol& >(result))), SWIGTYPE_p_casadi__OptiSol, SWIG_POINTER_OWN |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Opti_solve_limited'."
      "  Prototype:\n"
      "    SOLVE_LIMITED(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Opti_value__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Opti *arg1 = (casadi::Opti *) 0 ;
  casadi::MX *arg2 = 0 ;
  std::vector< casadi::MX,std::allocator< casadi::MX > > const &arg3_defvalue = std::vector< casadi::MX >() ;
  std::vector< casadi::MX,std::allocator< casadi::MX > > *arg3 = (std::vector< casadi::MX,std::allocator< casadi::MX > > *) &arg3_defvalue ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  std::vector< casadi::MX > m3 ;
  mxArray * _out;
  casadi::native_DM result;
  
  if (!SWIG_check_num_args("Opti_value",argc,3,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Opti, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Opti_value" "', argument " "1"" of type '" "casadi::Opti const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Opti * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  if (2<argc) {
    arg3 = &m3;
    if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "{" "MX" "}" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Opti const *)arg1)->value((casadi::MX const &)*arg2,(std::vector< casadi::MX,std::allocator< casadi::MX > > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = full_or_sparse(result, true))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type 'double'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Opti_value'."
      "  Prototype:\n"
      "    VALUE(self,MX,{MX})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Opti_value__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Opti *arg1 = (casadi::Opti *) 0 ;
  casadi::DM *arg2 = 0 ;
  std::vector< casadi::MX,std::allocator< casadi::MX > > const &arg3_defvalue = std::vector< casadi::MX >() ;
  std::vector< casadi::MX,std::allocator< casadi::MX > > *arg3 = (std::vector< casadi::MX,std::allocator< casadi::MX > > *) &arg3_defvalue ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< double > m2 ;
  std::vector< casadi::MX > m3 ;
  mxArray * _out;
  casadi::native_DM result;
  
  if (!SWIG_check_num_args("Opti_value",argc,3,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Opti, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Opti_value" "', argument " "1"" of type '" "casadi::Opti const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Opti * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  if (2<argc) {
    arg3 = &m3;
    if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "{" "MX" "}" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Opti const *)arg1)->value((casadi::DM const &)*arg2,(std::vector< casadi::MX,std::allocator< casadi::MX > > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = full_or_sparse(result, true))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type 'double'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Opti_value'."
      "  Prototype:\n"
      "    VALUE(self,DM,{MX})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Opti_value__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Opti *arg1 = (casadi::Opti *) 0 ;
  casadi::SX *arg2 = 0 ;
  std::vector< casadi::MX,std::allocator< casadi::MX > > const &arg3_defvalue = std::vector< casadi::MX >() ;
  std::vector< casadi::MX,std::allocator< casadi::MX > > *arg3 = (std::vector< casadi::MX,std::allocator< casadi::MX > > *) &arg3_defvalue ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  std::vector< casadi::MX > m3 ;
  mxArray * _out;
  casadi::native_DM result;
  
  if (!SWIG_check_num_args("Opti_value",argc,3,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Opti, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Opti_value" "', argument " "1"" of type '" "casadi::Opti const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Opti * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  if (2<argc) {
    arg3 = &m3;
    if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "{" "MX" "}" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Opti const *)arg1)->value((casadi::SX const &)*arg2,(std::vector< casadi::MX,std::allocator< casadi::MX > > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = full_or_sparse(result, true))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type 'double'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Opti_value'."
      "  Prototype:\n"
      "    VALUE(self,SX,{MX})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Opti_value(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 2) && (argc <= 3)) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Opti, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_Opti_value__SWIG_1(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< std::vector<casadi::MX> **>(0));
        if (_v) {
          return _wrap_Opti_value__SWIG_1(resc,resv,argc,argv);
        }
      }
    }
  }
  if ((argc >= 2) && (argc <= 3)) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Opti, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_Opti_value__SWIG_2(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< std::vector<casadi::MX> **>(0));
        if (_v) {
          return _wrap_Opti_value__SWIG_2(resc,resv,argc,argv);
        }
      }
    }
  }
  if ((argc >= 2) && (argc <= 3)) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Opti, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_Opti_value__SWIG_0(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< std::vector<casadi::MX> **>(0));
        if (_v) {
          return _wrap_Opti_value__SWIG_0(resc,resv,argc,argv);
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Opti_value'."
    "  Possible prototypes are:\n"
    "    VALUE(self,DM,{MX})\n"
    "    VALUE(self,SX,{MX})\n"
    "    VALUE(self,MX,{MX})\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_Opti_stats(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Opti *arg1 = (casadi::Opti *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Dict result;
  
  if (!SWIG_check_num_args("Opti_stats",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Opti, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Opti_stats" "', argument " "1"" of type '" "casadi::Opti const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Opti * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Opti const *)arg1)->stats();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "struct" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Opti_stats'."
      "  Prototype:\n"
      "    STATS(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Opti_return_status(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Opti *arg1 = (casadi::Opti *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("Opti_return_status",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Opti, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Opti_return_status" "', argument " "1"" of type '" "casadi::Opti const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Opti * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Opti const *)arg1)->return_status();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Opti_return_status'."
      "  Prototype:\n"
      "    RETURN_STATUS(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Opti_initial(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Opti *arg1 = (casadi::Opti *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi::MX,std::allocator< casadi::MX > > result;
  
  if (!SWIG_check_num_args("Opti_initial",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Opti, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Opti_initial" "', argument " "1"" of type '" "casadi::Opti const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Opti * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Opti const *)arg1)->initial();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "MX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Opti_initial'."
      "  Prototype:\n"
      "    INITIAL(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Opti_value_variables(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Opti *arg1 = (casadi::Opti *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi::MX,std::allocator< casadi::MX > > result;
  
  if (!SWIG_check_num_args("Opti_value_variables",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Opti, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Opti_value_variables" "', argument " "1"" of type '" "casadi::Opti const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Opti * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Opti const *)arg1)->value_variables();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "MX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Opti_value_variables'."
      "  Prototype:\n"
      "    VALUE_VARIABLES(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Opti_value_parameters(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Opti *arg1 = (casadi::Opti *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi::MX,std::allocator< casadi::MX > > result;
  
  if (!SWIG_check_num_args("Opti_value_parameters",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Opti, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Opti_value_parameters" "', argument " "1"" of type '" "casadi::Opti const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Opti * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Opti const *)arg1)->value_parameters();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "MX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Opti_value_parameters'."
      "  Prototype:\n"
      "    VALUE_PARAMETERS(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Opti_dual(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Opti *arg1 = (casadi::Opti *) 0 ;
  casadi::MX *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("Opti_dual",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Opti, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Opti_dual" "', argument " "1"" of type '" "casadi::Opti const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Opti * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Opti const *)arg1)->dual((casadi::MX const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Opti_dual'."
      "  Prototype:\n"
      "    DUAL(self,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Opti_nx(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Opti *arg1 = (casadi::Opti *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("Opti_nx",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Opti, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Opti_nx" "', argument " "1"" of type '" "casadi::Opti const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Opti * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::Opti const *)arg1)->nx();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Opti_nx'."
      "  Prototype:\n"
      "    NX(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Opti_np(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Opti *arg1 = (casadi::Opti *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("Opti_np",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Opti, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Opti_np" "', argument " "1"" of type '" "casadi::Opti const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Opti * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::Opti const *)arg1)->np();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Opti_np'."
      "  Prototype:\n"
      "    NP(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Opti_ng(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Opti *arg1 = (casadi::Opti *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("Opti_ng",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Opti, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Opti_ng" "', argument " "1"" of type '" "casadi::Opti const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Opti * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::Opti const *)arg1)->ng();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Opti_ng'."
      "  Prototype:\n"
      "    NG(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Opti_x(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Opti *arg1 = (casadi::Opti *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("Opti_x",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Opti, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Opti_x" "', argument " "1"" of type '" "casadi::Opti const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Opti * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Opti const *)arg1)->x();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Opti_x'."
      "  Prototype:\n"
      "    X(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Opti_p(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Opti *arg1 = (casadi::Opti *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("Opti_p",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Opti, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Opti_p" "', argument " "1"" of type '" "casadi::Opti const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Opti * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Opti const *)arg1)->p();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Opti_p'."
      "  Prototype:\n"
      "    P(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Opti_g(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Opti *arg1 = (casadi::Opti *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("Opti_g",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Opti, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Opti_g" "', argument " "1"" of type '" "casadi::Opti const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Opti * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Opti const *)arg1)->g();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Opti_g'."
      "  Prototype:\n"
      "    G(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Opti_f(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Opti *arg1 = (casadi::Opti *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("Opti_f",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Opti, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Opti_f" "', argument " "1"" of type '" "casadi::Opti const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Opti * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Opti const *)arg1)->f();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Opti_f'."
      "  Prototype:\n"
      "    F(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Opti_lbg(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Opti *arg1 = (casadi::Opti *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("Opti_lbg",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Opti, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Opti_lbg" "', argument " "1"" of type '" "casadi::Opti const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Opti * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Opti const *)arg1)->lbg();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Opti_lbg'."
      "  Prototype:\n"
      "    LBG(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Opti_ubg(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Opti *arg1 = (casadi::Opti *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("Opti_ubg",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Opti, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Opti_ubg" "', argument " "1"" of type '" "casadi::Opti const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Opti * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Opti const *)arg1)->ubg();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Opti_ubg'."
      "  Prototype:\n"
      "    UBG(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Opti_lam_g(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Opti *arg1 = (casadi::Opti *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("Opti_lam_g",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Opti, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Opti_lam_g" "', argument " "1"" of type '" "casadi::Opti const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Opti * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Opti const *)arg1)->lam_g();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Opti_lam_g'."
      "  Prototype:\n"
      "    LAM_G(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Opti_to_function__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Opti *arg1 = (casadi::Opti *) 0 ;
  std::string *arg2 = 0 ;
  std::vector< casadi::MX,std::allocator< casadi::MX > > *arg3 = 0 ;
  std::vector< casadi::MX,std::allocator< casadi::MX > > *arg4 = 0 ;
  casadi::Dict const &arg5_defvalue = casadi::Dict() ;
  casadi::Dict *arg5 = (casadi::Dict *) &arg5_defvalue ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  std::vector< casadi::MX > m3 ;
  std::vector< casadi::MX > m4 ;
  std::map< std::string,casadi::GenericType > m5 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("Opti_to_function",argc,5,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Opti, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Opti_to_function" "', argument " "1"" of type '" "casadi::Opti *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Opti * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "{" "MX" "}" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "{" "MX" "}" "'.");
  if (4<argc) {
    arg5 = &m5;
    if (!casadi::to_ptr(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "struct" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->to_function((std::string const &)*arg2,(std::vector< casadi::MX,std::allocator< casadi::MX > > const &)*arg3,(std::vector< casadi::MX,std::allocator< casadi::MX > > const &)*arg4,(casadi::Dict const &)*arg5);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Opti_to_function'."
      "  Prototype:\n"
      "    TO_FUNCTION(self,char,{MX},{MX},struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Opti_to_function__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Opti *arg1 = (casadi::Opti *) 0 ;
  std::string *arg2 = 0 ;
  std::vector< casadi::MX,std::allocator< casadi::MX > > *arg3 = 0 ;
  std::vector< casadi::MX,std::allocator< casadi::MX > > *arg4 = 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg5 = 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg6 = 0 ;
  casadi::Dict const &arg7_defvalue = casadi::Dict() ;
  casadi::Dict *arg7 = (casadi::Dict *) &arg7_defvalue ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  std::vector< casadi::MX > m3 ;
  std::vector< casadi::MX > m4 ;
  std::vector< std::string > m5 ;
  std::vector< std::string > m6 ;
  std::map< std::string,casadi::GenericType > m7 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("Opti_to_function",argc,7,6,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Opti, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Opti_to_function" "', argument " "1"" of type '" "casadi::Opti *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Opti * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "{" "MX" "}" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "{" "MX" "}" "'.");
  arg5 = &m5;
  if (!casadi::to_ptr(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "{" "char" "}" "'.");
  arg6 = &m6;
  if (!casadi::to_ptr(argv[5], &arg6)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 6 to type '" "{" "char" "}" "'.");
  if (6<argc) {
    arg7 = &m7;
    if (!casadi::to_ptr(argv[6], &arg7)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 7 to type '" "struct" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->to_function((std::string const &)*arg2,(std::vector< casadi::MX,std::allocator< casadi::MX > > const &)*arg3,(std::vector< casadi::MX,std::allocator< casadi::MX > > const &)*arg4,(std::vector< std::string,std::allocator< std::string > > const &)*arg5,(std::vector< std::string,std::allocator< std::string > > const &)*arg6,(casadi::Dict const &)*arg7);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Opti_to_function'."
      "  Prototype:\n"
      "    TO_FUNCTION(self,char,{MX},{MX},{char},{char},struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Opti_to_function__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Opti *arg1 = (casadi::Opti *) 0 ;
  std::string *arg2 = 0 ;
  std::map< std::string,casadi::MX,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::MX > > > *arg3 = 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg4 = 0 ;
  std::vector< std::string,std::allocator< std::string > > *arg5 = 0 ;
  casadi::Dict const &arg6_defvalue = casadi::Dict() ;
  casadi::Dict *arg6 = (casadi::Dict *) &arg6_defvalue ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::string m2 ;
  std::map< std::string,casadi::MX > m3 ;
  std::vector< std::string > m4 ;
  std::vector< std::string > m5 ;
  std::map< std::string,casadi::GenericType > m6 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("Opti_to_function",argc,6,5,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Opti, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Opti_to_function" "', argument " "1"" of type '" "casadi::Opti *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Opti * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "char" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "struct" ":" "MX" "'.");
  arg4 = &m4;
  if (!casadi::to_ptr(argv[3], &arg4)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 4 to type '" "{" "char" "}" "'.");
  arg5 = &m5;
  if (!casadi::to_ptr(argv[4], &arg5)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 5 to type '" "{" "char" "}" "'.");
  if (5<argc) {
    arg6 = &m6;
    if (!casadi::to_ptr(argv[5], &arg6)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 6 to type '" "struct" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->to_function((std::string const &)*arg2,(std::map< std::string,casadi::MX,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::MX > > > const &)*arg3,(std::vector< std::string,std::allocator< std::string > > const &)*arg4,(std::vector< std::string,std::allocator< std::string > > const &)*arg5,(casadi::Dict const &)*arg6);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Opti_to_function'."
      "  Prototype:\n"
      "    TO_FUNCTION(self,char,struct:MX,{char},{char},struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Opti_to_function(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 4) && (argc <= 5)) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Opti, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::vector<casadi::MX> **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< std::vector<casadi::MX> **>(0));
          if (_v) {
            if (argc <= 4) {
              return _wrap_Opti_to_function__SWIG_0(resc,resv,argc,argv);
            }
            _v = casadi::to_ptr(argv[4], static_cast< std::map<std::string,casadi::GenericType> **>(0));
            if (_v) {
              return _wrap_Opti_to_function__SWIG_0(resc,resv,argc,argv);
            }
          }
        }
      }
    }
  }
  if ((argc >= 5) && (argc <= 6)) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Opti, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::map<std::string,casadi::MX> **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< std::vector<std::string> **>(0));
          if (_v) {
            _v = casadi::to_ptr(argv[4], static_cast< std::vector<std::string> **>(0));
            if (_v) {
              if (argc <= 5) {
                return _wrap_Opti_to_function__SWIG_2(resc,resv,argc,argv);
              }
              _v = casadi::to_ptr(argv[5], static_cast< std::map<std::string,casadi::GenericType> **>(0));
              if (_v) {
                return _wrap_Opti_to_function__SWIG_2(resc,resv,argc,argv);
              }
            }
          }
        }
      }
    }
  }
  if ((argc >= 6) && (argc <= 7)) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Opti, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::string **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::vector<casadi::MX> **>(0));
        if (_v) {
          _v = casadi::to_ptr(argv[3], static_cast< std::vector<casadi::MX> **>(0));
          if (_v) {
            _v = casadi::to_ptr(argv[4], static_cast< std::vector<std::string> **>(0));
            if (_v) {
              _v = casadi::to_ptr(argv[5], static_cast< std::vector<std::string> **>(0));
              if (_v) {
                if (argc <= 6) {
                  return _wrap_Opti_to_function__SWIG_1(resc,resv,argc,argv);
                }
                _v = casadi::to_ptr(argv[6], static_cast< std::map<std::string,casadi::GenericType> **>(0));
                if (_v) {
                  return _wrap_Opti_to_function__SWIG_1(resc,resv,argc,argv);
                }
              }
            }
          }
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Opti_to_function'."
    "  Possible prototypes are:\n"
    "    TO_FUNCTION(self,char,{MX},{MX},struct)\n"
    "    TO_FUNCTION(self,char,struct:MX,{char},{char},struct)\n"
    "    TO_FUNCTION(self,char,{MX},{MX},{char},{char},struct)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_Opti_debug(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Opti *arg1 = (casadi::Opti *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  SwigValueWrapper< casadi::OptiAdvanced > result;
  
  if (!SWIG_check_num_args("Opti_debug",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Opti, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Opti_debug" "', argument " "1"" of type '" "casadi::Opti const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Opti * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Opti const *)arg1)->debug();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj((new casadi::OptiAdvanced(static_cast< const casadi::OptiAdvanced& >(result))), SWIGTYPE_p_casadi__OptiAdvanced, SWIG_POINTER_OWN |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Opti_debug'."
      "  Prototype:\n"
      "    DEBUG(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Opti_advanced(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Opti *arg1 = (casadi::Opti *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  SwigValueWrapper< casadi::OptiAdvanced > result;
  
  if (!SWIG_check_num_args("Opti_advanced",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Opti, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Opti_advanced" "', argument " "1"" of type '" "casadi::Opti const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Opti * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Opti const *)arg1)->advanced();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj((new casadi::OptiAdvanced(static_cast< const casadi::OptiAdvanced& >(result))), SWIGTYPE_p_casadi__OptiAdvanced, SWIG_POINTER_OWN |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Opti_advanced'."
      "  Prototype:\n"
      "    ADVANCED(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Opti_copy(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Opti *arg1 = (casadi::Opti *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Opti result;
  
  if (!SWIG_check_num_args("Opti_copy",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Opti, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Opti_copy" "', argument " "1"" of type '" "casadi::Opti const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Opti * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Opti const *)arg1)->copy();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj((new casadi::Opti(static_cast< const casadi::Opti& >(result))), SWIGTYPE_p_casadi__Opti, SWIG_POINTER_OWN |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Opti_copy'."
      "  Prototype:\n"
      "    COPY(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Opti_update_user_dict__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Opti *arg1 = (casadi::Opti *) 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::Dict *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  std::map< std::string,casadi::GenericType > m3 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("Opti_update_user_dict",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Opti, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Opti_update_user_dict" "', argument " "1"" of type '" "casadi::Opti *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Opti * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "struct" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->update_user_dict((casadi::MX const &)*arg2,(casadi::Dict const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Opti_update_user_dict'."
      "  Prototype:\n"
      "    UPDATE_USER_DICT(self,MX,struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Opti_update_user_dict__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Opti *arg1 = (casadi::Opti *) 0 ;
  std::vector< casadi::MX,std::allocator< casadi::MX > > *arg2 = 0 ;
  casadi::Dict *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::vector< casadi::MX > m2 ;
  std::map< std::string,casadi::GenericType > m3 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("Opti_update_user_dict",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Opti, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Opti_update_user_dict" "', argument " "1"" of type '" "casadi::Opti *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Opti * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "{" "MX" "}" "'.");
  arg3 = &m3;
  if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "struct" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->update_user_dict((std::vector< casadi::MX,std::allocator< casadi::MX > > const &)*arg2,(casadi::Dict const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Opti_update_user_dict'."
      "  Prototype:\n"
      "    UPDATE_USER_DICT(self,{MX},struct)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Opti_update_user_dict(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Opti, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::map<std::string,casadi::GenericType> **>(0));
        if (_v) {
          return _wrap_Opti_update_user_dict__SWIG_0(resc,resv,argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Opti, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::vector<casadi::MX> **>(0));
      if (_v) {
        _v = casadi::to_ptr(argv[2], static_cast< std::map<std::string,casadi::GenericType> **>(0));
        if (_v) {
          return _wrap_Opti_update_user_dict__SWIG_1(resc,resv,argc,argv);
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Opti_update_user_dict'."
    "  Possible prototypes are:\n"
    "    UPDATE_USER_DICT(self,MX,struct)\n"
    "    UPDATE_USER_DICT(self,{MX},struct)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_Opti_user_dict(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Opti *arg1 = (casadi::Opti *) 0 ;
  casadi::MX *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  mxArray * _out;
  casadi::Dict result;
  
  if (!SWIG_check_num_args("Opti_user_dict",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Opti, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Opti_user_dict" "', argument " "1"" of type '" "casadi::Opti const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Opti * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Opti const *)arg1)->user_dict((casadi::MX const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "struct" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Opti_user_dict'."
      "  Prototype:\n"
      "    USER_DICT(self,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Opti_type_name(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Opti *arg1 = (casadi::Opti *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("Opti_type_name",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Opti, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Opti_type_name" "', argument " "1"" of type '" "casadi::Opti const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Opti * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Opti const *)arg1)->type_name();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Opti_type_name'."
      "  Prototype:\n"
      "    TYPE_NAME(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Opti_disp(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Opti *arg1 = (casadi::Opti *) 0 ;
  std::ostream *arg2 = 0 ;
  bool arg3 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  arg2 = &casadi::uout();
  if (!SWIG_check_num_args("Opti_disp",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Opti, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Opti_disp" "', argument " "1"" of type '" "casadi::Opti const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Opti * >(argp1);
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::Opti const *)arg1)->disp(*arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  *arg2 << "\n" << std::flush;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Opti_disp'."
      "  Prototype:\n"
      "    DISP(self,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Opti_str(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Opti *arg1 = (casadi::Opti *) 0 ;
  bool arg2 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("Opti_str",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Opti, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Opti_str" "', argument " "1"" of type '" "casadi::Opti const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Opti * >(argp1);
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::Opti const *)arg1)->get_str(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Opti_str'."
      "  Prototype:\n"
      "    STR(self,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Opti_callback_class__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Opti *arg1 = (casadi::Opti *) 0 ;
  casadi::OptiCallback *arg2 = (casadi::OptiCallback *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("Opti_callback_class",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Opti, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Opti_callback_class" "', argument " "1"" of type '" "casadi::Opti *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Opti * >(argp1);
  res2 = SWIG_ConvertPtr(argv[1], &argp2,SWIGTYPE_p_casadi__OptiCallback, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Opti_callback_class" "', argument " "2"" of type '" "casadi::OptiCallback *""'"); 
  }
  arg2 = reinterpret_cast< casadi::OptiCallback * >(argp2);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->callback_class(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Opti_callback_class'."
      "  Prototype:\n"
      "    CALLBACK_CLASS(self,OptiCallback)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Opti_callback_class__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Opti *arg1 = (casadi::Opti *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("Opti_callback_class",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Opti, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Opti_callback_class" "', argument " "1"" of type '" "casadi::Opti *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Opti * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->callback_class();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Opti_callback_class'."
      "  Prototype:\n"
      "    CALLBACK_CLASS(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_Opti_callback_class(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Opti, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_Opti_callback_class__SWIG_1(resc,resv,argc,argv);
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Opti, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_casadi__OptiCallback, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap_Opti_callback_class__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'Opti_callback_class'."
    "  Possible prototypes are:\n"
    "    CALLBACK_CLASS(self)\n"
    "    CALLBACK_CLASS(self,OptiCallback)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_new_Opti__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Opti *arg1 = 0 ;
  void *argp1 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Opti *result = 0 ;
  
  if (!SWIG_check_num_args("new_Opti",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_casadi__Opti,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_Opti" "', argument " "1"" of type '" "casadi::Opti const &""'"); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_Opti" "', argument " "1"" of type '" "casadi::Opti const &""'"); 
  }
  arg1 = reinterpret_cast< casadi::Opti * >(argp1);
  {
    result = (casadi::Opti *)new casadi::Opti((casadi::Opti const &)*arg1);
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__Opti, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_Opti'."
      "  Prototype:\n"
      "    OPTI(Opti)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_Opti(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 0) && (argc <= 1)) {
    int _v;
    if (argc <= 0) {
      return _wrap_new_Opti__SWIG_0(resc,resv,argc,argv);
    }
    _v = casadi::to_ptr(argv[0], static_cast< std::string **>(0));
    if (_v) {
      return _wrap_new_Opti__SWIG_0(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Opti, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_new_Opti__SWIG_1(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_Opti'."
    "  Possible prototypes are:\n"
    "    OPTI(char)\n"
    "    OPTI(Opti)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_delete_Opti(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Opti *arg1 = (casadi::Opti *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  int is_owned;
  if (!SWIG_check_num_args("delete_Opti",argc,1,1,0)) {
    SWIG_fail;
  }
  is_owned = SWIG_Matlab_isOwned(argv[0]);
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__Opti, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Opti" "', argument " "1"" of type '" "casadi::Opti *""'"); 
  }
  arg1 = reinterpret_cast< casadi::Opti * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  if (is_owned) {
    {
      delete arg1;
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'delete_Opti'."
      "  Prototype:\n"
      "    OPTI(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_IndexAbstraction__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  casadi::IndexAbstraction *result = 0 ;
  
  if (!SWIG_check_num_args("new_IndexAbstraction",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      result = (casadi::IndexAbstraction *)new casadi::IndexAbstraction();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__IndexAbstraction, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_IndexAbstraction'."
      "  Prototype:\n"
      "    INDEXABSTRACTION()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_IndexAbstraction_start_get(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::IndexAbstraction *arg1 = (casadi::IndexAbstraction *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("IndexAbstraction_start_get",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__IndexAbstraction, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexAbstraction_start_get" "', argument " "1"" of type '" "casadi::IndexAbstraction *""'"); 
  }
  arg1 = reinterpret_cast< casadi::IndexAbstraction * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  result = (casadi_int) ((arg1)->start);
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'IndexAbstraction_start_get'."
      "  Prototype:\n"
      "    INDEXABSTRACTION_START_GET(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_IndexAbstraction_stop_get(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::IndexAbstraction *arg1 = (casadi::IndexAbstraction *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("IndexAbstraction_stop_get",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__IndexAbstraction, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexAbstraction_stop_get" "', argument " "1"" of type '" "casadi::IndexAbstraction *""'"); 
  }
  arg1 = reinterpret_cast< casadi::IndexAbstraction * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  result = (casadi_int) ((arg1)->stop);
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'IndexAbstraction_stop_get'."
      "  Prototype:\n"
      "    INDEXABSTRACTION_STOP_GET(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_IndexAbstraction__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::IndexAbstraction *arg1 = 0 ;
  void *argp1 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::IndexAbstraction *result = 0 ;
  
  if (!SWIG_check_num_args("new_IndexAbstraction",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_casadi__IndexAbstraction,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_IndexAbstraction" "', argument " "1"" of type '" "casadi::IndexAbstraction const &""'"); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_IndexAbstraction" "', argument " "1"" of type '" "casadi::IndexAbstraction const &""'"); 
  }
  arg1 = reinterpret_cast< casadi::IndexAbstraction * >(argp1);
  {
    result = (casadi::IndexAbstraction *)new casadi::IndexAbstraction((casadi::IndexAbstraction const &)*arg1);
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__IndexAbstraction, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_IndexAbstraction'."
      "  Prototype:\n"
      "    INDEXABSTRACTION(IndexAbstraction)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_IndexAbstraction(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 0) {
    return _wrap_new_IndexAbstraction__SWIG_0(resc,resv,argc,argv);
  }
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__IndexAbstraction, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_new_IndexAbstraction__SWIG_1(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_IndexAbstraction'."
    "  Possible prototypes are:\n"
    "    INDEXABSTRACTION()\n"
    "    INDEXABSTRACTION(IndexAbstraction)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_delete_IndexAbstraction(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::IndexAbstraction *arg1 = (casadi::IndexAbstraction *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  int is_owned;
  if (!SWIG_check_num_args("delete_IndexAbstraction",argc,1,1,0)) {
    SWIG_fail;
  }
  is_owned = SWIG_Matlab_isOwned(argv[0]);
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__IndexAbstraction, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexAbstraction" "', argument " "1"" of type '" "casadi::IndexAbstraction *""'"); 
  }
  arg1 = reinterpret_cast< casadi::IndexAbstraction * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  if (is_owned) {
    {
      delete arg1;
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'delete_IndexAbstraction'."
      "  Prototype:\n"
      "    INDEXABSTRACTION(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_MetaCon__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  casadi::MetaCon *result = 0 ;
  
  if (!SWIG_check_num_args("new_MetaCon",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    try {
      result = (casadi::MetaCon *)new casadi::MetaCon();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__MetaCon, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_MetaCon'."
      "  Prototype:\n"
      "    METACON()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MetaCon_original_get(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MetaCon *arg1 = (casadi::MetaCon *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::MX *result = 0 ;
  
  if (!SWIG_check_num_args("MetaCon_original_get",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MetaCon, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MetaCon_original_get" "', argument " "1"" of type '" "casadi::MetaCon *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MetaCon * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  result = (casadi::MX *) & ((arg1)->original);
  if(!(_out = casadi::from_ptr(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MetaCon_original_get'."
      "  Prototype:\n"
      "    METACON_ORIGINAL_GET(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MetaCon_canon_get(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MetaCon *arg1 = (casadi::MetaCon *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::MX *result = 0 ;
  
  if (!SWIG_check_num_args("MetaCon_canon_get",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MetaCon, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MetaCon_canon_get" "', argument " "1"" of type '" "casadi::MetaCon *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MetaCon * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  result = (casadi::MX *) & ((arg1)->canon);
  if(!(_out = casadi::from_ptr(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MetaCon_canon_get'."
      "  Prototype:\n"
      "    METACON_CANON_GET(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MetaCon_type_get(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MetaCon *arg1 = (casadi::MetaCon *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::ConstraintType result;
  
  if (!SWIG_check_num_args("MetaCon_type_get",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MetaCon, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MetaCon_type_get" "', argument " "1"" of type '" "casadi::MetaCon *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MetaCon * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  result = (casadi::ConstraintType) ((arg1)->type);
  _out = SWIG_From_int(static_cast< int >(result));
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MetaCon_type_get'."
      "  Prototype:\n"
      "    METACON_TYPE_GET(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MetaCon_lb_get(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MetaCon *arg1 = (casadi::MetaCon *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::MX *result = 0 ;
  
  if (!SWIG_check_num_args("MetaCon_lb_get",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MetaCon, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MetaCon_lb_get" "', argument " "1"" of type '" "casadi::MetaCon *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MetaCon * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  result = (casadi::MX *) & ((arg1)->lb);
  if(!(_out = casadi::from_ptr(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MetaCon_lb_get'."
      "  Prototype:\n"
      "    METACON_LB_GET(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MetaCon_ub_get(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MetaCon *arg1 = (casadi::MetaCon *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::MX *result = 0 ;
  
  if (!SWIG_check_num_args("MetaCon_ub_get",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MetaCon, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MetaCon_ub_get" "', argument " "1"" of type '" "casadi::MetaCon *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MetaCon * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  result = (casadi::MX *) & ((arg1)->ub);
  if(!(_out = casadi::from_ptr(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MetaCon_ub_get'."
      "  Prototype:\n"
      "    METACON_UB_GET(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MetaCon_n_get(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MetaCon *arg1 = (casadi::MetaCon *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("MetaCon_n_get",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MetaCon, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MetaCon_n_get" "', argument " "1"" of type '" "casadi::MetaCon *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MetaCon * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  result = (casadi_int) ((arg1)->n);
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MetaCon_n_get'."
      "  Prototype:\n"
      "    METACON_N_GET(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MetaCon_flipped_get(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MetaCon *arg1 = (casadi::MetaCon *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("MetaCon_flipped_get",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MetaCon, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MetaCon_flipped_get" "', argument " "1"" of type '" "casadi::MetaCon *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MetaCon * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  result = (bool) ((arg1)->flipped);
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MetaCon_flipped_get'."
      "  Prototype:\n"
      "    METACON_FLIPPED_GET(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MetaCon_dual_canon_get(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MetaCon *arg1 = (casadi::MetaCon *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::MX *result = 0 ;
  
  if (!SWIG_check_num_args("MetaCon_dual_canon_get",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MetaCon, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MetaCon_dual_canon_get" "', argument " "1"" of type '" "casadi::MetaCon *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MetaCon * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  result = (casadi::MX *) & ((arg1)->dual_canon);
  if(!(_out = casadi::from_ptr(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MetaCon_dual_canon_get'."
      "  Prototype:\n"
      "    METACON_DUAL_CANON_GET(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MetaCon_dual_get(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MetaCon *arg1 = (casadi::MetaCon *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::MX *result = 0 ;
  
  if (!SWIG_check_num_args("MetaCon_dual_get",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MetaCon, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MetaCon_dual_get" "', argument " "1"" of type '" "casadi::MetaCon *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MetaCon * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  result = (casadi::MX *) & ((arg1)->dual);
  if(!(_out = casadi::from_ptr(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MetaCon_dual_get'."
      "  Prototype:\n"
      "    METACON_DUAL_GET(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MetaCon_extra_get(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MetaCon *arg1 = (casadi::MetaCon *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Dict *result = 0 ;
  
  if (!SWIG_check_num_args("MetaCon_extra_get",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MetaCon, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MetaCon_extra_get" "', argument " "1"" of type '" "casadi::MetaCon *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MetaCon * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  result = (casadi::Dict *) & ((arg1)->extra);
  if(!(_out = casadi::from_ptr(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "struct" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MetaCon_extra_get'."
      "  Prototype:\n"
      "    METACON_EXTRA_GET(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_MetaCon__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MetaCon *arg1 = 0 ;
  void *argp1 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::MetaCon *result = 0 ;
  
  if (!SWIG_check_num_args("new_MetaCon",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_casadi__MetaCon,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_MetaCon" "', argument " "1"" of type '" "casadi::MetaCon const &""'"); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_MetaCon" "', argument " "1"" of type '" "casadi::MetaCon const &""'"); 
  }
  arg1 = reinterpret_cast< casadi::MetaCon * >(argp1);
  {
    result = (casadi::MetaCon *)new casadi::MetaCon((casadi::MetaCon const &)*arg1);
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__MetaCon, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_MetaCon'."
      "  Prototype:\n"
      "    METACON(MetaCon)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_MetaCon(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 0) {
    return _wrap_new_MetaCon__SWIG_0(resc,resv,argc,argv);
  }
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MetaCon, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_new_MetaCon__SWIG_1(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_MetaCon'."
    "  Possible prototypes are:\n"
    "    METACON()\n"
    "    METACON(MetaCon)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_delete_MetaCon(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MetaCon *arg1 = (casadi::MetaCon *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  int is_owned;
  if (!SWIG_check_num_args("delete_MetaCon",argc,1,1,0)) {
    SWIG_fail;
  }
  is_owned = SWIG_Matlab_isOwned(argv[0]);
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MetaCon, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_MetaCon" "', argument " "1"" of type '" "casadi::MetaCon *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MetaCon * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  if (is_owned) {
    {
      delete arg1;
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'delete_MetaCon'."
      "  Prototype:\n"
      "    METACON(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MetaVar_attribute_get(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MetaVar *arg1 = (casadi::MetaVar *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::string *result = 0 ;
  
  if (!SWIG_check_num_args("MetaVar_attribute_get",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MetaVar, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MetaVar_attribute_get" "', argument " "1"" of type '" "casadi::MetaVar *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MetaVar * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  result = (std::string *) & ((arg1)->attribute);
  if(!(_out = casadi::from_ptr(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MetaVar_attribute_get'."
      "  Prototype:\n"
      "    METAVAR_ATTRIBUTE_GET(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MetaVar_n_get(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MetaVar *arg1 = (casadi::MetaVar *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("MetaVar_n_get",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MetaVar, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MetaVar_n_get" "', argument " "1"" of type '" "casadi::MetaVar *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MetaVar * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  result = (casadi_int) ((arg1)->n);
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MetaVar_n_get'."
      "  Prototype:\n"
      "    METAVAR_N_GET(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MetaVar_m_get(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MetaVar *arg1 = (casadi::MetaVar *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("MetaVar_m_get",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MetaVar, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MetaVar_m_get" "', argument " "1"" of type '" "casadi::MetaVar *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MetaVar * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  result = (casadi_int) ((arg1)->m);
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MetaVar_m_get'."
      "  Prototype:\n"
      "    METAVAR_M_GET(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MetaVar_type_get(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MetaVar *arg1 = (casadi::MetaVar *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::VariableType result;
  
  if (!SWIG_check_num_args("MetaVar_type_get",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MetaVar, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MetaVar_type_get" "', argument " "1"" of type '" "casadi::MetaVar *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MetaVar * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  result = (casadi::VariableType) ((arg1)->type);
  _out = SWIG_From_int(static_cast< int >(result));
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MetaVar_type_get'."
      "  Prototype:\n"
      "    METAVAR_TYPE_GET(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MetaVar_count_get(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MetaVar *arg1 = (casadi::MetaVar *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("MetaVar_count_get",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MetaVar, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MetaVar_count_get" "', argument " "1"" of type '" "casadi::MetaVar *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MetaVar * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  result = (casadi_int) ((arg1)->count);
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MetaVar_count_get'."
      "  Prototype:\n"
      "    METAVAR_COUNT_GET(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MetaVar_i_get(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MetaVar *arg1 = (casadi::MetaVar *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("MetaVar_i_get",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MetaVar, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MetaVar_i_get" "', argument " "1"" of type '" "casadi::MetaVar *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MetaVar * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  result = (casadi_int) ((arg1)->i);
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MetaVar_i_get'."
      "  Prototype:\n"
      "    METAVAR_I_GET(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MetaVar_active_i_get(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MetaVar *arg1 = (casadi::MetaVar *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("MetaVar_active_i_get",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MetaVar, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MetaVar_active_i_get" "', argument " "1"" of type '" "casadi::MetaVar *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MetaVar * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  result = (casadi_int) ((arg1)->active_i);
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MetaVar_active_i_get'."
      "  Prototype:\n"
      "    METAVAR_ACTIVE_I_GET(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_MetaVar_extra_get(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MetaVar *arg1 = (casadi::MetaVar *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Dict *result = 0 ;
  
  if (!SWIG_check_num_args("MetaVar_extra_get",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MetaVar, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MetaVar_extra_get" "', argument " "1"" of type '" "casadi::MetaVar *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MetaVar * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  result = (casadi::Dict *) & ((arg1)->extra);
  if(!(_out = casadi::from_ptr(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "struct" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'MetaVar_extra_get'."
      "  Prototype:\n"
      "    METAVAR_EXTRA_GET(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_MetaVar__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  casadi::MetaVar *result = 0 ;
  
  if (!SWIG_check_num_args("new_MetaVar",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  {
    result = (casadi::MetaVar *)new casadi::MetaVar();
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__MetaVar, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_MetaVar'."
      "  Prototype:\n"
      "    METAVAR()\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_MetaVar__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MetaVar *arg1 = 0 ;
  void *argp1 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::MetaVar *result = 0 ;
  
  if (!SWIG_check_num_args("new_MetaVar",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_casadi__MetaVar,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_MetaVar" "', argument " "1"" of type '" "casadi::MetaVar const &""'"); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_MetaVar" "', argument " "1"" of type '" "casadi::MetaVar const &""'"); 
  }
  arg1 = reinterpret_cast< casadi::MetaVar * >(argp1);
  {
    result = (casadi::MetaVar *)new casadi::MetaVar((casadi::MetaVar const &)*arg1);
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__MetaVar, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_MetaVar'."
      "  Prototype:\n"
      "    METAVAR(MetaVar)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_MetaVar(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 0) {
    return _wrap_new_MetaVar__SWIG_0(resc,resv,argc,argv);
  }
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__MetaVar, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_new_MetaVar__SWIG_1(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_MetaVar'."
    "  Possible prototypes are:\n"
    "    METAVAR()\n"
    "    METAVAR(MetaVar)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_delete_MetaVar(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::MetaVar *arg1 = (casadi::MetaVar *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  int is_owned;
  if (!SWIG_check_num_args("delete_MetaVar",argc,1,1,0)) {
    SWIG_fail;
  }
  is_owned = SWIG_Matlab_isOwned(argv[0]);
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__MetaVar, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_MetaVar" "', argument " "1"" of type '" "casadi::MetaVar *""'"); 
  }
  arg1 = reinterpret_cast< casadi::MetaVar * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  if (is_owned) {
    {
      delete arg1;
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'delete_MetaVar'."
      "  Prototype:\n"
      "    METAVAR(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_OptiCallback__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray *arg1 = (mxArray *) 0 ;
  mxArray * _out;
  casadi::OptiCallback *result = 0 ;
  
  if (!SWIG_check_num_args("new_OptiCallback",argc,1,1,0)) {
    SWIG_fail;
  }
  arg1 = argv[0];
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      if ( !mxIsNumeric(arg1) ) {
        /* subclassed */
        result = (casadi::OptiCallback *)new SwigDirector_OptiCallback(arg1); 
      } else {
        result = (casadi::OptiCallback *)new casadi::OptiCallback(); 
      }
      
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__OptiCallback, 1 |  0 );
  if (!mxIsNumeric(arg1)) {
    SwigPtr* thisPtr = SWIG_Matlab_getSwigPtr(_out);
    SwigPtr* thatPtr = SWIG_Matlab_getSwigPtr(arg1);
    thisPtr->next = thatPtr;
  }
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_OptiCallback'."
      "  Prototype:\n"
      "    OPTICALLBACK(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_OptiCallback__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray *arg1 = (mxArray *) 0 ;
  casadi::OptiCallback *arg2 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  mxArray * _out;
  casadi::OptiCallback *result = 0 ;
  
  if (!SWIG_check_num_args("new_OptiCallback",argc,2,2,0)) {
    SWIG_fail;
  }
  arg1 = argv[0];
  res2 = SWIG_ConvertPtr(argv[1], &argp2, SWIGTYPE_p_casadi__OptiCallback,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_OptiCallback" "', argument " "2"" of type '" "casadi::OptiCallback const &""'"); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_OptiCallback" "', argument " "2"" of type '" "casadi::OptiCallback const &""'"); 
  }
  arg2 = reinterpret_cast< casadi::OptiCallback * >(argp2);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      if ( !mxIsNumeric(arg1) ) {
        /* subclassed */
        result = (casadi::OptiCallback *)new SwigDirector_OptiCallback(arg1,(casadi::OptiCallback const &)*arg2); 
      } else {
        result = (casadi::OptiCallback *)new casadi::OptiCallback((casadi::OptiCallback const &)*arg2); 
      }
      
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__OptiCallback, 1 |  0 );
  if (!mxIsNumeric(arg1)) {
    SwigPtr* thisPtr = SWIG_Matlab_getSwigPtr(_out);
    SwigPtr* thatPtr = SWIG_Matlab_getSwigPtr(arg1);
    thisPtr->next = thatPtr;
  }
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_OptiCallback'."
      "  Prototype:\n"
      "    OPTICALLBACK(self,OptiCallback)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_OptiCallback(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    _v = mxGetClassID(argv[0]) != mxUNKNOWN_CLASS;
    if (_v) {
      return _wrap_new_OptiCallback__SWIG_0(resc,resv,argc,argv);
    }
  }
  if (argc == 2) {
    int _v;
    _v = mxGetClassID(argv[0]) != mxUNKNOWN_CLASS;
    if (_v) {
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_casadi__OptiCallback, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        return _wrap_new_OptiCallback__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_OptiCallback'."
    "  Possible prototypes are:\n"
    "    OPTICALLBACK(self)\n"
    "    OPTICALLBACK(self,OptiCallback)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_OptiCallback_call(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::OptiCallback *arg1 = (casadi::OptiCallback *) 0 ;
  casadi_int arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Swig::Director *director = 0;
  bool upcall = false;
  mxArray * _out;
  
  if (!SWIG_check_num_args("OptiCallback_call",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__OptiCallback, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OptiCallback_call" "', argument " "1"" of type '" "casadi::OptiCallback *""'"); 
  }
  arg1 = reinterpret_cast< casadi::OptiCallback * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "int" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  director = SWIG_DIRECTOR_CAST(arg1);
  upcall = director;
  try {
    {
      try {
        if (upcall) {
          (arg1)->casadi::OptiCallback::call(arg2);
        } else {
          (arg1)->call(arg2);
        }
      } catch(const std::exception& e) {
        SWIG_exception(SWIG_RuntimeError, e.what());
      }
    }
  } catch (Swig::DirectorException&) {
    SWIG_fail;
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'OptiCallback_call'."
      "  Prototype:\n"
      "    CALL(self,int)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_delete_OptiCallback(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::OptiCallback *arg1 = (casadi::OptiCallback *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  int is_owned;
  if (!SWIG_check_num_args("delete_OptiCallback",argc,1,1,0)) {
    SWIG_fail;
  }
  is_owned = SWIG_Matlab_isOwned(argv[0]);
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__OptiCallback, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_OptiCallback" "', argument " "1"" of type '" "casadi::OptiCallback *""'"); 
  }
  arg1 = reinterpret_cast< casadi::OptiCallback * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  if (is_owned) {
    {
      try {
        delete arg1;
      } catch(const std::exception& e) {
        SWIG_exception(SWIG_RuntimeError, e.what());
      }
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'delete_OptiCallback'."
      "  Prototype:\n"
      "    OPTICALLBACK(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_disown_OptiCallback(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::OptiCallback *arg1 = (casadi::OptiCallback *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("disown_OptiCallback",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__OptiCallback, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "disown_OptiCallback" "', argument " "1"" of type '" "casadi::OptiCallback *""'"); 
  }
  arg1 = reinterpret_cast< casadi::OptiCallback * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    Swig::Director *director = SWIG_DIRECTOR_CAST(arg1);
    if (director) director->swig_disown();
  }
  
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_new_OptiAdvanced__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::Opti *arg1 = 0 ;
  void *argp1 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::OptiAdvanced *result = 0 ;
  
  if (!SWIG_check_num_args("new_OptiAdvanced",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_casadi__Opti,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_OptiAdvanced" "', argument " "1"" of type '" "casadi::Opti const &""'"); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_OptiAdvanced" "', argument " "1"" of type '" "casadi::Opti const &""'"); 
  }
  arg1 = reinterpret_cast< casadi::Opti * >(argp1);
  {
    try {
      result = (casadi::OptiAdvanced *)new casadi::OptiAdvanced((casadi::Opti const &)*arg1);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__OptiAdvanced, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_OptiAdvanced'."
      "  Prototype:\n"
      "    OPTIADVANCED(Opti)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_delete_OptiAdvanced(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::OptiAdvanced *arg1 = (casadi::OptiAdvanced *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  int is_owned;
  if (!SWIG_check_num_args("delete_OptiAdvanced",argc,1,1,0)) {
    SWIG_fail;
  }
  is_owned = SWIG_Matlab_isOwned(argv[0]);
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__OptiAdvanced, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_OptiAdvanced" "', argument " "1"" of type '" "casadi::OptiAdvanced *""'"); 
  }
  arg1 = reinterpret_cast< casadi::OptiAdvanced * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  if (is_owned) {
    {
      try {
        delete arg1;
      } catch(const std::exception& e) {
        SWIG_exception(SWIG_RuntimeError, e.what());
      }
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'delete_OptiAdvanced'."
      "  Prototype:\n"
      "    OPTIADVANCED(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_OptiAdvanced_solver(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::OptiAdvanced *arg1 = (casadi::OptiAdvanced *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Function result;
  
  if (!SWIG_check_num_args("OptiAdvanced_solver",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__OptiAdvanced, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OptiAdvanced_solver" "', argument " "1"" of type '" "casadi::OptiAdvanced const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::OptiAdvanced * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::OptiAdvanced const *)arg1)->casadi_solver();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "Function" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'OptiAdvanced_solver'."
      "  Prototype:\n"
      "    SOLVER(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_OptiAdvanced_is_parametric(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::OptiAdvanced *arg1 = (casadi::OptiAdvanced *) 0 ;
  casadi::MX *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("OptiAdvanced_is_parametric",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__OptiAdvanced, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OptiAdvanced_is_parametric" "', argument " "1"" of type '" "casadi::OptiAdvanced const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::OptiAdvanced * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::OptiAdvanced const *)arg1)->is_parametric((casadi::MX const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'OptiAdvanced_is_parametric'."
      "  Prototype:\n"
      "    IS_PARAMETRIC(self,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_OptiAdvanced_symvar__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::OptiAdvanced *arg1 = (casadi::OptiAdvanced *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi::MX,std::allocator< casadi::MX > > result;
  
  if (!SWIG_check_num_args("OptiAdvanced_symvar",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__OptiAdvanced, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OptiAdvanced_symvar" "', argument " "1"" of type '" "casadi::OptiAdvanced const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::OptiAdvanced * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::OptiAdvanced const *)arg1)->symvar();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "MX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'OptiAdvanced_symvar'."
      "  Prototype:\n"
      "    SYMVAR(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_OptiAdvanced_symvar__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::OptiAdvanced *arg1 = (casadi::OptiAdvanced *) 0 ;
  casadi::MX *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  mxArray * _out;
  std::vector< casadi::MX,std::allocator< casadi::MX > > result;
  
  if (!SWIG_check_num_args("OptiAdvanced_symvar",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__OptiAdvanced, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OptiAdvanced_symvar" "', argument " "1"" of type '" "casadi::OptiAdvanced const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::OptiAdvanced * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::OptiAdvanced const *)arg1)->symvar((casadi::MX const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "MX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'OptiAdvanced_symvar'."
      "  Prototype:\n"
      "    SYMVAR(self,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_OptiAdvanced_symvar__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::OptiAdvanced *arg1 = (casadi::OptiAdvanced *) 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::VariableType arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  int val3 ;
  int ecode3 = 0 ;
  mxArray * _out;
  std::vector< casadi::MX,std::allocator< casadi::MX > > result;
  
  if (!SWIG_check_num_args("OptiAdvanced_symvar",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__OptiAdvanced, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OptiAdvanced_symvar" "', argument " "1"" of type '" "casadi::OptiAdvanced const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::OptiAdvanced * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  ecode3 = SWIG_AsVal_int(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "OptiAdvanced_symvar" "', argument " "3"" of type '" "casadi::VariableType""'");
  } 
  arg3 = static_cast< casadi::VariableType >(val3);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::OptiAdvanced const *)arg1)->symvar((casadi::MX const &)*arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "MX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'OptiAdvanced_symvar'."
      "  Prototype:\n"
      "    SYMVAR(self,MX,casadi::VariableType)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_OptiAdvanced_symvar(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__OptiAdvanced, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_OptiAdvanced_symvar__SWIG_0(resc,resv,argc,argv);
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__OptiAdvanced, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        return _wrap_OptiAdvanced_symvar__SWIG_1(resc,resv,argc,argv);
      }
    }
  }
  if (argc == 3) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__OptiAdvanced, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        {
          int res = SWIG_AsVal_int(argv[2], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_OptiAdvanced_symvar__SWIG_2(resc,resv,argc,argv);
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'OptiAdvanced_symvar'."
    "  Possible prototypes are:\n"
    "    SYMVAR(self)\n"
    "    SYMVAR(self,MX)\n"
    "    SYMVAR(self,MX,casadi::VariableType)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_OptiAdvanced_canon_expr(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::OptiAdvanced *arg1 = (casadi::OptiAdvanced *) 0 ;
  casadi::MX *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  mxArray * _out;
  casadi::MetaCon result;
  
  if (!SWIG_check_num_args("OptiAdvanced_canon_expr",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__OptiAdvanced, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OptiAdvanced_canon_expr" "', argument " "1"" of type '" "casadi::OptiAdvanced const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::OptiAdvanced * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::OptiAdvanced const *)arg1)->canon_expr((casadi::MX const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj((new casadi::MetaCon(static_cast< const casadi::MetaCon& >(result))), SWIGTYPE_p_casadi__MetaCon, SWIG_POINTER_OWN |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'OptiAdvanced_canon_expr'."
      "  Prototype:\n"
      "    CANON_EXPR(self,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_OptiAdvanced_get_meta(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::OptiAdvanced *arg1 = (casadi::OptiAdvanced *) 0 ;
  casadi::MX *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  mxArray * _out;
  casadi::MetaVar result;
  
  if (!SWIG_check_num_args("OptiAdvanced_get_meta",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__OptiAdvanced, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OptiAdvanced_get_meta" "', argument " "1"" of type '" "casadi::OptiAdvanced const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::OptiAdvanced * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::OptiAdvanced const *)arg1)->get_meta((casadi::MX const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj((new casadi::MetaVar(static_cast< const casadi::MetaVar& >(result))), SWIGTYPE_p_casadi__MetaVar, SWIG_POINTER_OWN |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'OptiAdvanced_get_meta'."
      "  Prototype:\n"
      "    GET_META(self,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_OptiAdvanced_get_meta_con(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::OptiAdvanced *arg1 = (casadi::OptiAdvanced *) 0 ;
  casadi::MX *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  mxArray * _out;
  casadi::MetaCon result;
  
  if (!SWIG_check_num_args("OptiAdvanced_get_meta_con",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__OptiAdvanced, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OptiAdvanced_get_meta_con" "', argument " "1"" of type '" "casadi::OptiAdvanced const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::OptiAdvanced * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::OptiAdvanced const *)arg1)->get_meta_con((casadi::MX const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj((new casadi::MetaCon(static_cast< const casadi::MetaCon& >(result))), SWIGTYPE_p_casadi__MetaCon, SWIG_POINTER_OWN |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'OptiAdvanced_get_meta_con'."
      "  Prototype:\n"
      "    GET_META_CON(self,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_OptiAdvanced_set_meta(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::OptiAdvanced *arg1 = (casadi::OptiAdvanced *) 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::MetaVar *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  void *argp3 ;
  int res3 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("OptiAdvanced_set_meta",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__OptiAdvanced, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OptiAdvanced_set_meta" "', argument " "1"" of type '" "casadi::OptiAdvanced *""'"); 
  }
  arg1 = reinterpret_cast< casadi::OptiAdvanced * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  res3 = SWIG_ConvertPtr(argv[2], &argp3, SWIGTYPE_p_casadi__MetaVar,  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "OptiAdvanced_set_meta" "', argument " "3"" of type '" "casadi::MetaVar const &""'"); 
  }
  if (!argp3) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "OptiAdvanced_set_meta" "', argument " "3"" of type '" "casadi::MetaVar const &""'"); 
  }
  arg3 = reinterpret_cast< casadi::MetaVar * >(argp3);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->set_meta((casadi::MX const &)*arg2,(casadi::MetaVar const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'OptiAdvanced_set_meta'."
      "  Prototype:\n"
      "    SET_META(self,MX,MetaVar)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_OptiAdvanced_set_meta_con(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::OptiAdvanced *arg1 = (casadi::OptiAdvanced *) 0 ;
  casadi::MX *arg2 = 0 ;
  casadi::MetaCon *arg3 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  void *argp3 ;
  int res3 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("OptiAdvanced_set_meta_con",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__OptiAdvanced, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OptiAdvanced_set_meta_con" "', argument " "1"" of type '" "casadi::OptiAdvanced *""'"); 
  }
  arg1 = reinterpret_cast< casadi::OptiAdvanced * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  res3 = SWIG_ConvertPtr(argv[2], &argp3, SWIGTYPE_p_casadi__MetaCon,  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "OptiAdvanced_set_meta_con" "', argument " "3"" of type '" "casadi::MetaCon const &""'"); 
  }
  if (!argp3) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "OptiAdvanced_set_meta_con" "', argument " "3"" of type '" "casadi::MetaCon const &""'"); 
  }
  arg3 = reinterpret_cast< casadi::MetaCon * >(argp3);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->set_meta_con((casadi::MX const &)*arg2,(casadi::MetaCon const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'OptiAdvanced_set_meta_con'."
      "  Prototype:\n"
      "    SET_META_CON(self,MX,MetaCon)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_OptiAdvanced_assert_active_symbol(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::OptiAdvanced *arg1 = (casadi::OptiAdvanced *) 0 ;
  casadi::MX *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("OptiAdvanced_assert_active_symbol",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__OptiAdvanced, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OptiAdvanced_assert_active_symbol" "', argument " "1"" of type '" "casadi::OptiAdvanced const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::OptiAdvanced * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::OptiAdvanced const *)arg1)->assert_active_symbol((casadi::MX const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'OptiAdvanced_assert_active_symbol'."
      "  Prototype:\n"
      "    ASSERT_ACTIVE_SYMBOL(self,MX)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_OptiAdvanced_active_symvar(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::OptiAdvanced *arg1 = (casadi::OptiAdvanced *) 0 ;
  casadi::VariableType arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  mxArray * _out;
  std::vector< casadi::MX,std::allocator< casadi::MX > > result;
  
  if (!SWIG_check_num_args("OptiAdvanced_active_symvar",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__OptiAdvanced, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OptiAdvanced_active_symvar" "', argument " "1"" of type '" "casadi::OptiAdvanced const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::OptiAdvanced * >(argp1);
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OptiAdvanced_active_symvar" "', argument " "2"" of type '" "casadi::VariableType""'");
  } 
  arg2 = static_cast< casadi::VariableType >(val2);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::OptiAdvanced const *)arg1)->active_symvar(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "MX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'OptiAdvanced_active_symvar'."
      "  Prototype:\n"
      "    ACTIVE_SYMVAR(self,casadi::VariableType)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_OptiAdvanced_active_values(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::OptiAdvanced *arg1 = (casadi::OptiAdvanced *) 0 ;
  casadi::VariableType arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  mxArray * _out;
  std::vector< casadi::DM,std::allocator< casadi::DM > > result;
  
  if (!SWIG_check_num_args("OptiAdvanced_active_values",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__OptiAdvanced, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OptiAdvanced_active_values" "', argument " "1"" of type '" "casadi::OptiAdvanced const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::OptiAdvanced * >(argp1);
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OptiAdvanced_active_values" "', argument " "2"" of type '" "casadi::VariableType""'");
  } 
  arg2 = static_cast< casadi::VariableType >(val2);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::OptiAdvanced const *)arg1)->active_values(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "DM" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'OptiAdvanced_active_values'."
      "  Prototype:\n"
      "    ACTIVE_VALUES(self,casadi::VariableType)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_OptiAdvanced_x_lookup(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::OptiAdvanced *arg1 = (casadi::OptiAdvanced *) 0 ;
  casadi_index arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("OptiAdvanced_x_lookup",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__OptiAdvanced, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OptiAdvanced_x_lookup" "', argument " "1"" of type '" "casadi::OptiAdvanced const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::OptiAdvanced * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type ' index '.");
  if (arg2==0) SWIG_exception_fail(SWIG_TypeError,"Index starts at 1, got index '0'.");
  if (arg2>=1) arg2--;
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::OptiAdvanced const *)arg1)->x_lookup(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'OptiAdvanced_x_lookup'."
      "  Prototype:\n"
      "    X_LOOKUP(self,index)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_OptiAdvanced_g_lookup(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::OptiAdvanced *arg1 = (casadi::OptiAdvanced *) 0 ;
  casadi_index arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("OptiAdvanced_g_lookup",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__OptiAdvanced, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OptiAdvanced_g_lookup" "', argument " "1"" of type '" "casadi::OptiAdvanced const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::OptiAdvanced * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type ' index '.");
  if (arg2==0) SWIG_exception_fail(SWIG_TypeError,"Index starts at 1, got index '0'.");
  if (arg2>=1) arg2--;
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::OptiAdvanced const *)arg1)->g_lookup(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'OptiAdvanced_g_lookup'."
      "  Prototype:\n"
      "    G_LOOKUP(self,index)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_OptiAdvanced_x_describe(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::OptiAdvanced *arg1 = (casadi::OptiAdvanced *) 0 ;
  casadi_index arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("OptiAdvanced_x_describe",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__OptiAdvanced, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OptiAdvanced_x_describe" "', argument " "1"" of type '" "casadi::OptiAdvanced const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::OptiAdvanced * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type ' index '.");
  if (arg2==0) SWIG_exception_fail(SWIG_TypeError,"Index starts at 1, got index '0'.");
  if (arg2>=1) arg2--;
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::OptiAdvanced const *)arg1)->x_describe(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'OptiAdvanced_x_describe'."
      "  Prototype:\n"
      "    X_DESCRIBE(self,index)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_OptiAdvanced_g_describe(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::OptiAdvanced *arg1 = (casadi::OptiAdvanced *) 0 ;
  casadi_index arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("OptiAdvanced_g_describe",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__OptiAdvanced, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OptiAdvanced_g_describe" "', argument " "1"" of type '" "casadi::OptiAdvanced const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::OptiAdvanced * >(argp1);
  if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type ' index '.");
  if (arg2==0) SWIG_exception_fail(SWIG_TypeError,"Index starts at 1, got index '0'.");
  if (arg2>=1) arg2--;
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::OptiAdvanced const *)arg1)->g_describe(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'OptiAdvanced_g_describe'."
      "  Prototype:\n"
      "    G_DESCRIBE(self,index)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_OptiAdvanced_describe(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::OptiAdvanced *arg1 = (casadi::OptiAdvanced *) 0 ;
  casadi::MX *arg2 = 0 ;
  casadi_index arg3 = (casadi_index) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("OptiAdvanced_describe",argc,3,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__OptiAdvanced, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OptiAdvanced_describe" "', argument " "1"" of type '" "casadi::OptiAdvanced const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::OptiAdvanced * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  if (2<argc) {
    if (!casadi::to_val(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type ' index '.");
    if (arg3==0) SWIG_exception_fail(SWIG_TypeError,"Index starts at 1, got index '0'.");
    if (arg3>=1) arg3--;
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::OptiAdvanced const *)arg1)->describe((casadi::MX const &)*arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'OptiAdvanced_describe'."
      "  Prototype:\n"
      "    DESCRIBE(self,MX,index)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_OptiAdvanced_show_infeasibilities(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::OptiAdvanced *arg1 = (casadi::OptiAdvanced *) 0 ;
  double arg2 = (double) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("OptiAdvanced_show_infeasibilities",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__OptiAdvanced, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OptiAdvanced_show_infeasibilities" "', argument " "1"" of type '" "casadi::OptiAdvanced const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::OptiAdvanced * >(argp1);
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "double" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::OptiAdvanced const *)arg1)->show_infeasibilities(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'OptiAdvanced_show_infeasibilities'."
      "  Prototype:\n"
      "    SHOW_INFEASIBILITIES(self,double)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_OptiAdvanced_solve_prepare(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::OptiAdvanced *arg1 = (casadi::OptiAdvanced *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("OptiAdvanced_solve_prepare",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__OptiAdvanced, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OptiAdvanced_solve_prepare" "', argument " "1"" of type '" "casadi::OptiAdvanced *""'"); 
  }
  arg1 = reinterpret_cast< casadi::OptiAdvanced * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->solve_prepare();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'OptiAdvanced_solve_prepare'."
      "  Prototype:\n"
      "    SOLVE_PREPARE(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_OptiAdvanced_solve_actual(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::OptiAdvanced *arg1 = (casadi::OptiAdvanced *) 0 ;
  casadi::DMDict *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::map< std::string,casadi::Matrix< double > > m2 ;
  mxArray * _out;
  casadi::DMDict result;
  
  if (!SWIG_check_num_args("OptiAdvanced_solve_actual",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__OptiAdvanced, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OptiAdvanced_solve_actual" "', argument " "1"" of type '" "casadi::OptiAdvanced *""'"); 
  }
  arg1 = reinterpret_cast< casadi::OptiAdvanced * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "struct" ":" "DM" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (arg1)->solve_actual((casadi::DMDict const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "struct" ":" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'OptiAdvanced_solve_actual'."
      "  Prototype:\n"
      "    SOLVE_ACTUAL(self,struct:DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_OptiAdvanced_arg(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::OptiAdvanced *arg1 = (casadi::OptiAdvanced *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::DMDict result;
  
  if (!SWIG_check_num_args("OptiAdvanced_arg",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__OptiAdvanced, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OptiAdvanced_arg" "', argument " "1"" of type '" "casadi::OptiAdvanced const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::OptiAdvanced * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::OptiAdvanced const *)arg1)->arg();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "struct" ":" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'OptiAdvanced_arg'."
      "  Prototype:\n"
      "    ARG(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_OptiAdvanced_res__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::OptiAdvanced *arg1 = (casadi::OptiAdvanced *) 0 ;
  casadi::DMDict *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::map< std::string,casadi::Matrix< double > > m2 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("OptiAdvanced_res",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__OptiAdvanced, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OptiAdvanced_res" "', argument " "1"" of type '" "casadi::OptiAdvanced *""'"); 
  }
  arg1 = reinterpret_cast< casadi::OptiAdvanced * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "struct" ":" "DM" "'.");
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->res((casadi::DMDict const &)*arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'OptiAdvanced_res'."
      "  Prototype:\n"
      "    RES(self,struct:DM)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_OptiAdvanced_res__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::OptiAdvanced *arg1 = (casadi::OptiAdvanced *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::DMDict result;
  
  if (!SWIG_check_num_args("OptiAdvanced_res",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__OptiAdvanced, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OptiAdvanced_res" "', argument " "1"" of type '" "casadi::OptiAdvanced const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::OptiAdvanced * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::OptiAdvanced const *)arg1)->res();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "struct" ":" "DM" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'OptiAdvanced_res'."
      "  Prototype:\n"
      "    RES(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_OptiAdvanced_res(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__OptiAdvanced, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_OptiAdvanced_res__SWIG_1(resc,resv,argc,argv);
    }
  }
  if (argc == 2) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__OptiAdvanced, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< std::map<std::string,casadi::Matrix<double> > **>(0));
      if (_v) {
        return _wrap_OptiAdvanced_res__SWIG_0(resc,resv,argc,argv);
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'OptiAdvanced_res'."
    "  Possible prototypes are:\n"
    "    RES(self)\n"
    "    RES(self,struct:DM)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_OptiAdvanced_constraints(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::OptiAdvanced *arg1 = (casadi::OptiAdvanced *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi::MX,std::allocator< casadi::MX > > result;
  
  if (!SWIG_check_num_args("OptiAdvanced_constraints",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__OptiAdvanced, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OptiAdvanced_constraints" "', argument " "1"" of type '" "casadi::OptiAdvanced const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::OptiAdvanced * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::OptiAdvanced const *)arg1)->constraints();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "MX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'OptiAdvanced_constraints'."
      "  Prototype:\n"
      "    CONSTRAINTS(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_OptiAdvanced_objective(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::OptiAdvanced *arg1 = (casadi::OptiAdvanced *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::MX result;
  
  if (!SWIG_check_num_args("OptiAdvanced_objective",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__OptiAdvanced, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OptiAdvanced_objective" "', argument " "1"" of type '" "casadi::OptiAdvanced const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::OptiAdvanced * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::OptiAdvanced const *)arg1)->objective();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "MX" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'OptiAdvanced_objective'."
      "  Prototype:\n"
      "    OBJECTIVE(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_OptiAdvanced_baked_copy(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::OptiAdvanced *arg1 = (casadi::OptiAdvanced *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  SwigValueWrapper< casadi::OptiAdvanced > result;
  
  if (!SWIG_check_num_args("OptiAdvanced_baked_copy",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__OptiAdvanced, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OptiAdvanced_baked_copy" "', argument " "1"" of type '" "casadi::OptiAdvanced const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::OptiAdvanced * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::OptiAdvanced const *)arg1)->baked_copy();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj((new casadi::OptiAdvanced(static_cast< const casadi::OptiAdvanced& >(result))), SWIGTYPE_p_casadi__OptiAdvanced, SWIG_POINTER_OWN |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'OptiAdvanced_baked_copy'."
      "  Prototype:\n"
      "    BAKED_COPY(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_OptiAdvanced_assert_empty(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::OptiAdvanced *arg1 = (casadi::OptiAdvanced *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("OptiAdvanced_assert_empty",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__OptiAdvanced, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OptiAdvanced_assert_empty" "', argument " "1"" of type '" "casadi::OptiAdvanced const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::OptiAdvanced * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::OptiAdvanced const *)arg1)->assert_empty();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'OptiAdvanced_assert_empty'."
      "  Prototype:\n"
      "    ASSERT_EMPTY(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_OptiAdvanced_bake(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::OptiAdvanced *arg1 = (casadi::OptiAdvanced *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("OptiAdvanced_bake",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__OptiAdvanced, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OptiAdvanced_bake" "', argument " "1"" of type '" "casadi::OptiAdvanced *""'"); 
  }
  arg1 = reinterpret_cast< casadi::OptiAdvanced * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->bake();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'OptiAdvanced_bake'."
      "  Prototype:\n"
      "    BAKE(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_OptiAdvanced_problem_dirty__get(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::OptiAdvanced *arg1 = (casadi::OptiAdvanced *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("OptiAdvanced_problem_dirty__get",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__OptiAdvanced, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OptiAdvanced_problem_dirty__get" "', argument " "1"" of type '" "casadi::OptiAdvanced *""'"); 
  }
  arg1 = reinterpret_cast< casadi::OptiAdvanced * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  result = (bool) ((arg1)->problem_dirty_);
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'OptiAdvanced_problem_dirty__get'."
      "  Prototype:\n"
      "    OPTIADVANCED_PROBLEM_DIRTY__GET(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_OptiAdvanced_mark_problem_dirty(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::OptiAdvanced *arg1 = (casadi::OptiAdvanced *) 0 ;
  bool arg2 = (bool) true ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("OptiAdvanced_mark_problem_dirty",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__OptiAdvanced, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OptiAdvanced_mark_problem_dirty" "', argument " "1"" of type '" "casadi::OptiAdvanced *""'"); 
  }
  arg1 = reinterpret_cast< casadi::OptiAdvanced * >(argp1);
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->mark_problem_dirty(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'OptiAdvanced_mark_problem_dirty'."
      "  Prototype:\n"
      "    MARK_PROBLEM_DIRTY(self,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_OptiAdvanced_problem_dirty(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::OptiAdvanced *arg1 = (casadi::OptiAdvanced *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("OptiAdvanced_problem_dirty",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__OptiAdvanced, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OptiAdvanced_problem_dirty" "', argument " "1"" of type '" "casadi::OptiAdvanced const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::OptiAdvanced * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::OptiAdvanced const *)arg1)->problem_dirty();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'OptiAdvanced_problem_dirty'."
      "  Prototype:\n"
      "    PROBLEM_DIRTY(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_OptiAdvanced_solver_dirty__get(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::OptiAdvanced *arg1 = (casadi::OptiAdvanced *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("OptiAdvanced_solver_dirty__get",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__OptiAdvanced, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OptiAdvanced_solver_dirty__get" "', argument " "1"" of type '" "casadi::OptiAdvanced *""'"); 
  }
  arg1 = reinterpret_cast< casadi::OptiAdvanced * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  result = (bool) ((arg1)->solver_dirty_);
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'OptiAdvanced_solver_dirty__get'."
      "  Prototype:\n"
      "    OPTIADVANCED_SOLVER_DIRTY__GET(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_OptiAdvanced_mark_solver_dirty(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::OptiAdvanced *arg1 = (casadi::OptiAdvanced *) 0 ;
  bool arg2 = (bool) true ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("OptiAdvanced_mark_solver_dirty",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__OptiAdvanced, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OptiAdvanced_mark_solver_dirty" "', argument " "1"" of type '" "casadi::OptiAdvanced *""'"); 
  }
  arg1 = reinterpret_cast< casadi::OptiAdvanced * >(argp1);
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->mark_solver_dirty(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'OptiAdvanced_mark_solver_dirty'."
      "  Prototype:\n"
      "    MARK_SOLVER_DIRTY(self,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_OptiAdvanced_solver_dirty(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::OptiAdvanced *arg1 = (casadi::OptiAdvanced *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("OptiAdvanced_solver_dirty",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__OptiAdvanced, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OptiAdvanced_solver_dirty" "', argument " "1"" of type '" "casadi::OptiAdvanced const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::OptiAdvanced * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::OptiAdvanced const *)arg1)->solver_dirty();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'OptiAdvanced_solver_dirty'."
      "  Prototype:\n"
      "    SOLVER_DIRTY(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_OptiAdvanced_solved__get(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::OptiAdvanced *arg1 = (casadi::OptiAdvanced *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("OptiAdvanced_solved__get",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__OptiAdvanced, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OptiAdvanced_solved__get" "', argument " "1"" of type '" "casadi::OptiAdvanced *""'"); 
  }
  arg1 = reinterpret_cast< casadi::OptiAdvanced * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  result = (bool) ((arg1)->solved_);
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'OptiAdvanced_solved__get'."
      "  Prototype:\n"
      "    OPTIADVANCED_SOLVED__GET(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_OptiAdvanced_mark_solved(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::OptiAdvanced *arg1 = (casadi::OptiAdvanced *) 0 ;
  bool arg2 = (bool) true ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("OptiAdvanced_mark_solved",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__OptiAdvanced, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OptiAdvanced_mark_solved" "', argument " "1"" of type '" "casadi::OptiAdvanced *""'"); 
  }
  arg1 = reinterpret_cast< casadi::OptiAdvanced * >(argp1);
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      (arg1)->mark_solved(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'OptiAdvanced_mark_solved'."
      "  Prototype:\n"
      "    MARK_SOLVED(self,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_OptiAdvanced_solved(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::OptiAdvanced *arg1 = (casadi::OptiAdvanced *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  bool result;
  
  if (!SWIG_check_num_args("OptiAdvanced_solved",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__OptiAdvanced, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OptiAdvanced_solved" "', argument " "1"" of type '" "casadi::OptiAdvanced const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::OptiAdvanced * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (bool)((casadi::OptiAdvanced const *)arg1)->solved();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "bool" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'OptiAdvanced_solved'."
      "  Prototype:\n"
      "    SOLVED(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_OptiAdvanced_assert_solved(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::OptiAdvanced *arg1 = (casadi::OptiAdvanced *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("OptiAdvanced_assert_solved",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__OptiAdvanced, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OptiAdvanced_assert_solved" "', argument " "1"" of type '" "casadi::OptiAdvanced const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::OptiAdvanced * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::OptiAdvanced const *)arg1)->assert_solved();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'OptiAdvanced_assert_solved'."
      "  Prototype:\n"
      "    ASSERT_SOLVED(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_OptiAdvanced_assert_baked(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::OptiAdvanced *arg1 = (casadi::OptiAdvanced *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("OptiAdvanced_assert_baked",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__OptiAdvanced, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OptiAdvanced_assert_baked" "', argument " "1"" of type '" "casadi::OptiAdvanced const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::OptiAdvanced * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::OptiAdvanced const *)arg1)->assert_baked();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'OptiAdvanced_assert_baked'."
      "  Prototype:\n"
      "    ASSERT_BAKED(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_OptiAdvanced_instance_number(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::OptiAdvanced *arg1 = (casadi::OptiAdvanced *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi_int result;
  
  if (!SWIG_check_num_args("OptiAdvanced_instance_number",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__OptiAdvanced, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OptiAdvanced_instance_number" "', argument " "1"" of type '" "casadi::OptiAdvanced const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::OptiAdvanced * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = (casadi_int)((casadi::OptiAdvanced const *)arg1)->instance_number();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "int" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'OptiAdvanced_instance_number'."
      "  Prototype:\n"
      "    INSTANCE_NUMBER(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_OptiAdvanced__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::OptiAdvanced *arg1 = 0 ;
  void *argp1 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::OptiAdvanced *result = 0 ;
  
  if (!SWIG_check_num_args("new_OptiAdvanced",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_casadi__OptiAdvanced,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_OptiAdvanced" "', argument " "1"" of type '" "casadi::OptiAdvanced const &""'"); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_OptiAdvanced" "', argument " "1"" of type '" "casadi::OptiAdvanced const &""'"); 
  }
  arg1 = reinterpret_cast< casadi::OptiAdvanced * >(argp1);
  {
    result = (casadi::OptiAdvanced *)new casadi::OptiAdvanced((casadi::OptiAdvanced const &)*arg1);
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__OptiAdvanced, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_OptiAdvanced'."
      "  Prototype:\n"
      "    OPTIADVANCED(OptiAdvanced)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_OptiAdvanced(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__OptiAdvanced, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_new_OptiAdvanced__SWIG_2(resc,resv,argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__Opti, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_new_OptiAdvanced__SWIG_0(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_OptiAdvanced'."
    "  Possible prototypes are:\n"
    "    OPTIADVANCED(OptiAdvanced)\n"
    "    OPTIADVANCED(Opti)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_OptiSol_type_name(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::OptiSol *arg1 = (casadi::OptiSol *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("OptiSol_type_name",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__OptiSol, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OptiSol_type_name" "', argument " "1"" of type '" "casadi::OptiSol const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::OptiSol * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::OptiSol const *)arg1)->type_name();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'OptiSol_type_name'."
      "  Prototype:\n"
      "    TYPE_NAME(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_OptiSol_disp(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::OptiSol *arg1 = (casadi::OptiSol *) 0 ;
  std::ostream *arg2 = 0 ;
  bool arg3 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  arg2 = &casadi::uout();
  if (!SWIG_check_num_args("OptiSol_disp",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__OptiSol, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OptiSol_disp" "', argument " "1"" of type '" "casadi::OptiSol const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::OptiSol * >(argp1);
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      ((casadi::OptiSol const *)arg1)->disp(*arg2,arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  *arg2 << "\n" << std::flush;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'OptiSol_disp'."
      "  Prototype:\n"
      "    DISP(self,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_OptiSol_str(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::OptiSol *arg1 = (casadi::OptiSol *) 0 ;
  bool arg2 = (bool) false ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::string result;
  
  if (!SWIG_check_num_args("OptiSol_str",argc,2,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__OptiSol, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OptiSol_str" "', argument " "1"" of type '" "casadi::OptiSol const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::OptiSol * >(argp1);
  if (1<argc) {
    if (!casadi::to_val(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "bool" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::OptiSol const *)arg1)->get_str(arg2);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "char" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'OptiSol_str'."
      "  Prototype:\n"
      "    STR(self,bool)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_OptiSol_value__SWIG_0(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::OptiSol *arg1 = (casadi::OptiSol *) 0 ;
  casadi::MX *arg2 = 0 ;
  std::vector< casadi::MX,std::allocator< casadi::MX > > const &arg3_defvalue = std::vector< casadi::MX >() ;
  std::vector< casadi::MX,std::allocator< casadi::MX > > *arg3 = (std::vector< casadi::MX,std::allocator< casadi::MX > > *) &arg3_defvalue ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::MX m2 ;
  std::vector< casadi::MX > m3 ;
  mxArray * _out;
  casadi::native_DM result;
  
  if (!SWIG_check_num_args("OptiSol_value",argc,3,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__OptiSol, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OptiSol_value" "', argument " "1"" of type '" "casadi::OptiSol const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::OptiSol * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "MX" "'.");
  if (2<argc) {
    arg3 = &m3;
    if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "{" "MX" "}" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::OptiSol const *)arg1)->value((casadi::MX const &)*arg2,(std::vector< casadi::MX,std::allocator< casadi::MX > > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = full_or_sparse(result, true))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type 'double'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'OptiSol_value'."
      "  Prototype:\n"
      "    VALUE(self,MX,{MX})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_OptiSol_value__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::OptiSol *arg1 = (casadi::OptiSol *) 0 ;
  casadi::DM *arg2 = 0 ;
  std::vector< casadi::MX,std::allocator< casadi::MX > > const &arg3_defvalue = std::vector< casadi::MX >() ;
  std::vector< casadi::MX,std::allocator< casadi::MX > > *arg3 = (std::vector< casadi::MX,std::allocator< casadi::MX > > *) &arg3_defvalue ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< double > m2 ;
  std::vector< casadi::MX > m3 ;
  mxArray * _out;
  casadi::native_DM result;
  
  if (!SWIG_check_num_args("OptiSol_value",argc,3,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__OptiSol, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OptiSol_value" "', argument " "1"" of type '" "casadi::OptiSol const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::OptiSol * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "DM" "'.");
  if (2<argc) {
    arg3 = &m3;
    if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "{" "MX" "}" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::OptiSol const *)arg1)->value((casadi::DM const &)*arg2,(std::vector< casadi::MX,std::allocator< casadi::MX > > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = full_or_sparse(result, true))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type 'double'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'OptiSol_value'."
      "  Prototype:\n"
      "    VALUE(self,DM,{MX})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_OptiSol_value__SWIG_2(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::OptiSol *arg1 = (casadi::OptiSol *) 0 ;
  casadi::SX *arg2 = 0 ;
  std::vector< casadi::MX,std::allocator< casadi::MX > > const &arg3_defvalue = std::vector< casadi::MX >() ;
  std::vector< casadi::MX,std::allocator< casadi::MX > > *arg3 = (std::vector< casadi::MX,std::allocator< casadi::MX > > *) &arg3_defvalue ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  casadi::Matrix< casadi::SXElem > m2 ;
  std::vector< casadi::MX > m3 ;
  mxArray * _out;
  casadi::native_DM result;
  
  if (!SWIG_check_num_args("OptiSol_value",argc,3,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__OptiSol, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OptiSol_value" "', argument " "1"" of type '" "casadi::OptiSol const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::OptiSol * >(argp1);
  arg2 = &m2;
  if (!casadi::to_ptr(argv[1], &arg2)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 2 to type '" "SX" "'.");
  if (2<argc) {
    arg3 = &m3;
    if (!casadi::to_ptr(argv[2], &arg3)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input 3 to type '" "{" "MX" "}" "'.");
  }
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::OptiSol const *)arg1)->value((casadi::SX const &)*arg2,(std::vector< casadi::MX,std::allocator< casadi::MX > > const &)*arg3);
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = full_or_sparse(result, true))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type 'double'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'OptiSol_value'."
      "  Prototype:\n"
      "    VALUE(self,SX,{MX})\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_OptiSol_value(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if ((argc >= 2) && (argc <= 3)) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__OptiSol, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<double> **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_OptiSol_value__SWIG_1(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< std::vector<casadi::MX> **>(0));
        if (_v) {
          return _wrap_OptiSol_value__SWIG_1(resc,resv,argc,argv);
        }
      }
    }
  }
  if ((argc >= 2) && (argc <= 3)) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__OptiSol, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::Matrix<casadi::SXElem> **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_OptiSol_value__SWIG_2(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< std::vector<casadi::MX> **>(0));
        if (_v) {
          return _wrap_OptiSol_value__SWIG_2(resc,resv,argc,argv);
        }
      }
    }
  }
  if ((argc >= 2) && (argc <= 3)) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__OptiSol, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      _v = casadi::to_ptr(argv[1], static_cast< casadi::MX **>(0));
      if (_v) {
        if (argc <= 2) {
          return _wrap_OptiSol_value__SWIG_0(resc,resv,argc,argv);
        }
        _v = casadi::to_ptr(argv[2], static_cast< std::vector<casadi::MX> **>(0));
        if (_v) {
          return _wrap_OptiSol_value__SWIG_0(resc,resv,argc,argv);
        }
      }
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'OptiSol_value'."
    "  Possible prototypes are:\n"
    "    VALUE(self,DM,{MX})\n"
    "    VALUE(self,SX,{MX})\n"
    "    VALUE(self,MX,{MX})\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_OptiSol_value_variables(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::OptiSol *arg1 = (casadi::OptiSol *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi::MX,std::allocator< casadi::MX > > result;
  
  if (!SWIG_check_num_args("OptiSol_value_variables",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__OptiSol, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OptiSol_value_variables" "', argument " "1"" of type '" "casadi::OptiSol const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::OptiSol * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::OptiSol const *)arg1)->value_variables();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "MX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'OptiSol_value_variables'."
      "  Prototype:\n"
      "    VALUE_VARIABLES(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_OptiSol_value_parameters(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::OptiSol *arg1 = (casadi::OptiSol *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  std::vector< casadi::MX,std::allocator< casadi::MX > > result;
  
  if (!SWIG_check_num_args("OptiSol_value_parameters",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__OptiSol, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OptiSol_value_parameters" "', argument " "1"" of type '" "casadi::OptiSol const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::OptiSol * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::OptiSol const *)arg1)->value_parameters();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "{" "MX" "}" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'OptiSol_value_parameters'."
      "  Prototype:\n"
      "    VALUE_PARAMETERS(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_OptiSol_stats(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::OptiSol *arg1 = (casadi::OptiSol *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Dict result;
  
  if (!SWIG_check_num_args("OptiSol_stats",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__OptiSol, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OptiSol_stats" "', argument " "1"" of type '" "casadi::OptiSol const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::OptiSol * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::OptiSol const *)arg1)->stats();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  if(!(_out = casadi::from_ref(result))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" "struct" "'.");
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'OptiSol_stats'."
      "  Prototype:\n"
      "    STATS(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_OptiSol_opti(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::OptiSol *arg1 = (casadi::OptiSol *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::Opti result;
  
  if (!SWIG_check_num_args("OptiSol_opti",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__OptiSol, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OptiSol_opti" "', argument " "1"" of type '" "casadi::OptiSol const *""'"); 
  }
  arg1 = reinterpret_cast< casadi::OptiSol * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  {
    try {
      result = ((casadi::OptiSol const *)arg1)->opti();
    } catch(const std::exception& e) {
      SWIG_exception(SWIG_RuntimeError, e.what());
    }
  }
  _out = SWIG_NewPointerObj((new casadi::Opti(static_cast< const casadi::Opti& >(result))), SWIGTYPE_p_casadi__Opti, SWIG_POINTER_OWN |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'OptiSol_opti'."
      "  Prototype:\n"
      "    OPTI(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_OptiSol__SWIG_1(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::OptiSol *arg1 = 0 ;
  void *argp1 ;
  int res1 = 0 ;
  mxArray * _out;
  casadi::OptiSol *result = 0 ;
  
  if (!SWIG_check_num_args("new_OptiSol",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_casadi__OptiSol,  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_OptiSol" "', argument " "1"" of type '" "casadi::OptiSol const &""'"); 
  }
  if (!argp1) {
    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_OptiSol" "', argument " "1"" of type '" "casadi::OptiSol const &""'"); 
  }
  arg1 = reinterpret_cast< casadi::OptiSol * >(argp1);
  {
    result = (casadi::OptiSol *)new casadi::OptiSol((casadi::OptiSol const &)*arg1);
  }
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_casadi__OptiSol, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_OptiSol'."
      "  Prototype:\n"
      "    OPTISOL(OptiSol)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}


int _wrap_new_OptiSol(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc == 1) {
    int _v;
    void *vptr = 0;
    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_casadi__OptiSol, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      return _wrap_new_OptiSol__SWIG_1(resc,resv,argc,argv);
    }
  }
  
  const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
  SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'new_OptiSol'."
    "  Possible prototypes are:\n"
    "    OPTISOL(OptiSol)\n"
    
    "  You have: %s", type_name);
  return 1;
}


int _wrap_delete_OptiSol(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  casadi::OptiSol *arg1 = (casadi::OptiSol *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  int is_owned;
  if (!SWIG_check_num_args("delete_OptiSol",argc,1,1,0)) {
    SWIG_fail;
  }
  is_owned = SWIG_Matlab_isOwned(argv[0]);
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_casadi__OptiSol, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_OptiSol" "', argument " "1"" of type '" "casadi::OptiSol *""'"); 
  }
  arg1 = reinterpret_cast< casadi::OptiSol * >(argp1);
  
  if (!arg1) {
    SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
    SWIG_fail;
  }
  
  if (is_owned) {
    {
      delete arg1;
    }
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  if (SWIG_lasterror_code == SWIG_TypeError) {
    const char* type_name = SWIG_Matlab_ArgsTypeDesc(argc, argv);
    SWIG_Error(SWIG_RuntimeError, "No matching function for overload function 'delete_OptiSol'."
      "  Prototype:\n"
      "    OPTISOL(self)\n"
      
      "  You have: %s", type_name);
  }
  return 1;
}



/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */

static void *_p_casadi__GenericMatrixT_casadi__MatrixT_casadi__SXElem_t_tTo_p_casadi__SparsityInterfaceCommon(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((casadi::SparsityInterfaceCommon *)  ((casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > *) x));
}
static void *_p_casadi__GenericMatrixT_casadi__MX_tTo_p_casadi__SparsityInterfaceCommon(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((casadi::SparsityInterfaceCommon *)  ((casadi::GenericMatrix< casadi::MX > *) x));
}
static void *_p_casadi__MatrixT_casadi__SXElem_tTo_p_casadi__SparsityInterfaceCommon(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((casadi::SparsityInterfaceCommon *) (casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > *) ((casadi::Matrix< casadi::SXElem > *) x));
}
static void *_p_casadi__GenericMatrixT_casadi__MatrixT_double_t_tTo_p_casadi__SparsityInterfaceCommon(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((casadi::SparsityInterfaceCommon *)  ((casadi::GenericMatrix< casadi::Matrix< double > > *) x));
}
static void *_p_casadi__SparsityTo_p_casadi__SparsityInterfaceCommon(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((casadi::SparsityInterfaceCommon *)  ((casadi::Sparsity *) x));
}
static void *_p_casadi__MatrixT_double_tTo_p_casadi__SparsityInterfaceCommon(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((casadi::SparsityInterfaceCommon *) (casadi::GenericMatrix< casadi::Matrix< double > > *) ((casadi::Matrix< double > *) x));
}
static void *_p_casadi__MXTo_p_casadi__SparsityInterfaceCommon(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((casadi::SparsityInterfaceCommon *) (casadi::GenericMatrix< casadi::MX > *) ((casadi::MX *) x));
}
static void *_p_casadi__SliceTo_p_casadi__PrintableCommon(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((casadi::PrintableCommon *)  ((casadi::Slice *) x));
}
static void *_p_casadi__MatrixT_casadi__SXElem_tTo_p_casadi__PrintableCommon(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((casadi::PrintableCommon *)  ((casadi::Matrix< casadi::SXElem > *) x));
}
static void *_p_casadi__OptiAdvancedTo_p_casadi__PrintableCommon(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((casadi::PrintableCommon *) (casadi::Opti *) ((casadi::OptiAdvanced *) x));
}
static void *_p_casadi__SparsityTo_p_casadi__PrintableCommon(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((casadi::PrintableCommon *)  ((casadi::Sparsity *) x));
}
static void *_p_casadi__FunctionTo_p_casadi__PrintableCommon(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((casadi::PrintableCommon *)  ((casadi::Function *) x));
}
static void *_p_casadi__OptiTo_p_casadi__PrintableCommon(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((casadi::PrintableCommon *)  ((casadi::Opti *) x));
}
static void *_p_casadi__CallbackTo_p_casadi__PrintableCommon(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((casadi::PrintableCommon *) (casadi::Function *) ((casadi::Callback *) x));
}
static void *_p_casadi__MatrixT_double_tTo_p_casadi__PrintableCommon(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((casadi::PrintableCommon *)  ((casadi::Matrix< double > *) x));
}
static void *_p_casadi__OptiSolTo_p_casadi__PrintableCommon(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((casadi::PrintableCommon *)  ((casadi::OptiSol *) x));
}
static void *_p_casadi__DaeBuilderTo_p_casadi__PrintableCommon(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((casadi::PrintableCommon *)  ((casadi::DaeBuilder *) x));
}
static void *_p_casadi__NlpBuilderTo_p_casadi__PrintableCommon(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((casadi::PrintableCommon *)  ((casadi::NlpBuilder *) x));
}
static void *_p_casadi__GenericTypeTo_p_casadi__PrintableCommon(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((casadi::PrintableCommon *)  ((casadi::GenericType *) x));
}
static void *_p_casadi__MXTo_p_casadi__PrintableCommon(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((casadi::PrintableCommon *)  ((casadi::MX *) x));
}
static void *_p_casadi__LinsolTo_p_casadi__PrintableCommon(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((casadi::PrintableCommon *)  ((casadi::Linsol *) x));
}
static void *_p_casadi__ImporterTo_p_casadi__PrintableCommon(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((casadi::PrintableCommon *)  ((casadi::Importer *) x));
}
static void *_p_casadi__XmlFileTo_p_casadi__PrintableCommon(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((casadi::PrintableCommon *)  ((casadi::XmlFile *) x));
}
static void *_p_casadi__MatrixT_long_long_tTo_p_casadi__PrintableCommon(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((casadi::PrintableCommon *)  ((casadi::Matrix< long long > *) x));
}
static void *_p_casadi__MatrixT_casadi__SXElem_tTo_p_casadi__MatrixCommon(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((casadi::MatrixCommon *)  ((casadi::Matrix< casadi::SXElem > *) x));
}
static void *_p_casadi__MatrixT_long_long_tTo_p_casadi__MatrixCommon(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((casadi::MatrixCommon *)  ((casadi::Matrix< long long > *) x));
}
static void *_p_casadi__MatrixT_double_tTo_p_casadi__MatrixCommon(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((casadi::MatrixCommon *)  ((casadi::Matrix< double > *) x));
}
static void *_p_casadi__MatrixT_casadi__SXElem_tTo_p_casadi__GenericExpressionCommon(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((casadi::GenericExpressionCommon *)  ((casadi::Matrix< casadi::SXElem > *) x));
}
static void *_p_casadi__MatrixT_long_long_tTo_p_casadi__GenericExpressionCommon(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((casadi::GenericExpressionCommon *)  ((casadi::Matrix< long long > *) x));
}
static void *_p_casadi__MatrixT_double_tTo_p_casadi__GenericExpressionCommon(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((casadi::GenericExpressionCommon *)  ((casadi::Matrix< double > *) x));
}
static void *_p_casadi__MXTo_p_casadi__GenericExpressionCommon(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((casadi::GenericExpressionCommon *)  ((casadi::MX *) x));
}
static void *_p_casadi__GenericMatrixT_casadi__MatrixT_casadi__SXElem_t_tTo_p_casadi__GenericMatrixCommon(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((casadi::GenericMatrixCommon *)  ((casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > *) x));
}
static void *_p_casadi__GenericMatrixT_casadi__MX_tTo_p_casadi__GenericMatrixCommon(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((casadi::GenericMatrixCommon *)  ((casadi::GenericMatrix< casadi::MX > *) x));
}
static void *_p_casadi__MatrixT_casadi__SXElem_tTo_p_casadi__GenericMatrixCommon(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((casadi::GenericMatrixCommon *) (casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > *) ((casadi::Matrix< casadi::SXElem > *) x));
}
static void *_p_casadi__GenericMatrixT_casadi__MatrixT_double_t_tTo_p_casadi__GenericMatrixCommon(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((casadi::GenericMatrixCommon *)  ((casadi::GenericMatrix< casadi::Matrix< double > > *) x));
}
static void *_p_casadi__MatrixT_double_tTo_p_casadi__GenericMatrixCommon(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((casadi::GenericMatrixCommon *) (casadi::GenericMatrix< casadi::Matrix< double > > *) ((casadi::Matrix< double > *) x));
}
static void *_p_casadi__MXTo_p_casadi__GenericMatrixCommon(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((casadi::GenericMatrixCommon *) (casadi::GenericMatrix< casadi::MX > *) ((casadi::MX *) x));
}
static void *_p_casadi__OptiAdvancedTo_p_casadi__Opti(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((casadi::Opti *)  ((casadi::OptiAdvanced *) x));
}
static void *_p_casadi__CallbackTo_p_casadi__Function(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((casadi::Function *)  ((casadi::Callback *) x));
}
static void *_p_casadi__DaeBuilderTo_p_casadi__SharedObject(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((casadi::SharedObject *)  ((casadi::DaeBuilder *) x));
}
static void *_p_casadi__OptiTo_p_casadi__SharedObject(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((casadi::SharedObject *)  ((casadi::Opti *) x));
}
static void *_p_casadi__FunctionTo_p_casadi__SharedObject(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((casadi::SharedObject *)  ((casadi::Function *) x));
}
static void *_p_casadi__ImporterTo_p_casadi__SharedObject(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((casadi::SharedObject *)  ((casadi::Importer *) x));
}
static void *_p_casadi__SparsityTo_p_casadi__SharedObject(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((casadi::SharedObject *)  ((casadi::Sparsity *) x));
}
static void *_p_casadi__MXTo_p_casadi__SharedObject(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((casadi::SharedObject *)  ((casadi::MX *) x));
}
static void *_p_casadi__CallbackTo_p_casadi__SharedObject(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((casadi::SharedObject *) (casadi::Function *) ((casadi::Callback *) x));
}
static void *_p_casadi__XmlFileTo_p_casadi__SharedObject(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((casadi::SharedObject *)  ((casadi::XmlFile *) x));
}
static void *_p_casadi__WeakRefTo_p_casadi__SharedObject(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((casadi::SharedObject *)  ((casadi::WeakRef *) x));
}
static void *_p_casadi__LinsolTo_p_casadi__SharedObject(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((casadi::SharedObject *)  ((casadi::Linsol *) x));
}
static void *_p_casadi__OptiAdvancedTo_p_casadi__SharedObject(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((casadi::SharedObject *) (casadi::Opti *) ((casadi::OptiAdvanced *) x));
}
static void *_p_casadi__MatrixT_casadi__SXElem_tTo_p_casadi__GenericMatrixT_casadi__MatrixT_casadi__SXElem_t_t(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > *)  ((casadi::Matrix< casadi::SXElem > *) x));
}
static void *_p_casadi__StringDeserializerTo_p_casadi__DeserializerBase(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((casadi::DeserializerBase *)  ((casadi::StringDeserializer *) x));
}
static void *_p_casadi__FileDeserializerTo_p_casadi__DeserializerBase(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((casadi::DeserializerBase *)  ((casadi::FileDeserializer *) x));
}
static void *_p_casadi__StringSerializerTo_p_casadi__SerializerBase(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((casadi::SerializerBase *)  ((casadi::StringSerializer *) x));
}
static void *_p_casadi__FileSerializerTo_p_casadi__SerializerBase(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((casadi::SerializerBase *)  ((casadi::FileSerializer *) x));
}
static void *_p_casadi__MXTo_p_casadi__GenericMatrixT_casadi__MX_t(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((casadi::GenericMatrix< casadi::MX > *)  ((casadi::MX *) x));
}
static void *_p_casadi__MatrixT_double_tTo_p_casadi__GenericMatrixT_casadi__MatrixT_double_t_t(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((casadi::GenericMatrix< casadi::Matrix< double > > *)  ((casadi::Matrix< double > *) x));
}
static void *_p_casadi__MetaConTo_p_casadi__IndexAbstraction(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((casadi::IndexAbstraction *)  ((casadi::MetaCon *) x));
}
static void *_p_casadi__MetaVarTo_p_casadi__IndexAbstraction(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((casadi::IndexAbstraction *)  ((casadi::MetaVar *) x));
}
static swig_type_info _swigt__p_AuxOut = {"_p_AuxOut", "AuxOut *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Dict = {"_p_Dict", "Dict *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_MXDict = {"_p_MXDict", "MXDict *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_allocator_type = {"_p_allocator_type", "allocator_type *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_casadi__Callback = {"_p_casadi__Callback", "casadi::Callback *", 0, 0, (void*)"casadi.Callback", 0};
static swig_type_info _swigt__p_casadi__CasadiMeta = {"_p_casadi__CasadiMeta", "casadi::CasadiMeta *", 0, 0, (void*)"casadi.CasadiMeta", 0};
static swig_type_info _swigt__p_casadi__CodeGenerator = {"_p_casadi__CodeGenerator", "casadi::CodeGenerator *", 0, 0, (void*)"casadi.CodeGenerator", 0};
static swig_type_info _swigt__p_casadi__DaeBuilder = {"_p_casadi__DaeBuilder", "casadi::DaeBuilder *", 0, 0, (void*)"casadi.DaeBuilder", 0};
static swig_type_info _swigt__p_casadi__DeserializerBase = {"_p_casadi__DeserializerBase", "casadi::DeserializerBase *", 0, 0, (void*)"casadi.DeserializerBase", 0};
static swig_type_info _swigt__p_casadi__DeserializingStream = {"_p_casadi__DeserializingStream", "casadi::DeserializingStream *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_casadi__FileDeserializer = {"_p_casadi__FileDeserializer", "casadi::FileDeserializer *", 0, 0, (void*)"casadi.FileDeserializer", 0};
static swig_type_info _swigt__p_casadi__FileSerializer = {"_p_casadi__FileSerializer", "casadi::FileSerializer *", 0, 0, (void*)"casadi.FileSerializer", 0};
static swig_type_info _swigt__p_casadi__Function = {"_p_casadi__Function", "casadi::Function *", 0, 0, (void*)"casadi.Function", 0};
static swig_type_info _swigt__p_casadi__GenericExpressionCommon = {"_p_casadi__GenericExpressionCommon", "casadi::GenericExpressionCommon *", 0, 0, (void*)"casadi.GenericExpressionCommon", 0};
static swig_type_info _swigt__p_casadi__MatrixT_long_long_t = {"_p_casadi__MatrixT_long_long_t", 0, 0, 0, 0, 0};
static swig_type_info _swigt__p_casadi__GenericMatrixCommon = {"_p_casadi__GenericMatrixCommon", "casadi::GenericMatrixCommon *", 0, 0, (void*)"casadi.GenericMatrixCommon", 0};
static swig_type_info _swigt__p_casadi__GenericMatrixT_casadi__MX_t = {"_p_casadi__GenericMatrixT_casadi__MX_t", "casadi::GenericMatrix< casadi::MX > *", 0, 0, (void*)"casadi.GenMX", 0};
static swig_type_info _swigt__p_casadi__GenericMatrixT_casadi__MatrixT_casadi__SXElem_t_t = {"_p_casadi__GenericMatrixT_casadi__MatrixT_casadi__SXElem_t_t", "casadi::GenericMatrix< casadi::Matrix< casadi::SXElem > > *", 0, 0, (void*)"casadi.GenSX", 0};
static swig_type_info _swigt__p_casadi__GenericMatrixT_casadi__MatrixT_double_t_t = {"_p_casadi__GenericMatrixT_casadi__MatrixT_double_t_t", "casadi::GenericMatrix< casadi::Matrix< double > > *", 0, 0, (void*)"casadi.GenDM", 0};
static swig_type_info _swigt__p_casadi__GenericType = {"_p_casadi__GenericType", "casadi::GenericType *", 0, 0, (void*)"casadi.GenericType", 0};
static swig_type_info _swigt__p_casadi__GlobalOptions = {"_p_casadi__GlobalOptions", "casadi::GlobalOptions *", 0, 0, (void*)"casadi.GlobalOptions", 0};
static swig_type_info _swigt__p_casadi__Importer = {"_p_casadi__Importer", "casadi::Importer *", 0, 0, (void*)"casadi.Importer", 0};
static swig_type_info _swigt__p_casadi__IndexAbstraction = {"_p_casadi__IndexAbstraction", "casadi::IndexAbstraction *", 0, 0, (void*)"casadi.IndexAbstraction", 0};
static swig_type_info _swigt__p_casadi__Linsol = {"_p_casadi__Linsol", "casadi::Linsol *", 0, 0, (void*)"casadi.Linsol", 0};
static swig_type_info _swigt__p_casadi__MX = {"_p_casadi__MX", "casadi::MX *", 0, 0, (void*)"casadi.MX", 0};
static swig_type_info _swigt__p_casadi__MatrixCommon = {"_p_casadi__MatrixCommon", "casadi::MatrixCommon *", 0, 0, (void*)"casadi.MatrixCommon", 0};
static swig_type_info _swigt__p_casadi__MatrixT_casadi__SXElem_t = {"_p_casadi__MatrixT_casadi__SXElem_t", "casadi::Matrix< casadi::SXElem > *|casadi::SX *", 0, 0, (void*)"casadi.SX", 0};
static swig_type_info _swigt__p_casadi__MatrixT_double_t = {"_p_casadi__MatrixT_double_t", "casadi::DM *|casadi::Matrix< double > *|casadi::native_DM *", 0, 0, (void*)"casadi.DM", 0};
static swig_type_info _swigt__p_casadi__MetaCon = {"_p_casadi__MetaCon", "casadi::MetaCon *", 0, 0, (void*)"casadi.MetaCon", 0};
static swig_type_info _swigt__p_casadi__MetaVar = {"_p_casadi__MetaVar", "casadi::MetaVar *", 0, 0, (void*)"casadi.MetaVar", 0};
static swig_type_info _swigt__p_casadi__NlpBuilder = {"_p_casadi__NlpBuilder", "casadi::NlpBuilder *", 0, 0, (void*)"casadi.NlpBuilder", 0};
static swig_type_info _swigt__p_casadi__Opti = {"_p_casadi__Opti", "casadi::Opti *", 0, 0, (void*)"casadi.Opti", 0};
static swig_type_info _swigt__p_casadi__OptiAdvanced = {"_p_casadi__OptiAdvanced", "casadi::OptiAdvanced *", 0, 0, (void*)"casadi.OptiAdvanced", 0};
static swig_type_info _swigt__p_casadi__OptiCallback = {"_p_casadi__OptiCallback", "casadi::OptiCallback *", 0, 0, (void*)"casadi.OptiCallback", 0};
static swig_type_info _swigt__p_casadi__OptiSol = {"_p_casadi__OptiSol", "casadi::OptiSol *", 0, 0, (void*)"casadi.OptiSol", 0};
static swig_type_info _swigt__p_casadi__PrintableCommon = {"_p_casadi__PrintableCommon", "casadi::PrintableCommon *", 0, 0, (void*)"casadi.PrintableCommon", 0};
static swig_type_info _swigt__p_casadi__SXElem = {"_p_casadi__SXElem", "casadi::SXElem *", 0, 0, (void*)"casadi.SXElem", 0};
static swig_type_info _swigt__p_casadi__SerializerBase = {"_p_casadi__SerializerBase", "casadi::SerializerBase *", 0, 0, (void*)"casadi.SerializerBase", 0};
static swig_type_info _swigt__p_casadi__SerializingStream = {"_p_casadi__SerializingStream", "casadi::SerializingStream *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_casadi__SharedObject = {"_p_casadi__SharedObject", "casadi::SharedObject *", 0, 0, (void*)"casadi.SharedObject", 0};
static swig_type_info _swigt__p_casadi__SharedObjectInternal = {"_p_casadi__SharedObjectInternal", "casadi::SharedObjectInternal *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_casadi__Slice = {"_p_casadi__Slice", "casadi::Slice *", 0, 0, (void*)"casadi.Slice", 0};
static swig_type_info _swigt__p_casadi__Sparsity = {"_p_casadi__Sparsity", "casadi::Sparsity *", 0, 0, (void*)"casadi.Sparsity", 0};
static swig_type_info _swigt__p_casadi__SparsityInterfaceCommon = {"_p_casadi__SparsityInterfaceCommon", "casadi::SparsityInterfaceCommon *", 0, 0, (void*)"casadi.SparsityInterfaceCommon", 0};
static swig_type_info _swigt__p_casadi__StringDeserializer = {"_p_casadi__StringDeserializer", "casadi::StringDeserializer *", 0, 0, (void*)"casadi.StringDeserializer", 0};
static swig_type_info _swigt__p_casadi__StringSerializer = {"_p_casadi__StringSerializer", "casadi::StringSerializer *", 0, 0, (void*)"casadi.StringSerializer", 0};
static swig_type_info _swigt__p_casadi__WeakRef = {"_p_casadi__WeakRef", "casadi::WeakRef *", 0, 0, (void*)"casadi.WeakRef", 0};
static swig_type_info _swigt__p_casadi__XmlFile = {"_p_casadi__XmlFile", "casadi::XmlFile *", 0, 0, (void*)"casadi.XmlFile", 0};
static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_const_reference = {"_p_const_reference", "const_reference *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_difference_type = {"_p_difference_type", "difference_type *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_double = {"_p_double", "double *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_first_type = {"_p_first_type", "first_type *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_key_type = {"_p_key_type", "key_type *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_long_long = {"_p_long_long", "casadi_index *|long long *|casadi_int *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_mapped_type = {"_p_mapped_type", "mapped_type *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_p_double = {"_p_p_double", "double **", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_reference = {"_p_reference", "reference *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_second_type = {"_p_second_type", "second_type *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_size_type = {"_p_size_type", "size_type *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_std__initializer_listT_casadi__MX_t = {"_p_std__initializer_listT_casadi__MX_t", "casadi::MXIList *|std::initializer_list< casadi::MX > *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_std__initializer_listT_casadi__MatrixT_casadi__SXElem_t_t = {"_p_std__initializer_listT_casadi__MatrixT_casadi__SXElem_t_t", "std::initializer_list< casadi::Matrix< casadi::SXElem > > *|casadi::SXIList *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_std__istream = {"_p_std__istream", "std::istream *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_std__mapT_std__string_casadi__GenericType_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_casadi__GenericType_t_t_t = {"_p_std__mapT_std__string_casadi__GenericType_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_casadi__GenericType_t_t_t", "std::map< std::string,casadi::GenericType,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::GenericType > > > *|casadi::Dict *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_std__mapT_std__string_casadi__MX_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_casadi__MX_t_t_t = {"_p_std__mapT_std__string_casadi__MX_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_casadi__MX_t_t_t", "std::map< std::string,casadi::MX,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::MX > > > *|casadi::MXDict *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_std__mapT_std__string_casadi__MatrixT_casadi__SXElem_t_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_casadi__MatrixT_casadi__SXElem_t_t_t_t = {"_p_std__mapT_std__string_casadi__MatrixT_casadi__SXElem_t_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_casadi__MatrixT_casadi__SXElem_t_t_t_t", "std::map< std::string,casadi::Matrix< casadi::SXElem >,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::Matrix< casadi::SXElem > > > > *|casadi::SXDict *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_std__mapT_std__string_casadi__MatrixT_double_t_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_casadi__MatrixT_double_t_t_t_t = {"_p_std__mapT_std__string_casadi__MatrixT_double_t_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_casadi__MatrixT_double_t_t_t_t", "std::map< std::string,casadi::Matrix< double >,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::Matrix< double > > > > *|casadi::DMDict *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_std__mapT_std__string_casadi__Sparsity_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_casadi__Sparsity_t_t_t = {"_p_std__mapT_std__string_casadi__Sparsity_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_casadi__Sparsity_t_t_t", "std::map< std::string,casadi::Sparsity,std::less< std::string >,std::allocator< std::pair< std::string const,casadi::Sparsity > > > *|casadi::SpDict *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_std__ostream = {"_p_std__ostream", "std::ostream *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_std__pairT_casadi__Slice_casadi__Slice_t = {"_p_std__pairT_casadi__Slice_casadi__Slice_t", "std::pair< casadi::Slice,casadi::Slice > *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_std__string = {"_p_std__string", "std::string *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_std__vectorT_casadi__Linsol_std__allocatorT_casadi__Linsol_t_t = {"_p_std__vectorT_casadi__Linsol_std__allocatorT_casadi__Linsol_t_t", "std::vector< casadi::Linsol,std::allocator< casadi::Linsol > > *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_std__vectorT_casadi__MX_std__allocatorT_casadi__MX_t_t = {"_p_std__vectorT_casadi__MX_std__allocatorT_casadi__MX_t_t", "std::vector< casadi::MX,std::allocator< casadi::MX > > *|casadi::MXVector *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_std__vectorT_casadi__MatrixT_casadi__SXElem_t_std__allocatorT_casadi__MatrixT_casadi__SXElem_t_t_t = {"_p_std__vectorT_casadi__MatrixT_casadi__SXElem_t_std__allocatorT_casadi__MatrixT_casadi__SXElem_t_t_t", "std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > *|casadi::SXVector *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_std__vectorT_casadi__MatrixT_double_t_std__allocatorT_casadi__MatrixT_double_t_t_t = {"_p_std__vectorT_casadi__MatrixT_double_t_std__allocatorT_casadi__MatrixT_double_t_t_t", "std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > *|casadi::DMVector *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_std__vectorT_std__vectorT_casadi__MX_std__allocatorT_casadi__MX_t_t_std__allocatorT_std__vectorT_casadi__MX_std__allocatorT_casadi__MX_t_t_t_t = {"_p_std__vectorT_std__vectorT_casadi__MX_std__allocatorT_casadi__MX_t_t_std__allocatorT_std__vectorT_casadi__MX_std__allocatorT_casadi__MX_t_t_t_t", "std::vector< std::vector< casadi::MX,std::allocator< casadi::MX > >,std::allocator< std::vector< casadi::MX,std::allocator< casadi::MX > > > > *|casadi::MXVectorVector *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_std__vectorT_std__vectorT_casadi__MatrixT_casadi__SXElem_t_std__allocatorT_casadi__MatrixT_casadi__SXElem_t_t_t_std__allocatorT_std__vectorT_casadi__MatrixT_casadi__SXElem_t_std__allocatorT_casadi__MatrixT_casadi__SXElem_t_t_t_t_t = {"_p_std__vectorT_std__vectorT_casadi__MatrixT_casadi__SXElem_t_std__allocatorT_casadi__MatrixT_casadi__SXElem_t_t_t_std__allocatorT_std__vectorT_casadi__MatrixT_casadi__SXElem_t_std__allocatorT_casadi__MatrixT_casadi__SXElem_t_t_t_t_t", "std::vector< std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > >,std::allocator< std::vector< casadi::Matrix< casadi::SXElem >,std::allocator< casadi::Matrix< casadi::SXElem > > > > > *|casadi::SXVectorVector *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_std__vectorT_std__vectorT_casadi__MatrixT_double_t_std__allocatorT_casadi__MatrixT_double_t_t_t_std__allocatorT_std__vectorT_casadi__MatrixT_double_t_std__allocatorT_casadi__MatrixT_double_t_t_t_t_t = {"_p_std__vectorT_std__vectorT_casadi__MatrixT_double_t_std__allocatorT_casadi__MatrixT_double_t_t_t_std__allocatorT_std__vectorT_casadi__MatrixT_double_t_std__allocatorT_casadi__MatrixT_double_t_t_t_t_t", "std::vector< std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > >,std::allocator< std::vector< casadi::Matrix< double >,std::allocator< casadi::Matrix< double > > > > > *|casadi::DMVectorVector *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_swig__MatlabSwigIterator = {"_p_swig__MatlabSwigIterator", "swig::MatlabSwigIterator *", 0, 0, (void*)"casadi.MatlabSwigIterator", 0};
static swig_type_info _swigt__p_value_type = {"_p_value_type", "value_type *", 0, 0, (void*)0, 0};

static swig_type_info *swig_type_initial[] = {
  &_swigt__p_AuxOut,
  &_swigt__p_Dict,
  &_swigt__p_MXDict,
  &_swigt__p_allocator_type,
  &_swigt__p_casadi__Callback,
  &_swigt__p_casadi__CasadiMeta,
  &_swigt__p_casadi__CodeGenerator,
  &_swigt__p_casadi__DaeBuilder,
  &_swigt__p_casadi__DeserializerBase,
  &_swigt__p_casadi__DeserializingStream,
  &_swigt__p_casadi__FileDeserializer,
  &_swigt__p_casadi__FileSerializer,
  &_swigt__p_casadi__Function,
  &_swigt__p_casadi__GenericExpressionCommon,
  &_swigt__p_casadi__GenericMatrixCommon,
  &_swigt__p_casadi__GenericMatrixT_casadi__MX_t,
  &_swigt__p_casadi__GenericMatrixT_casadi__MatrixT_casadi__SXElem_t_t,
  &_swigt__p_casadi__GenericMatrixT_casadi__MatrixT_double_t_t,
  &_swigt__p_casadi__GenericType,
  &_swigt__p_casadi__GlobalOptions,
  &_swigt__p_casadi__Importer,
  &_swigt__p_casadi__IndexAbstraction,
  &_swigt__p_casadi__Linsol,
  &_swigt__p_casadi__MX,
  &_swigt__p_casadi__MatrixCommon,
  &_swigt__p_casadi__MatrixT_casadi__SXElem_t,
  &_swigt__p_casadi__MatrixT_double_t,
  &_swigt__p_casadi__MatrixT_long_long_t,
  &_swigt__p_casadi__MetaCon,
  &_swigt__p_casadi__MetaVar,
  &_swigt__p_casadi__NlpBuilder,
  &_swigt__p_casadi__Opti,
  &_swigt__p_casadi__OptiAdvanced,
  &_swigt__p_casadi__OptiCallback,
  &_swigt__p_casadi__OptiSol,
  &_swigt__p_casadi__PrintableCommon,
  &_swigt__p_casadi__SXElem,
  &_swigt__p_casadi__SerializerBase,
  &_swigt__p_casadi__SerializingStream,
  &_swigt__p_casadi__SharedObject,
  &_swigt__p_casadi__SharedObjectInternal,
  &_swigt__p_casadi__Slice,
  &_swigt__p_casadi__Sparsity,
  &_swigt__p_casadi__SparsityInterfaceCommon,
  &_swigt__p_casadi__StringDeserializer,
  &_swigt__p_casadi__StringSerializer,
  &_swigt__p_casadi__WeakRef,
  &_swigt__p_casadi__XmlFile,
  &_swigt__p_char,
  &_swigt__p_const_reference,
  &_swigt__p_difference_type,
  &_swigt__p_double,
  &_swigt__p_first_type,
  &_swigt__p_key_type,
  &_swigt__p_long_long,
  &_swigt__p_mapped_type,
  &_swigt__p_p_double,
  &_swigt__p_reference,
  &_swigt__p_second_type,
  &_swigt__p_size_type,
  &_swigt__p_std__initializer_listT_casadi__MX_t,
  &_swigt__p_std__initializer_listT_casadi__MatrixT_casadi__SXElem_t_t,
  &_swigt__p_std__istream,
  &_swigt__p_std__mapT_std__string_casadi__GenericType_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_casadi__GenericType_t_t_t,
  &_swigt__p_std__mapT_std__string_casadi__MX_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_casadi__MX_t_t_t,
  &_swigt__p_std__mapT_std__string_casadi__MatrixT_casadi__SXElem_t_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_casadi__MatrixT_casadi__SXElem_t_t_t_t,
  &_swigt__p_std__mapT_std__string_casadi__MatrixT_double_t_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_casadi__MatrixT_double_t_t_t_t,
  &_swigt__p_std__mapT_std__string_casadi__Sparsity_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_casadi__Sparsity_t_t_t,
  &_swigt__p_std__ostream,
  &_swigt__p_std__pairT_casadi__Slice_casadi__Slice_t,
  &_swigt__p_std__string,
  &_swigt__p_std__vectorT_casadi__Linsol_std__allocatorT_casadi__Linsol_t_t,
  &_swigt__p_std__vectorT_casadi__MX_std__allocatorT_casadi__MX_t_t,
  &_swigt__p_std__vectorT_casadi__MatrixT_casadi__SXElem_t_std__allocatorT_casadi__MatrixT_casadi__SXElem_t_t_t,
  &_swigt__p_std__vectorT_casadi__MatrixT_double_t_std__allocatorT_casadi__MatrixT_double_t_t_t,
  &_swigt__p_std__vectorT_std__vectorT_casadi__MX_std__allocatorT_casadi__MX_t_t_std__allocatorT_std__vectorT_casadi__MX_std__allocatorT_casadi__MX_t_t_t_t,
  &_swigt__p_std__vectorT_std__vectorT_casadi__MatrixT_casadi__SXElem_t_std__allocatorT_casadi__MatrixT_casadi__SXElem_t_t_t_std__allocatorT_std__vectorT_casadi__MatrixT_casadi__SXElem_t_std__allocatorT_casadi__MatrixT_casadi__SXElem_t_t_t_t_t,
  &_swigt__p_std__vectorT_std__vectorT_casadi__MatrixT_double_t_std__allocatorT_casadi__MatrixT_double_t_t_t_std__allocatorT_std__vectorT_casadi__MatrixT_double_t_std__allocatorT_casadi__MatrixT_double_t_t_t_t_t,
  &_swigt__p_swig__MatlabSwigIterator,
  &_swigt__p_value_type,
};

static swig_cast_info _swigc__p_AuxOut[] = {  {&_swigt__p_AuxOut, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Dict[] = {  {&_swigt__p_Dict, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_MXDict[] = {  {&_swigt__p_MXDict, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_allocator_type[] = {  {&_swigt__p_allocator_type, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_casadi__Callback[] = {  {&_swigt__p_casadi__Callback, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_casadi__CasadiMeta[] = {  {&_swigt__p_casadi__CasadiMeta, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_casadi__CodeGenerator[] = {  {&_swigt__p_casadi__CodeGenerator, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_casadi__DaeBuilder[] = {  {&_swigt__p_casadi__DaeBuilder, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_casadi__DeserializerBase[] = {  {&_swigt__p_casadi__DeserializerBase, 0, 0, 0},  {&_swigt__p_casadi__StringDeserializer, _p_casadi__StringDeserializerTo_p_casadi__DeserializerBase, 0, 0},  {&_swigt__p_casadi__FileDeserializer, _p_casadi__FileDeserializerTo_p_casadi__DeserializerBase, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_casadi__DeserializingStream[] = {  {&_swigt__p_casadi__DeserializingStream, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_casadi__FileDeserializer[] = {  {&_swigt__p_casadi__FileDeserializer, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_casadi__FileSerializer[] = {  {&_swigt__p_casadi__FileSerializer, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_casadi__Function[] = {  {&_swigt__p_casadi__Function, 0, 0, 0},  {&_swigt__p_casadi__Callback, _p_casadi__CallbackTo_p_casadi__Function, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_casadi__MatrixT_long_long_t[] = {{&_swigt__p_casadi__MatrixT_long_long_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_casadi__GenericExpressionCommon[] = {  {&_swigt__p_casadi__GenericExpressionCommon, 0, 0, 0},  {&_swigt__p_casadi__MatrixT_double_t, _p_casadi__MatrixT_double_tTo_p_casadi__GenericExpressionCommon, 0, 0},  {&_swigt__p_casadi__MX, _p_casadi__MXTo_p_casadi__GenericExpressionCommon, 0, 0},  {&_swigt__p_casadi__MatrixT_casadi__SXElem_t, _p_casadi__MatrixT_casadi__SXElem_tTo_p_casadi__GenericExpressionCommon, 0, 0},  {&_swigt__p_casadi__MatrixT_long_long_t, _p_casadi__MatrixT_long_long_tTo_p_casadi__GenericExpressionCommon, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_casadi__GenericMatrixCommon[] = {  {&_swigt__p_casadi__GenericMatrixT_casadi__MatrixT_casadi__SXElem_t_t, _p_casadi__GenericMatrixT_casadi__MatrixT_casadi__SXElem_t_tTo_p_casadi__GenericMatrixCommon, 0, 0},  {&_swigt__p_casadi__GenericMatrixT_casadi__MX_t, _p_casadi__GenericMatrixT_casadi__MX_tTo_p_casadi__GenericMatrixCommon, 0, 0},  {&_swigt__p_casadi__GenericMatrixCommon, 0, 0, 0},  {&_swigt__p_casadi__GenericMatrixT_casadi__MatrixT_double_t_t, _p_casadi__GenericMatrixT_casadi__MatrixT_double_t_tTo_p_casadi__GenericMatrixCommon, 0, 0},  {&_swigt__p_casadi__MatrixT_double_t, _p_casadi__MatrixT_double_tTo_p_casadi__GenericMatrixCommon, 0, 0},  {&_swigt__p_casadi__MX, _p_casadi__MXTo_p_casadi__GenericMatrixCommon, 0, 0},  {&_swigt__p_casadi__MatrixT_casadi__SXElem_t, _p_casadi__MatrixT_casadi__SXElem_tTo_p_casadi__GenericMatrixCommon, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_casadi__GenericMatrixT_casadi__MX_t[] = {  {&_swigt__p_casadi__GenericMatrixT_casadi__MX_t, 0, 0, 0},  {&_swigt__p_casadi__MX, _p_casadi__MXTo_p_casadi__GenericMatrixT_casadi__MX_t, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_casadi__GenericMatrixT_casadi__MatrixT_casadi__SXElem_t_t[] = {  {&_swigt__p_casadi__GenericMatrixT_casadi__MatrixT_casadi__SXElem_t_t, 0, 0, 0},  {&_swigt__p_casadi__MatrixT_casadi__SXElem_t, _p_casadi__MatrixT_casadi__SXElem_tTo_p_casadi__GenericMatrixT_casadi__MatrixT_casadi__SXElem_t_t, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_casadi__GenericMatrixT_casadi__MatrixT_double_t_t[] = {  {&_swigt__p_casadi__GenericMatrixT_casadi__MatrixT_double_t_t, 0, 0, 0},  {&_swigt__p_casadi__MatrixT_double_t, _p_casadi__MatrixT_double_tTo_p_casadi__GenericMatrixT_casadi__MatrixT_double_t_t, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_casadi__GenericType[] = {  {&_swigt__p_casadi__GenericType, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_casadi__GlobalOptions[] = {  {&_swigt__p_casadi__GlobalOptions, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_casadi__Importer[] = {  {&_swigt__p_casadi__Importer, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_casadi__IndexAbstraction[] = {  {&_swigt__p_casadi__IndexAbstraction, 0, 0, 0},  {&_swigt__p_casadi__MetaCon, _p_casadi__MetaConTo_p_casadi__IndexAbstraction, 0, 0},  {&_swigt__p_casadi__MetaVar, _p_casadi__MetaVarTo_p_casadi__IndexAbstraction, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_casadi__Linsol[] = {  {&_swigt__p_casadi__Linsol, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_casadi__MX[] = {  {&_swigt__p_casadi__MX, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_casadi__MatrixCommon[] = {  {&_swigt__p_casadi__MatrixCommon, 0, 0, 0},  {&_swigt__p_casadi__MatrixT_double_t, _p_casadi__MatrixT_double_tTo_p_casadi__MatrixCommon, 0, 0},  {&_swigt__p_casadi__MatrixT_casadi__SXElem_t, _p_casadi__MatrixT_casadi__SXElem_tTo_p_casadi__MatrixCommon, 0, 0},  {&_swigt__p_casadi__MatrixT_long_long_t, _p_casadi__MatrixT_long_long_tTo_p_casadi__MatrixCommon, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_casadi__MatrixT_casadi__SXElem_t[] = {  {&_swigt__p_casadi__MatrixT_casadi__SXElem_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_casadi__MatrixT_double_t[] = {  {&_swigt__p_casadi__MatrixT_double_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_casadi__MetaCon[] = {  {&_swigt__p_casadi__MetaCon, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_casadi__MetaVar[] = {  {&_swigt__p_casadi__MetaVar, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_casadi__NlpBuilder[] = {  {&_swigt__p_casadi__NlpBuilder, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_casadi__Opti[] = {  {&_swigt__p_casadi__Opti, 0, 0, 0},  {&_swigt__p_casadi__OptiAdvanced, _p_casadi__OptiAdvancedTo_p_casadi__Opti, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_casadi__OptiAdvanced[] = {  {&_swigt__p_casadi__OptiAdvanced, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_casadi__OptiCallback[] = {  {&_swigt__p_casadi__OptiCallback, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_casadi__OptiSol[] = {  {&_swigt__p_casadi__OptiSol, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_casadi__PrintableCommon[] = {  {&_swigt__p_casadi__MatrixT_long_long_t, _p_casadi__MatrixT_long_long_tTo_p_casadi__PrintableCommon, 0, 0},  {&_swigt__p_casadi__MatrixT_casadi__SXElem_t, _p_casadi__MatrixT_casadi__SXElem_tTo_p_casadi__PrintableCommon, 0, 0},  {&_swigt__p_casadi__Opti, _p_casadi__OptiTo_p_casadi__PrintableCommon, 0, 0},  {&_swigt__p_casadi__MX, _p_casadi__MXTo_p_casadi__PrintableCommon, 0, 0},  {&_swigt__p_casadi__OptiAdvanced, _p_casadi__OptiAdvancedTo_p_casadi__PrintableCommon, 0, 0},  {&_swigt__p_casadi__Slice, _p_casadi__SliceTo_p_casadi__PrintableCommon, 0, 0},  {&_swigt__p_casadi__Sparsity, _p_casadi__SparsityTo_p_casadi__PrintableCommon, 0, 0},  {&_swigt__p_casadi__MatrixT_double_t, _p_casadi__MatrixT_double_tTo_p_casadi__PrintableCommon, 0, 0},  {&_swigt__p_casadi__Function, _p_casadi__FunctionTo_p_casadi__PrintableCommon, 0, 0},  {&_swigt__p_casadi__PrintableCommon, 0, 0, 0},  {&_swigt__p_casadi__Callback, _p_casadi__CallbackTo_p_casadi__PrintableCommon, 0, 0},  {&_swigt__p_casadi__OptiSol, _p_casadi__OptiSolTo_p_casadi__PrintableCommon, 0, 0},  {&_swigt__p_casadi__DaeBuilder, _p_casadi__DaeBuilderTo_p_casadi__PrintableCommon, 0, 0},  {&_swigt__p_casadi__NlpBuilder, _p_casadi__NlpBuilderTo_p_casadi__PrintableCommon, 0, 0},  {&_swigt__p_casadi__Linsol, _p_casadi__LinsolTo_p_casadi__PrintableCommon, 0, 0},  {&_swigt__p_casadi__GenericType, _p_casadi__GenericTypeTo_p_casadi__PrintableCommon, 0, 0},  {&_swigt__p_casadi__Importer, _p_casadi__ImporterTo_p_casadi__PrintableCommon, 0, 0},  {&_swigt__p_casadi__XmlFile, _p_casadi__XmlFileTo_p_casadi__PrintableCommon, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_casadi__SXElem[] = {  {&_swigt__p_casadi__SXElem, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_casadi__SerializerBase[] = {  {&_swigt__p_casadi__SerializerBase, 0, 0, 0},  {&_swigt__p_casadi__StringSerializer, _p_casadi__StringSerializerTo_p_casadi__SerializerBase, 0, 0},  {&_swigt__p_casadi__FileSerializer, _p_casadi__FileSerializerTo_p_casadi__SerializerBase, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_casadi__SerializingStream[] = {  {&_swigt__p_casadi__SerializingStream, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_casadi__SharedObject[] = {  {&_swigt__p_casadi__Linsol, _p_casadi__LinsolTo_p_casadi__SharedObject, 0, 0},  {&_swigt__p_casadi__DaeBuilder, _p_casadi__DaeBuilderTo_p_casadi__SharedObject, 0, 0},  {&_swigt__p_casadi__Function, _p_casadi__FunctionTo_p_casadi__SharedObject, 0, 0},  {&_swigt__p_casadi__SharedObject, 0, 0, 0},  {&_swigt__p_casadi__Importer, _p_casadi__ImporterTo_p_casadi__SharedObject, 0, 0},  {&_swigt__p_casadi__MX, _p_casadi__MXTo_p_casadi__SharedObject, 0, 0},  {&_swigt__p_casadi__Opti, _p_casadi__OptiTo_p_casadi__SharedObject, 0, 0},  {&_swigt__p_casadi__Sparsity, _p_casadi__SparsityTo_p_casadi__SharedObject, 0, 0},  {&_swigt__p_casadi__Callback, _p_casadi__CallbackTo_p_casadi__SharedObject, 0, 0},  {&_swigt__p_casadi__XmlFile, _p_casadi__XmlFileTo_p_casadi__SharedObject, 0, 0},  {&_swigt__p_casadi__OptiAdvanced, _p_casadi__OptiAdvancedTo_p_casadi__SharedObject, 0, 0},  {&_swigt__p_casadi__WeakRef, _p_casadi__WeakRefTo_p_casadi__SharedObject, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_casadi__SharedObjectInternal[] = {  {&_swigt__p_casadi__SharedObjectInternal, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_casadi__Slice[] = {  {&_swigt__p_casadi__Slice, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_casadi__Sparsity[] = {  {&_swigt__p_casadi__Sparsity, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_casadi__SparsityInterfaceCommon[] = {  {&_swigt__p_casadi__GenericMatrixT_casadi__MatrixT_casadi__SXElem_t_t, _p_casadi__GenericMatrixT_casadi__MatrixT_casadi__SXElem_t_tTo_p_casadi__SparsityInterfaceCommon, 0, 0},  {&_swigt__p_casadi__GenericMatrixT_casadi__MX_t, _p_casadi__GenericMatrixT_casadi__MX_tTo_p_casadi__SparsityInterfaceCommon, 0, 0},  {&_swigt__p_casadi__GenericMatrixT_casadi__MatrixT_double_t_t, _p_casadi__GenericMatrixT_casadi__MatrixT_double_t_tTo_p_casadi__SparsityInterfaceCommon, 0, 0},  {&_swigt__p_casadi__MatrixT_double_t, _p_casadi__MatrixT_double_tTo_p_casadi__SparsityInterfaceCommon, 0, 0},  {&_swigt__p_casadi__SparsityInterfaceCommon, 0, 0, 0},  {&_swigt__p_casadi__MX, _p_casadi__MXTo_p_casadi__SparsityInterfaceCommon, 0, 0},  {&_swigt__p_casadi__MatrixT_casadi__SXElem_t, _p_casadi__MatrixT_casadi__SXElem_tTo_p_casadi__SparsityInterfaceCommon, 0, 0},  {&_swigt__p_casadi__Sparsity, _p_casadi__SparsityTo_p_casadi__SparsityInterfaceCommon, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_casadi__StringDeserializer[] = {  {&_swigt__p_casadi__StringDeserializer, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_casadi__StringSerializer[] = {  {&_swigt__p_casadi__StringSerializer, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_casadi__WeakRef[] = {  {&_swigt__p_casadi__WeakRef, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_casadi__XmlFile[] = {  {&_swigt__p_casadi__XmlFile, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_char[] = {  {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_const_reference[] = {  {&_swigt__p_const_reference, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_difference_type[] = {  {&_swigt__p_difference_type, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_double[] = {  {&_swigt__p_double, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_first_type[] = {  {&_swigt__p_first_type, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_key_type[] = {  {&_swigt__p_key_type, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_long_long[] = {  {&_swigt__p_long_long, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_mapped_type[] = {  {&_swigt__p_mapped_type, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_p_double[] = {  {&_swigt__p_p_double, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_reference[] = {  {&_swigt__p_reference, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_second_type[] = {  {&_swigt__p_second_type, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_size_type[] = {  {&_swigt__p_size_type, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_std__initializer_listT_casadi__MX_t[] = {  {&_swigt__p_std__initializer_listT_casadi__MX_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_std__initializer_listT_casadi__MatrixT_casadi__SXElem_t_t[] = {  {&_swigt__p_std__initializer_listT_casadi__MatrixT_casadi__SXElem_t_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_std__istream[] = {  {&_swigt__p_std__istream, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_std__mapT_std__string_casadi__GenericType_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_casadi__GenericType_t_t_t[] = {  {&_swigt__p_std__mapT_std__string_casadi__GenericType_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_casadi__GenericType_t_t_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_std__mapT_std__string_casadi__MX_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_casadi__MX_t_t_t[] = {  {&_swigt__p_std__mapT_std__string_casadi__MX_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_casadi__MX_t_t_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_std__mapT_std__string_casadi__MatrixT_casadi__SXElem_t_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_casadi__MatrixT_casadi__SXElem_t_t_t_t[] = {  {&_swigt__p_std__mapT_std__string_casadi__MatrixT_casadi__SXElem_t_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_casadi__MatrixT_casadi__SXElem_t_t_t_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_std__mapT_std__string_casadi__MatrixT_double_t_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_casadi__MatrixT_double_t_t_t_t[] = {  {&_swigt__p_std__mapT_std__string_casadi__MatrixT_double_t_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_casadi__MatrixT_double_t_t_t_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_std__mapT_std__string_casadi__Sparsity_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_casadi__Sparsity_t_t_t[] = {  {&_swigt__p_std__mapT_std__string_casadi__Sparsity_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_casadi__Sparsity_t_t_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_std__ostream[] = {  {&_swigt__p_std__ostream, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_std__pairT_casadi__Slice_casadi__Slice_t[] = {  {&_swigt__p_std__pairT_casadi__Slice_casadi__Slice_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_std__string[] = {  {&_swigt__p_std__string, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_std__vectorT_casadi__Linsol_std__allocatorT_casadi__Linsol_t_t[] = {  {&_swigt__p_std__vectorT_casadi__Linsol_std__allocatorT_casadi__Linsol_t_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_std__vectorT_casadi__MX_std__allocatorT_casadi__MX_t_t[] = {  {&_swigt__p_std__vectorT_casadi__MX_std__allocatorT_casadi__MX_t_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_std__vectorT_casadi__MatrixT_casadi__SXElem_t_std__allocatorT_casadi__MatrixT_casadi__SXElem_t_t_t[] = {  {&_swigt__p_std__vectorT_casadi__MatrixT_casadi__SXElem_t_std__allocatorT_casadi__MatrixT_casadi__SXElem_t_t_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_std__vectorT_casadi__MatrixT_double_t_std__allocatorT_casadi__MatrixT_double_t_t_t[] = {  {&_swigt__p_std__vectorT_casadi__MatrixT_double_t_std__allocatorT_casadi__MatrixT_double_t_t_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_std__vectorT_std__vectorT_casadi__MX_std__allocatorT_casadi__MX_t_t_std__allocatorT_std__vectorT_casadi__MX_std__allocatorT_casadi__MX_t_t_t_t[] = {  {&_swigt__p_std__vectorT_std__vectorT_casadi__MX_std__allocatorT_casadi__MX_t_t_std__allocatorT_std__vectorT_casadi__MX_std__allocatorT_casadi__MX_t_t_t_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_std__vectorT_std__vectorT_casadi__MatrixT_casadi__SXElem_t_std__allocatorT_casadi__MatrixT_casadi__SXElem_t_t_t_std__allocatorT_std__vectorT_casadi__MatrixT_casadi__SXElem_t_std__allocatorT_casadi__MatrixT_casadi__SXElem_t_t_t_t_t[] = {  {&_swigt__p_std__vectorT_std__vectorT_casadi__MatrixT_casadi__SXElem_t_std__allocatorT_casadi__MatrixT_casadi__SXElem_t_t_t_std__allocatorT_std__vectorT_casadi__MatrixT_casadi__SXElem_t_std__allocatorT_casadi__MatrixT_casadi__SXElem_t_t_t_t_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_std__vectorT_std__vectorT_casadi__MatrixT_double_t_std__allocatorT_casadi__MatrixT_double_t_t_t_std__allocatorT_std__vectorT_casadi__MatrixT_double_t_std__allocatorT_casadi__MatrixT_double_t_t_t_t_t[] = {  {&_swigt__p_std__vectorT_std__vectorT_casadi__MatrixT_double_t_std__allocatorT_casadi__MatrixT_double_t_t_t_std__allocatorT_std__vectorT_casadi__MatrixT_double_t_std__allocatorT_casadi__MatrixT_double_t_t_t_t_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_swig__MatlabSwigIterator[] = {  {&_swigt__p_swig__MatlabSwigIterator, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_value_type[] = {  {&_swigt__p_value_type, 0, 0, 0},{0, 0, 0, 0}};

static swig_cast_info *swig_cast_initial[] = {
  _swigc__p_AuxOut,
  _swigc__p_Dict,
  _swigc__p_MXDict,
  _swigc__p_allocator_type,
  _swigc__p_casadi__Callback,
  _swigc__p_casadi__CasadiMeta,
  _swigc__p_casadi__CodeGenerator,
  _swigc__p_casadi__DaeBuilder,
  _swigc__p_casadi__DeserializerBase,
  _swigc__p_casadi__DeserializingStream,
  _swigc__p_casadi__FileDeserializer,
  _swigc__p_casadi__FileSerializer,
  _swigc__p_casadi__Function,
  _swigc__p_casadi__GenericExpressionCommon,
  _swigc__p_casadi__GenericMatrixCommon,
  _swigc__p_casadi__GenericMatrixT_casadi__MX_t,
  _swigc__p_casadi__GenericMatrixT_casadi__MatrixT_casadi__SXElem_t_t,
  _swigc__p_casadi__GenericMatrixT_casadi__MatrixT_double_t_t,
  _swigc__p_casadi__GenericType,
  _swigc__p_casadi__GlobalOptions,
  _swigc__p_casadi__Importer,
  _swigc__p_casadi__IndexAbstraction,
  _swigc__p_casadi__Linsol,
  _swigc__p_casadi__MX,
  _swigc__p_casadi__MatrixCommon,
  _swigc__p_casadi__MatrixT_casadi__SXElem_t,
  _swigc__p_casadi__MatrixT_double_t,
  _swigc__p_casadi__MatrixT_long_long_t,
  _swigc__p_casadi__MetaCon,
  _swigc__p_casadi__MetaVar,
  _swigc__p_casadi__NlpBuilder,
  _swigc__p_casadi__Opti,
  _swigc__p_casadi__OptiAdvanced,
  _swigc__p_casadi__OptiCallback,
  _swigc__p_casadi__OptiSol,
  _swigc__p_casadi__PrintableCommon,
  _swigc__p_casadi__SXElem,
  _swigc__p_casadi__SerializerBase,
  _swigc__p_casadi__SerializingStream,
  _swigc__p_casadi__SharedObject,
  _swigc__p_casadi__SharedObjectInternal,
  _swigc__p_casadi__Slice,
  _swigc__p_casadi__Sparsity,
  _swigc__p_casadi__SparsityInterfaceCommon,
  _swigc__p_casadi__StringDeserializer,
  _swigc__p_casadi__StringSerializer,
  _swigc__p_casadi__WeakRef,
  _swigc__p_casadi__XmlFile,
  _swigc__p_char,
  _swigc__p_const_reference,
  _swigc__p_difference_type,
  _swigc__p_double,
  _swigc__p_first_type,
  _swigc__p_key_type,
  _swigc__p_long_long,
  _swigc__p_mapped_type,
  _swigc__p_p_double,
  _swigc__p_reference,
  _swigc__p_second_type,
  _swigc__p_size_type,
  _swigc__p_std__initializer_listT_casadi__MX_t,
  _swigc__p_std__initializer_listT_casadi__MatrixT_casadi__SXElem_t_t,
  _swigc__p_std__istream,
  _swigc__p_std__mapT_std__string_casadi__GenericType_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_casadi__GenericType_t_t_t,
  _swigc__p_std__mapT_std__string_casadi__MX_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_casadi__MX_t_t_t,
  _swigc__p_std__mapT_std__string_casadi__MatrixT_casadi__SXElem_t_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_casadi__MatrixT_casadi__SXElem_t_t_t_t,
  _swigc__p_std__mapT_std__string_casadi__MatrixT_double_t_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_casadi__MatrixT_double_t_t_t_t,
  _swigc__p_std__mapT_std__string_casadi__Sparsity_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_casadi__Sparsity_t_t_t,
  _swigc__p_std__ostream,
  _swigc__p_std__pairT_casadi__Slice_casadi__Slice_t,
  _swigc__p_std__string,
  _swigc__p_std__vectorT_casadi__Linsol_std__allocatorT_casadi__Linsol_t_t,
  _swigc__p_std__vectorT_casadi__MX_std__allocatorT_casadi__MX_t_t,
  _swigc__p_std__vectorT_casadi__MatrixT_casadi__SXElem_t_std__allocatorT_casadi__MatrixT_casadi__SXElem_t_t_t,
  _swigc__p_std__vectorT_casadi__MatrixT_double_t_std__allocatorT_casadi__MatrixT_double_t_t_t,
  _swigc__p_std__vectorT_std__vectorT_casadi__MX_std__allocatorT_casadi__MX_t_t_std__allocatorT_std__vectorT_casadi__MX_std__allocatorT_casadi__MX_t_t_t_t,
  _swigc__p_std__vectorT_std__vectorT_casadi__MatrixT_casadi__SXElem_t_std__allocatorT_casadi__MatrixT_casadi__SXElem_t_t_t_std__allocatorT_std__vectorT_casadi__MatrixT_casadi__SXElem_t_std__allocatorT_casadi__MatrixT_casadi__SXElem_t_t_t_t_t,
  _swigc__p_std__vectorT_std__vectorT_casadi__MatrixT_double_t_std__allocatorT_casadi__MatrixT_double_t_t_t_std__allocatorT_std__vectorT_casadi__MatrixT_double_t_std__allocatorT_casadi__MatrixT_double_t_t_t_t_t,
  _swigc__p_swig__MatlabSwigIterator,
  _swigc__p_value_type,
};


/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */

/* -----------------------------------------------------------------------------
 * Type initialization:
 * This problem is tough by the requirement that no dynamic
 * memory is used. Also, since swig_type_info structures store pointers to
 * swig_cast_info structures and swig_cast_info structures store pointers back
 * to swig_type_info structures, we need some lookup code at initialization.
 * The idea is that swig generates all the structures that are needed.
 * The runtime then collects these partially filled structures.
 * The SWIG_InitializeModule function takes these initial arrays out of
 * swig_module, and does all the lookup, filling in the swig_module.types
 * array with the correct data and linking the correct swig_cast_info
 * structures together.
 *
 * The generated swig_type_info structures are assigned statically to an initial
 * array. We just loop through that array, and handle each type individually.
 * First we lookup if this type has been already loaded, and if so, use the
 * loaded structure instead of the generated one. Then we have to fill in the
 * cast linked list. The cast data is initially stored in something like a
 * two-dimensional array. Each row corresponds to a type (there are the same
 * number of rows as there are in the swig_type_initial array). Each entry in
 * a column is one of the swig_cast_info structures for that type.
 * The cast_initial array is actually an array of arrays, because each row has
 * a variable number of columns. So to actually build the cast linked list,
 * we find the array of casts associated with the type, and loop through it
 * adding the casts to the list. The one last trick we need to do is making
 * sure the type pointer in the swig_cast_info struct is correct.
 *
 * First off, we lookup the cast->type name to see if it is already loaded.
 * There are three cases to handle:
 *  1) If the cast->type has already been loaded AND the type we are adding
 *     casting info to has not been loaded (it is in this module), THEN we
 *     replace the cast->type pointer with the type pointer that has already
 *     been loaded.
 *  2) If BOTH types (the one we are adding casting info to, and the
 *     cast->type) are loaded, THEN the cast info has already been loaded by
 *     the previous module so we just ignore it.
 *  3) Finally, if cast->type has not already been loaded, then we add that
 *     swig_cast_info to the linked list (because the cast->type) pointer will
 *     be correct.
 * ----------------------------------------------------------------------------- */

#ifdef __cplusplus
extern "C" {
#if 0
} /* c-mode */
#endif
#endif

#if 0
#define SWIGRUNTIME_DEBUG
#endif


SWIGRUNTIME void
SWIG_InitializeModule(void *clientdata) {
  size_t i;
  swig_module_info *module_head, *iter;
  int init;

  /* check to see if the circular list has been setup, if not, set it up */
  if (swig_module.next==0) {
    /* Initialize the swig_module */
    swig_module.type_initial = swig_type_initial;
    swig_module.cast_initial = swig_cast_initial;
    swig_module.next = &swig_module;
    init = 1;
  } else {
    init = 0;
  }

  /* Try and load any already created modules */
  module_head = SWIG_GetModule(clientdata);
  if (!module_head) {
    /* This is the first module loaded for this interpreter */
    /* so set the swig module into the interpreter */
    SWIG_SetModule(clientdata, &swig_module);
  } else {
    /* the interpreter has loaded a SWIG module, but has it loaded this one? */
    iter=module_head;
    do {
      if (iter==&swig_module) {
        /* Our module is already in the list, so there's nothing more to do. */
        return;
      }
      iter=iter->next;
    } while (iter!= module_head);

    /* otherwise we must add our module into the list */
    swig_module.next = module_head->next;
    module_head->next = &swig_module;
  }

  /* When multiple interpreters are used, a module could have already been initialized in
     a different interpreter, but not yet have a pointer in this interpreter.
     In this case, we do not want to continue adding types... everything should be
     set up already */
  if (init == 0) return;

  /* Now work on filling in swig_module.types */
#ifdef SWIGRUNTIME_DEBUG
  printf("SWIG_InitializeModule: size %d\n", swig_module.size);
#endif
  for (i = 0; i < swig_module.size; ++i) {
    swig_type_info *type = 0;
    swig_type_info *ret;
    swig_cast_info *cast;

#ifdef SWIGRUNTIME_DEBUG
    printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
#endif

    /* if there is another module already loaded */
    if (swig_module.next != &swig_module) {
      type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
    }
    if (type) {
      /* Overwrite clientdata field */
#ifdef SWIGRUNTIME_DEBUG
      printf("SWIG_InitializeModule: found type %s\n", type->name);
#endif
      if (swig_module.type_initial[i]->clientdata) {
	type->clientdata = swig_module.type_initial[i]->clientdata;
#ifdef SWIGRUNTIME_DEBUG
      printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
#endif
      }
    } else {
      type = swig_module.type_initial[i];
    }

    /* Insert casting types */
    cast = swig_module.cast_initial[i];
    while (cast->type) {

      /* Don't need to add information already in the list */
      ret = 0;
#ifdef SWIGRUNTIME_DEBUG
      printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
#endif
      if (swig_module.next != &swig_module) {
        ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
#ifdef SWIGRUNTIME_DEBUG
	if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
#endif
      }
      if (ret) {
	if (type == swig_module.type_initial[i]) {
#ifdef SWIGRUNTIME_DEBUG
	  printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
#endif
	  cast->type = ret;
	  ret = 0;
	} else {
	  /* Check for casting already in the list */
	  swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
#ifdef SWIGRUNTIME_DEBUG
	  if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
#endif
	  if (!ocast) ret = 0;
	}
      }

      if (!ret) {
#ifdef SWIGRUNTIME_DEBUG
	printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
#endif
        if (type->cast) {
          type->cast->prev = cast;
          cast->next = type->cast;
        }
        type->cast = cast;
      }
      cast++;
    }
    /* Set entry in modules->types array equal to the type */
    swig_module.types[i] = type;
  }
  swig_module.types[i] = 0;

#ifdef SWIGRUNTIME_DEBUG
  printf("**** SWIG_InitializeModule: Cast List ******\n");
  for (i = 0; i < swig_module.size; ++i) {
    int j = 0;
    swig_cast_info *cast = swig_module.cast_initial[i];
    printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
    while (cast->type) {
      printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
      cast++;
      ++j;
    }
  printf("---- Total casts: %d\n",j);
  }
  printf("**** SWIG_InitializeModule: Cast List ******\n");
#endif
}

/* This function will propagate the clientdata field of type to
* any new swig_type_info structures that have been added into the list
* of equivalent types.  It is like calling
* SWIG_TypeClientData(type, clientdata) a second time.
*/
SWIGRUNTIME void
SWIG_PropagateClientData(void) {
  size_t i;
  swig_cast_info *equiv;
  static int init_run = 0;

  if (init_run) return;
  init_run = 1;

  for (i = 0; i < swig_module.size; i++) {
    if (swig_module.types[i]->clientdata) {
      equiv = swig_module.types[i]->cast;
      while (equiv) {
        if (!equiv->converter) {
          if (equiv->type && !equiv->type->clientdata)
            SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
        }
        equiv = equiv->next;
      }
    }
  }
}

#ifdef __cplusplus
#if 0
{ /* c-mode */
#endif
}
#endif


void SWIG_Matlab_LoadModule() {
  /* Only call once */
  static int moduleIsLoaded = 0;
  if (moduleIsLoaded) return;
  moduleIsLoaded = 1;

  /* Prevent unloading this file until MATLAB exits */
  mexLock();

  /* Exit function (called when unloaded) */
  mexAtExit(SWIG_Matlab_ExitFcn);

  /* Load dependent modules and initialize */


// Get full path
mxArray *fullpath, *fullpath_cmd = mxCreateString("fullpath");
mexCallMATLAB(1, &fullpath, 1, &fullpath_cmd, "mfilename");
mxDestroyArray(fullpath_cmd);
std::string path = mxArrayToString(fullpath);
mxDestroyArray(fullpath);

// Get file separator
mxArray *filesep;
mexCallMATLAB(1, &filesep, 0, 0, "filesep");
std::string sep = mxArrayToString(filesep);
mxDestroyArray(filesep);

// Truncate at separator
path = path.substr(0, path.rfind(sep));

// Octave-on-Windows seems to pick up superfluous +casadi
// Make sure we exclude it
if (path.rfind(sep)!=std::string::npos && path.substr(path.rfind(sep)+1)=="+casadi")
path = path.substr(0, path.rfind(sep));

// Set library path
casadi::GlobalOptions::setCasadiPath(path);
casadi::GlobalOptions::setCasadiIncludePath(path+sep+"include");

// Matlab is index-one based
casadi::GlobalOptions::start_index = 1;

// @jgillis: please document
mxArray *warning_rhs[] = {
  mxCreateString("error"),
  
  mxCreateString("SWIG:OverloadError")
};
mexCallMATLAB(0, 0, 2, warning_rhs, "warning");
mxDestroyArray(warning_rhs[0]);
mxDestroyArray(warning_rhs[1]);


// Set logger functions
casadi::Logger::writeFun = casadi::mexlogger;
casadi::Logger::flush = casadi::mexflush;

// @jgillis: please document
casadi::InterruptHandler::checkInterrupted = casadi::mexcheckinterrupted;
casadi::InterruptHandler::clearInterrupted = casadi::mexclearinterrupted;

casadi::InterruptHandler::is_main_thread();


SWIG_InitializeModule(0);

}


SWIGINTERN const char* SwigConstantName(int con_id) {
  switch (con_id) {
  case 0: return "CASADI_INT_TYPE_STR";
  case 1: return "SOLVER_RET_SUCCESS";
  case 2: return "SOLVER_RET_UNKNOWN";
  case 3: return "SOLVER_RET_LIMITED";
  case 4: return "SOLVER_RET_NAN";
  case 5: return "SOLVER_RET_INFEASIBLE";
  case 6: return "MNAME";
  case 7: return "L_INT";
  case 8: return "L_BOOL";
  case 9: return "L_DOUBLE";
  case 10: return "L_DICT";
  case 11: return "LL";
  case 12: return "LR";
  case 13: return "L_STR";
  case 14: return "LABEL";
  case 15: return "SWIG_IND1";
  case 16: return "OP_ASSIGN";
  case 17: return "OP_ADD";
  case 18: return "OP_SUB";
  case 19: return "OP_MUL";
  case 20: return "OP_DIV";
  case 21: return "OP_NEG";
  case 22: return "OP_EXP";
  case 23: return "OP_LOG";
  case 24: return "OP_POW";
  case 25: return "OP_CONSTPOW";
  case 26: return "OP_SQRT";
  case 27: return "OP_SQ";
  case 28: return "OP_TWICE";
  case 29: return "OP_SIN";
  case 30: return "OP_COS";
  case 31: return "OP_TAN";
  case 32: return "OP_ASIN";
  case 33: return "OP_ACOS";
  case 34: return "OP_ATAN";
  case 35: return "OP_LT";
  case 36: return "OP_LE";
  case 37: return "OP_EQ";
  case 38: return "OP_NE";
  case 39: return "OP_NOT";
  case 40: return "OP_AND";
  case 41: return "OP_OR";
  case 42: return "OP_FLOOR";
  case 43: return "OP_CEIL";
  case 44: return "OP_FMOD";
  case 45: return "OP_FABS";
  case 46: return "OP_SIGN";
  case 47: return "OP_COPYSIGN";
  case 48: return "OP_IF_ELSE_ZERO";
  case 49: return "OP_ERF";
  case 50: return "OP_FMIN";
  case 51: return "OP_FMAX";
  case 52: return "OP_INV";
  case 53: return "OP_SINH";
  case 54: return "OP_COSH";
  case 55: return "OP_TANH";
  case 56: return "OP_ASINH";
  case 57: return "OP_ACOSH";
  case 58: return "OP_ATANH";
  case 59: return "OP_ATAN2";
  case 60: return "OP_CONST";
  case 61: return "OP_INPUT";
  case 62: return "OP_OUTPUT";
  case 63: return "OP_PARAMETER";
  case 64: return "OP_CALL";
  case 65: return "OP_FIND";
  case 66: return "OP_LOW";
  case 67: return "OP_MAP";
  case 68: return "OP_MTIMES";
  case 69: return "OP_SOLVE";
  case 70: return "OP_TRANSPOSE";
  case 71: return "OP_DETERMINANT";
  case 72: return "OP_INVERSE";
  case 73: return "OP_DOT";
  case 74: return "OP_BILIN";
  case 75: return "OP_RANK1";
  case 76: return "OP_HORZCAT";
  case 77: return "OP_VERTCAT";
  case 78: return "OP_DIAGCAT";
  case 79: return "OP_HORZSPLIT";
  case 80: return "OP_VERTSPLIT";
  case 81: return "OP_DIAGSPLIT";
  case 82: return "OP_RESHAPE";
  case 83: return "OP_SUBREF";
  case 84: return "OP_SUBASSIGN";
  case 85: return "OP_GETNONZEROS";
  case 86: return "OP_GETNONZEROS_PARAM";
  case 87: return "OP_ADDNONZEROS";
  case 88: return "OP_ADDNONZEROS_PARAM";
  case 89: return "OP_SETNONZEROS";
  case 90: return "OP_SETNONZEROS_PARAM";
  case 91: return "OP_PROJECT";
  case 92: return "OP_ASSERTION";
  case 93: return "OP_MONITOR";
  case 94: return "OP_NORM2";
  case 95: return "OP_NORM1";
  case 96: return "OP_NORMINF";
  case 97: return "OP_NORMF";
  case 98: return "OP_MMIN";
  case 99: return "OP_MMAX";
  case 100: return "OP_HORZREPMAT";
  case 101: return "OP_HORZREPSUM";
  case 102: return "OP_ERFINV";
  case 103: return "OP_PRINTME";
  case 104: return "OP_LIFT";
  case 105: return "OP_EINSTEIN";
  case 106: return "OP_BSPLINE";
  case 107: return "OP_CONVEXIFY";
  case 108: return "OP_SPARSITY_CAST";
  case 109: return "OP_LOG1P";
  case 110: return "OP_EXPM1";
  case 111: return "OP_HYPOT";
  case 112: return "OP_LOGSUMEXP";
  case 113: return "OP_REMAINDER";
  case 114: return "IS_GLOBAL";
  case 115: return "IS_MEMBER";
  case 116: return "IS_SPARSITY";
  case 117: return "IS_DMATRIX";
  case 118: return "IS_IMATRIX";
  case 119: return "IS_SX";
  case 120: return "IS_MX";
  case 121: return "IS_DOUBLE";
  case 122: return "FLAG";
  case 123: return "LEGENDRE";
  case 124: return "RADAU";
  case 125: return "SerializerBase_internal_SERIALIZED_SPARSITY";
  case 126: return "SerializerBase_internal_SERIALIZED_MX";
  case 127: return "SerializerBase_internal_SERIALIZED_DM";
  case 128: return "SerializerBase_internal_SERIALIZED_SX";
  case 129: return "SerializerBase_internal_SERIALIZED_LINSOL";
  case 130: return "SerializerBase_internal_SERIALIZED_FUNCTION";
  case 131: return "SerializerBase_internal_SERIALIZED_GENERICTYPE";
  case 132: return "SerializerBase_internal_SERIALIZED_INT";
  case 133: return "SerializerBase_internal_SERIALIZED_DOUBLE";
  case 134: return "SerializerBase_internal_SERIALIZED_STRING";
  case 135: return "SerializerBase_internal_SERIALIZED_SPARSITY_VECTOR";
  case 136: return "SerializerBase_internal_SERIALIZED_MX_VECTOR";
  case 137: return "SerializerBase_internal_SERIALIZED_DM_VECTOR";
  case 138: return "SerializerBase_internal_SERIALIZED_SX_VECTOR";
  case 139: return "SerializerBase_internal_SERIALIZED_LINSOL_VECTOR";
  case 140: return "SerializerBase_internal_SERIALIZED_FUNCTION_VECTOR";
  case 141: return "SerializerBase_internal_SERIALIZED_GENERICTYPE_VECTOR";
  case 142: return "SerializerBase_internal_SERIALIZED_INT_VECTOR";
  case 143: return "SerializerBase_internal_SERIALIZED_DOUBLE_VECTOR";
  case 144: return "SerializerBase_internal_SERIALIZED_STRING_VECTOR";
  case 145: return "OPTI_GENERIC_EQUALITY";
  case 146: return "OPTI_GENERIC_INEQUALITY";
  case 147: return "OPTI_EQUALITY";
  case 148: return "OPTI_INEQUALITY";
  case 149: return "OPTI_DOUBLE_INEQUALITY";
  case 150: return "OPTI_PSD";
  case 151: return "OPTI_UNKNOWN";
  case 152: return "OPTI_VAR";
  case 153: return "OPTI_PAR";
  case 154: return "OPTI_DUAL_G";
  default: return 0;
  }
}

SWIGINTERN int swigConstantName(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc!=1 || !mxIsDouble(*argv) || mxGetNumberOfElements(*argv)!=1) {
    SWIG_Error(SWIG_RuntimeError, "This mex file should only be called from inside the .m files generated by SWIG. The input should be the constant ID.");
    return 1;
  }
  if (resc!=1) {
    SWIG_Error(SWIG_RuntimeError, "The function should have one output.");
    return 1;
  }
  int con_id = (int)mxGetScalar(*argv);
  const char* s = SwigConstantName(con_id);
  if (s==0) {
    SWIG_Error(SWIG_RuntimeError, "No such constant ID.");
    return 1;
  }
  *resv = mxCreateString(s);
  return 0;
}

SWIGINTERN int swigConstant(int SWIGUNUSEDPARM(resc), mxArray *resv[], int argc, mxArray *argv[]) {
  if (--argc < 0 || !mxIsDouble(*argv) || mxGetNumberOfElements(*argv)!=1) {
    SWIG_Error(SWIG_RuntimeError, "This function should only be called from inside the .m files generated by SWIG. First input should be the constant ID .");
    return 1;
  }
  int con_id = (int)mxGetScalar(*argv++);
  switch (con_id) {
  case 0: *resv = SWIG_Matlab_SetConstant(module_ns,"CASADI_INT_TYPE_STR",SWIG_FromCharPtr("long long int"));; break;
  case 1: *resv = SWIG_Matlab_SetConstant(module_ns,"SOLVER_RET_SUCCESS",SWIG_From_int(static_cast< int >(casadi::SOLVER_RET_SUCCESS)));; break;
  case 2: *resv = SWIG_Matlab_SetConstant(module_ns,"SOLVER_RET_UNKNOWN",SWIG_From_int(static_cast< int >(casadi::SOLVER_RET_UNKNOWN)));; break;
  case 3: *resv = SWIG_Matlab_SetConstant(module_ns,"SOLVER_RET_LIMITED",SWIG_From_int(static_cast< int >(casadi::SOLVER_RET_LIMITED)));; break;
  case 4: *resv = SWIG_Matlab_SetConstant(module_ns,"SOLVER_RET_NAN",SWIG_From_int(static_cast< int >(casadi::SOLVER_RET_NAN)));; break;
  case 5: *resv = SWIG_Matlab_SetConstant(module_ns,"SOLVER_RET_INFEASIBLE",SWIG_From_int(static_cast< int >(casadi::SOLVER_RET_INFEASIBLE)));; break;
  case 6: *resv = SWIG_Matlab_SetConstant(module_ns,"MNAME",SWIG_FromCharPtr("$NAME"));; break;
  case 7: *resv = SWIG_Matlab_SetConstant(module_ns,"L_INT",SWIG_FromCharPtr("int"));; break;
  case 8: *resv = SWIG_Matlab_SetConstant(module_ns,"L_BOOL",SWIG_FromCharPtr("bool"));; break;
  case 9: *resv = SWIG_Matlab_SetConstant(module_ns,"L_DOUBLE",SWIG_FromCharPtr("double"));; break;
  case 10: *resv = SWIG_Matlab_SetConstant(module_ns,"L_DICT",SWIG_FromCharPtr("struct"));; break;
  case 11: *resv = SWIG_Matlab_SetConstant(module_ns,"LL",SWIG_FromCharPtr("{"));; break;
  case 12: *resv = SWIG_Matlab_SetConstant(module_ns,"LR",SWIG_FromCharPtr("}"));; break;
  case 13: *resv = SWIG_Matlab_SetConstant(module_ns,"L_STR",SWIG_FromCharPtr("char"));; break;
  case 14: *resv = SWIG_Matlab_SetConstant(module_ns,"LABEL",SWIG_FromCharPtr("[int,int]"));; break;
  case 15: *resv = SWIG_Matlab_SetConstant(module_ns,"SWIG_IND1",SWIG_From_bool(static_cast< bool >(true)));; break;
  case 16: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_ASSIGN",SWIG_From_int(static_cast< int >(casadi::OP_ASSIGN)));; break;
  case 17: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_ADD",SWIG_From_int(static_cast< int >(casadi::OP_ADD)));; break;
  case 18: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_SUB",SWIG_From_int(static_cast< int >(casadi::OP_SUB)));; break;
  case 19: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_MUL",SWIG_From_int(static_cast< int >(casadi::OP_MUL)));; break;
  case 20: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_DIV",SWIG_From_int(static_cast< int >(casadi::OP_DIV)));; break;
  case 21: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_NEG",SWIG_From_int(static_cast< int >(casadi::OP_NEG)));; break;
  case 22: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_EXP",SWIG_From_int(static_cast< int >(casadi::OP_EXP)));; break;
  case 23: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_LOG",SWIG_From_int(static_cast< int >(casadi::OP_LOG)));; break;
  case 24: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_POW",SWIG_From_int(static_cast< int >(casadi::OP_POW)));; break;
  case 25: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_CONSTPOW",SWIG_From_int(static_cast< int >(casadi::OP_CONSTPOW)));; break;
  case 26: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_SQRT",SWIG_From_int(static_cast< int >(casadi::OP_SQRT)));; break;
  case 27: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_SQ",SWIG_From_int(static_cast< int >(casadi::OP_SQ)));; break;
  case 28: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_TWICE",SWIG_From_int(static_cast< int >(casadi::OP_TWICE)));; break;
  case 29: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_SIN",SWIG_From_int(static_cast< int >(casadi::OP_SIN)));; break;
  case 30: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_COS",SWIG_From_int(static_cast< int >(casadi::OP_COS)));; break;
  case 31: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_TAN",SWIG_From_int(static_cast< int >(casadi::OP_TAN)));; break;
  case 32: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_ASIN",SWIG_From_int(static_cast< int >(casadi::OP_ASIN)));; break;
  case 33: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_ACOS",SWIG_From_int(static_cast< int >(casadi::OP_ACOS)));; break;
  case 34: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_ATAN",SWIG_From_int(static_cast< int >(casadi::OP_ATAN)));; break;
  case 35: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_LT",SWIG_From_int(static_cast< int >(casadi::OP_LT)));; break;
  case 36: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_LE",SWIG_From_int(static_cast< int >(casadi::OP_LE)));; break;
  case 37: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_EQ",SWIG_From_int(static_cast< int >(casadi::OP_EQ)));; break;
  case 38: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_NE",SWIG_From_int(static_cast< int >(casadi::OP_NE)));; break;
  case 39: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_NOT",SWIG_From_int(static_cast< int >(casadi::OP_NOT)));; break;
  case 40: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_AND",SWIG_From_int(static_cast< int >(casadi::OP_AND)));; break;
  case 41: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_OR",SWIG_From_int(static_cast< int >(casadi::OP_OR)));; break;
  case 42: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_FLOOR",SWIG_From_int(static_cast< int >(casadi::OP_FLOOR)));; break;
  case 43: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_CEIL",SWIG_From_int(static_cast< int >(casadi::OP_CEIL)));; break;
  case 44: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_FMOD",SWIG_From_int(static_cast< int >(casadi::OP_FMOD)));; break;
  case 45: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_FABS",SWIG_From_int(static_cast< int >(casadi::OP_FABS)));; break;
  case 46: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_SIGN",SWIG_From_int(static_cast< int >(casadi::OP_SIGN)));; break;
  case 47: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_COPYSIGN",SWIG_From_int(static_cast< int >(casadi::OP_COPYSIGN)));; break;
  case 48: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_IF_ELSE_ZERO",SWIG_From_int(static_cast< int >(casadi::OP_IF_ELSE_ZERO)));; break;
  case 49: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_ERF",SWIG_From_int(static_cast< int >(casadi::OP_ERF)));; break;
  case 50: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_FMIN",SWIG_From_int(static_cast< int >(casadi::OP_FMIN)));; break;
  case 51: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_FMAX",SWIG_From_int(static_cast< int >(casadi::OP_FMAX)));; break;
  case 52: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_INV",SWIG_From_int(static_cast< int >(casadi::OP_INV)));; break;
  case 53: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_SINH",SWIG_From_int(static_cast< int >(casadi::OP_SINH)));; break;
  case 54: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_COSH",SWIG_From_int(static_cast< int >(casadi::OP_COSH)));; break;
  case 55: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_TANH",SWIG_From_int(static_cast< int >(casadi::OP_TANH)));; break;
  case 56: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_ASINH",SWIG_From_int(static_cast< int >(casadi::OP_ASINH)));; break;
  case 57: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_ACOSH",SWIG_From_int(static_cast< int >(casadi::OP_ACOSH)));; break;
  case 58: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_ATANH",SWIG_From_int(static_cast< int >(casadi::OP_ATANH)));; break;
  case 59: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_ATAN2",SWIG_From_int(static_cast< int >(casadi::OP_ATAN2)));; break;
  case 60: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_CONST",SWIG_From_int(static_cast< int >(casadi::OP_CONST)));; break;
  case 61: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_INPUT",SWIG_From_int(static_cast< int >(casadi::OP_INPUT)));; break;
  case 62: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_OUTPUT",SWIG_From_int(static_cast< int >(casadi::OP_OUTPUT)));; break;
  case 63: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_PARAMETER",SWIG_From_int(static_cast< int >(casadi::OP_PARAMETER)));; break;
  case 64: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_CALL",SWIG_From_int(static_cast< int >(casadi::OP_CALL)));; break;
  case 65: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_FIND",SWIG_From_int(static_cast< int >(casadi::OP_FIND)));; break;
  case 66: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_LOW",SWIG_From_int(static_cast< int >(casadi::OP_LOW)));; break;
  case 67: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_MAP",SWIG_From_int(static_cast< int >(casadi::OP_MAP)));; break;
  case 68: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_MTIMES",SWIG_From_int(static_cast< int >(casadi::OP_MTIMES)));; break;
  case 69: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_SOLVE",SWIG_From_int(static_cast< int >(casadi::OP_SOLVE)));; break;
  case 70: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_TRANSPOSE",SWIG_From_int(static_cast< int >(casadi::OP_TRANSPOSE)));; break;
  case 71: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_DETERMINANT",SWIG_From_int(static_cast< int >(casadi::OP_DETERMINANT)));; break;
  case 72: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_INVERSE",SWIG_From_int(static_cast< int >(casadi::OP_INVERSE)));; break;
  case 73: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_DOT",SWIG_From_int(static_cast< int >(casadi::OP_DOT)));; break;
  case 74: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_BILIN",SWIG_From_int(static_cast< int >(casadi::OP_BILIN)));; break;
  case 75: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_RANK1",SWIG_From_int(static_cast< int >(casadi::OP_RANK1)));; break;
  case 76: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_HORZCAT",SWIG_From_int(static_cast< int >(casadi::OP_HORZCAT)));; break;
  case 77: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_VERTCAT",SWIG_From_int(static_cast< int >(casadi::OP_VERTCAT)));; break;
  case 78: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_DIAGCAT",SWIG_From_int(static_cast< int >(casadi::OP_DIAGCAT)));; break;
  case 79: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_HORZSPLIT",SWIG_From_int(static_cast< int >(casadi::OP_HORZSPLIT)));; break;
  case 80: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_VERTSPLIT",SWIG_From_int(static_cast< int >(casadi::OP_VERTSPLIT)));; break;
  case 81: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_DIAGSPLIT",SWIG_From_int(static_cast< int >(casadi::OP_DIAGSPLIT)));; break;
  case 82: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_RESHAPE",SWIG_From_int(static_cast< int >(casadi::OP_RESHAPE)));; break;
  case 83: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_SUBREF",SWIG_From_int(static_cast< int >(casadi::OP_SUBREF)));; break;
  case 84: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_SUBASSIGN",SWIG_From_int(static_cast< int >(casadi::OP_SUBASSIGN)));; break;
  case 85: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_GETNONZEROS",SWIG_From_int(static_cast< int >(casadi::OP_GETNONZEROS)));; break;
  case 86: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_GETNONZEROS_PARAM",SWIG_From_int(static_cast< int >(casadi::OP_GETNONZEROS_PARAM)));; break;
  case 87: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_ADDNONZEROS",SWIG_From_int(static_cast< int >(casadi::OP_ADDNONZEROS)));; break;
  case 88: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_ADDNONZEROS_PARAM",SWIG_From_int(static_cast< int >(casadi::OP_ADDNONZEROS_PARAM)));; break;
  case 89: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_SETNONZEROS",SWIG_From_int(static_cast< int >(casadi::OP_SETNONZEROS)));; break;
  case 90: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_SETNONZEROS_PARAM",SWIG_From_int(static_cast< int >(casadi::OP_SETNONZEROS_PARAM)));; break;
  case 91: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_PROJECT",SWIG_From_int(static_cast< int >(casadi::OP_PROJECT)));; break;
  case 92: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_ASSERTION",SWIG_From_int(static_cast< int >(casadi::OP_ASSERTION)));; break;
  case 93: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_MONITOR",SWIG_From_int(static_cast< int >(casadi::OP_MONITOR)));; break;
  case 94: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_NORM2",SWIG_From_int(static_cast< int >(casadi::OP_NORM2)));; break;
  case 95: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_NORM1",SWIG_From_int(static_cast< int >(casadi::OP_NORM1)));; break;
  case 96: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_NORMINF",SWIG_From_int(static_cast< int >(casadi::OP_NORMINF)));; break;
  case 97: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_NORMF",SWIG_From_int(static_cast< int >(casadi::OP_NORMF)));; break;
  case 98: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_MMIN",SWIG_From_int(static_cast< int >(casadi::OP_MMIN)));; break;
  case 99: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_MMAX",SWIG_From_int(static_cast< int >(casadi::OP_MMAX)));; break;
  case 100: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_HORZREPMAT",SWIG_From_int(static_cast< int >(casadi::OP_HORZREPMAT)));; break;
  case 101: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_HORZREPSUM",SWIG_From_int(static_cast< int >(casadi::OP_HORZREPSUM)));; break;
  case 102: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_ERFINV",SWIG_From_int(static_cast< int >(casadi::OP_ERFINV)));; break;
  case 103: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_PRINTME",SWIG_From_int(static_cast< int >(casadi::OP_PRINTME)));; break;
  case 104: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_LIFT",SWIG_From_int(static_cast< int >(casadi::OP_LIFT)));; break;
  case 105: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_EINSTEIN",SWIG_From_int(static_cast< int >(casadi::OP_EINSTEIN)));; break;
  case 106: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_BSPLINE",SWIG_From_int(static_cast< int >(casadi::OP_BSPLINE)));; break;
  case 107: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_CONVEXIFY",SWIG_From_int(static_cast< int >(casadi::OP_CONVEXIFY)));; break;
  case 108: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_SPARSITY_CAST",SWIG_From_int(static_cast< int >(casadi::OP_SPARSITY_CAST)));; break;
  case 109: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_LOG1P",SWIG_From_int(static_cast< int >(casadi::OP_LOG1P)));; break;
  case 110: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_EXPM1",SWIG_From_int(static_cast< int >(casadi::OP_EXPM1)));; break;
  case 111: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_HYPOT",SWIG_From_int(static_cast< int >(casadi::OP_HYPOT)));; break;
  case 112: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_LOGSUMEXP",SWIG_From_int(static_cast< int >(casadi::OP_LOGSUMEXP)));; break;
  case 113: *resv = SWIG_Matlab_SetConstant(module_ns,"OP_REMAINDER",SWIG_From_int(static_cast< int >(casadi::OP_REMAINDER)));; break;
  case 114: *resv = SWIG_Matlab_SetConstant(module_ns,"IS_GLOBAL",SWIG_From_int(static_cast< int >(0x1)));; break;
  case 115: *resv = SWIG_Matlab_SetConstant(module_ns,"IS_MEMBER",SWIG_From_int(static_cast< int >(0x10)));; break;
  case 116: *resv = SWIG_Matlab_SetConstant(module_ns,"IS_SPARSITY",SWIG_From_int(static_cast< int >(0x100)));; break;
  case 117: *resv = SWIG_Matlab_SetConstant(module_ns,"IS_DMATRIX",SWIG_From_int(static_cast< int >(0x1000)));; break;
  case 118: *resv = SWIG_Matlab_SetConstant(module_ns,"IS_IMATRIX",SWIG_From_int(static_cast< int >(0x10000)));; break;
  case 119: *resv = SWIG_Matlab_SetConstant(module_ns,"IS_SX",SWIG_From_int(static_cast< int >(0x100000)));; break;
  case 120: *resv = SWIG_Matlab_SetConstant(module_ns,"IS_MX",SWIG_From_int(static_cast< int >(0x1000000)));; break;
  case 121: *resv = SWIG_Matlab_SetConstant(module_ns,"IS_DOUBLE",SWIG_From_int(static_cast< int >(0x10000000)));; break;
  case 122: *resv = SWIG_Matlab_SetConstant(module_ns,"FLAG",SWIG_From_int(static_cast< int >(0x1)));; break;
  case 123: *resv = SWIG_Matlab_SetConstant(module_ns,"LEGENDRE",SWIG_From_int(static_cast< int >(casadi::LEGENDRE)));; break;
  case 124: *resv = SWIG_Matlab_SetConstant(module_ns,"RADAU",SWIG_From_int(static_cast< int >(casadi::RADAU)));; break;
  case 125: *resv = SWIG_Matlab_SetConstant(module_ns,"SerializerBase_internal_SERIALIZED_SPARSITY",SWIG_From_int(static_cast< int >(casadi::SerializerBase::SERIALIZED_SPARSITY)));; break;
  case 126: *resv = SWIG_Matlab_SetConstant(module_ns,"SerializerBase_internal_SERIALIZED_MX",SWIG_From_int(static_cast< int >(casadi::SerializerBase::SERIALIZED_MX)));; break;
  case 127: *resv = SWIG_Matlab_SetConstant(module_ns,"SerializerBase_internal_SERIALIZED_DM",SWIG_From_int(static_cast< int >(casadi::SerializerBase::SERIALIZED_DM)));; break;
  case 128: *resv = SWIG_Matlab_SetConstant(module_ns,"SerializerBase_internal_SERIALIZED_SX",SWIG_From_int(static_cast< int >(casadi::SerializerBase::SERIALIZED_SX)));; break;
  case 129: *resv = SWIG_Matlab_SetConstant(module_ns,"SerializerBase_internal_SERIALIZED_LINSOL",SWIG_From_int(static_cast< int >(casadi::SerializerBase::SERIALIZED_LINSOL)));; break;
  case 130: *resv = SWIG_Matlab_SetConstant(module_ns,"SerializerBase_internal_SERIALIZED_FUNCTION",SWIG_From_int(static_cast< int >(casadi::SerializerBase::SERIALIZED_FUNCTION)));; break;
  case 131: *resv = SWIG_Matlab_SetConstant(module_ns,"SerializerBase_internal_SERIALIZED_GENERICTYPE",SWIG_From_int(static_cast< int >(casadi::SerializerBase::SERIALIZED_GENERICTYPE)));; break;
  case 132: *resv = SWIG_Matlab_SetConstant(module_ns,"SerializerBase_internal_SERIALIZED_INT",SWIG_From_int(static_cast< int >(casadi::SerializerBase::SERIALIZED_INT)));; break;
  case 133: *resv = SWIG_Matlab_SetConstant(module_ns,"SerializerBase_internal_SERIALIZED_DOUBLE",SWIG_From_int(static_cast< int >(casadi::SerializerBase::SERIALIZED_DOUBLE)));; break;
  case 134: *resv = SWIG_Matlab_SetConstant(module_ns,"SerializerBase_internal_SERIALIZED_STRING",SWIG_From_int(static_cast< int >(casadi::SerializerBase::SERIALIZED_STRING)));; break;
  case 135: *resv = SWIG_Matlab_SetConstant(module_ns,"SerializerBase_internal_SERIALIZED_SPARSITY_VECTOR",SWIG_From_int(static_cast< int >(casadi::SerializerBase::SERIALIZED_SPARSITY_VECTOR)));; break;
  case 136: *resv = SWIG_Matlab_SetConstant(module_ns,"SerializerBase_internal_SERIALIZED_MX_VECTOR",SWIG_From_int(static_cast< int >(casadi::SerializerBase::SERIALIZED_MX_VECTOR)));; break;
  case 137: *resv = SWIG_Matlab_SetConstant(module_ns,"SerializerBase_internal_SERIALIZED_DM_VECTOR",SWIG_From_int(static_cast< int >(casadi::SerializerBase::SERIALIZED_DM_VECTOR)));; break;
  case 138: *resv = SWIG_Matlab_SetConstant(module_ns,"SerializerBase_internal_SERIALIZED_SX_VECTOR",SWIG_From_int(static_cast< int >(casadi::SerializerBase::SERIALIZED_SX_VECTOR)));; break;
  case 139: *resv = SWIG_Matlab_SetConstant(module_ns,"SerializerBase_internal_SERIALIZED_LINSOL_VECTOR",SWIG_From_int(static_cast< int >(casadi::SerializerBase::SERIALIZED_LINSOL_VECTOR)));; break;
  case 140: *resv = SWIG_Matlab_SetConstant(module_ns,"SerializerBase_internal_SERIALIZED_FUNCTION_VECTOR",SWIG_From_int(static_cast< int >(casadi::SerializerBase::SERIALIZED_FUNCTION_VECTOR)));; break;
  case 141: *resv = SWIG_Matlab_SetConstant(module_ns,"SerializerBase_internal_SERIALIZED_GENERICTYPE_VECTOR",SWIG_From_int(static_cast< int >(casadi::SerializerBase::SERIALIZED_GENERICTYPE_VECTOR)));; break;
  case 142: *resv = SWIG_Matlab_SetConstant(module_ns,"SerializerBase_internal_SERIALIZED_INT_VECTOR",SWIG_From_int(static_cast< int >(casadi::SerializerBase::SERIALIZED_INT_VECTOR)));; break;
  case 143: *resv = SWIG_Matlab_SetConstant(module_ns,"SerializerBase_internal_SERIALIZED_DOUBLE_VECTOR",SWIG_From_int(static_cast< int >(casadi::SerializerBase::SERIALIZED_DOUBLE_VECTOR)));; break;
  case 144: *resv = SWIG_Matlab_SetConstant(module_ns,"SerializerBase_internal_SERIALIZED_STRING_VECTOR",SWIG_From_int(static_cast< int >(casadi::SerializerBase::SERIALIZED_STRING_VECTOR)));; break;
  case 145: *resv = SWIG_Matlab_SetConstant(module_ns,"OPTI_GENERIC_EQUALITY",SWIG_From_int(static_cast< int >(casadi::OPTI_GENERIC_EQUALITY)));; break;
  case 146: *resv = SWIG_Matlab_SetConstant(module_ns,"OPTI_GENERIC_INEQUALITY",SWIG_From_int(static_cast< int >(casadi::OPTI_GENERIC_INEQUALITY)));; break;
  case 147: *resv = SWIG_Matlab_SetConstant(module_ns,"OPTI_EQUALITY",SWIG_From_int(static_cast< int >(casadi::OPTI_EQUALITY)));; break;
  case 148: *resv = SWIG_Matlab_SetConstant(module_ns,"OPTI_INEQUALITY",SWIG_From_int(static_cast< int >(casadi::OPTI_INEQUALITY)));; break;
  case 149: *resv = SWIG_Matlab_SetConstant(module_ns,"OPTI_DOUBLE_INEQUALITY",SWIG_From_int(static_cast< int >(casadi::OPTI_DOUBLE_INEQUALITY)));; break;
  case 150: *resv = SWIG_Matlab_SetConstant(module_ns,"OPTI_PSD",SWIG_From_int(static_cast< int >(casadi::OPTI_PSD)));; break;
  case 151: *resv = SWIG_Matlab_SetConstant(module_ns,"OPTI_UNKNOWN",SWIG_From_int(static_cast< int >(casadi::OPTI_UNKNOWN)));; break;
  case 152: *resv = SWIG_Matlab_SetConstant(module_ns,"OPTI_VAR",SWIG_From_int(static_cast< int >(casadi::OPTI_VAR)));; break;
  case 153: *resv = SWIG_Matlab_SetConstant(module_ns,"OPTI_PAR",SWIG_From_int(static_cast< int >(casadi::OPTI_PAR)));; break;
  case 154: *resv = SWIG_Matlab_SetConstant(module_ns,"OPTI_DUAL_G",SWIG_From_int(static_cast< int >(casadi::OPTI_DUAL_G)));; break;
  default:
    SWIG_Error(SWIG_RuntimeError, "No such constant.");
    return 1;
  }
  return 0;
}

SWIGINTERN const char* SwigFunctionName(int fcn_id) {
  switch(fcn_id) {
  case 0: return "swigConstant";
  case 1: return "swigFunctionName";
  case 2: return "swigConstantName";
  case 3: return "swigThis";
  case 4: return "swigTouch";
  case 5: return "delete_MatlabSwigIterator";
  case 6: return "MatlabSwigIterator_value";
  case 7: return "MatlabSwigIterator_incr";
  case 8: return "MatlabSwigIterator_decr";
  case 9: return "MatlabSwigIterator_distance";
  case 10: return "MatlabSwigIterator_equal";
  case 11: return "MatlabSwigIterator_copy";
  case 12: return "MatlabSwigIterator_next";
  case 13: return "MatlabSwigIterator_previous";
  case 14: return "MatlabSwigIterator_advance";
  case 15: return "MatlabSwigIterator_eq";
  case 16: return "MatlabSwigIterator_ne";
  case 17: return "MatlabSwigIterator_TODOincr";
  case 18: return "MatlabSwigIterator_TODOdecr";
  case 19: return "MatlabSwigIterator_plus";
  case 20: return "MatlabSwigIterator_minus";
  case 21: return "new_PrintableCommon";
  case 22: return "delete_PrintableCommon";
  case 23: return "SharedObject_class_name";
  case 24: return "SharedObject_disp";
  case 25: return "SharedObject_str";
  case 26: return "SharedObject_print_ptr";
  case 27: return "SharedObject_is_null";
  case 28: return "SharedObject_hash";
  case 29: return "new_SharedObject";
  case 30: return "delete_SharedObject";
  case 31: return "WeakRef_shared";
  case 32: return "WeakRef_alive";
  case 33: return "new_WeakRef";
  case 34: return "delete_WeakRef";
  case 35: return "_wrap_complement";
  case 36: return "_wrap_lookupvector";
  case 37: return "_wrap_temporary_file";
  case 38: return "_wrap_normalized_setup";
  case 39: return "_wrap_normalized_out";
  case 40: return "_wrap_normalized_in";
  case 41: return "GenericType_serialize";
  case 42: return "GenericType_deserialize";
  case 43: return "new_GenericType";
  case 44: return "delete_GenericType";
  case 45: return "SparsityInterfaceCommon_horzcat";
  case 46: return "SparsityInterfaceCommon_vertcat";
  case 47: return "SparsityInterfaceCommon_horzsplit";
  case 48: return "SparsityInterfaceCommon_horzsplit_n";
  case 49: return "SparsityInterfaceCommon_offset";
  case 50: return "SparsityInterfaceCommon_vertsplit";
  case 51: return "SparsityInterfaceCommon_vertsplit_n";
  case 52: return "SparsityInterfaceCommon_blockcat";
  case 53: return "SparsityInterfaceCommon_blocksplit";
  case 54: return "SparsityInterfaceCommon_diagcat";
  case 55: return "SparsityInterfaceCommon_diagsplit";
  case 56: return "SparsityInterfaceCommon_veccat";
  case 57: return "SparsityInterfaceCommon_mtimes";
  case 58: return "SparsityInterfaceCommon_mac";
  case 59: return "SparsityInterfaceCommon_transpose";
  case 60: return "SparsityInterfaceCommon_vec";
  case 61: return "SparsityInterfaceCommon_reshape";
  case 62: return "SparsityInterfaceCommon_sparsity_cast";
  case 63: return "SparsityInterfaceCommon_sprank";
  case 64: return "SparsityInterfaceCommon_norm_0_mul";
  case 65: return "SparsityInterfaceCommon_triu";
  case 66: return "SparsityInterfaceCommon_tril";
  case 67: return "SparsityInterfaceCommon_kron";
  case 68: return "SparsityInterfaceCommon_repmat";
  case 69: return "SparsityInterfaceCommon_sum2";
  case 70: return "SparsityInterfaceCommon_sum1";
  case 71: return "SparsityInterfaceCommon_length";
  case 72: return "new_SparsityInterfaceCommon";
  case 73: return "delete_SparsityInterfaceCommon";
  case 74: return "Sparsity_scalar";
  case 75: return "Sparsity_dense";
  case 76: return "Sparsity_unit";
  case 77: return "Sparsity_upper";
  case 78: return "Sparsity_lower";
  case 79: return "Sparsity_diag";
  case 80: return "Sparsity_band";
  case 81: return "Sparsity_banded";
  case 82: return "Sparsity_rowcol";
  case 83: return "Sparsity_triplet";
  case 84: return "Sparsity_nonzeros";
  case 85: return "Sparsity_compressed";
  case 86: return "Sparsity_permutation";
  case 87: return "Sparsity_permutation_vector";
  case 88: return "Sparsity_get_diag";
  case 89: return "Sparsity_compress";
  case 90: return "Sparsity_is_equal";
  case 91: return "Sparsity_eq";
  case 92: return "Sparsity_ne";
  case 93: return "Sparsity_is_stacked";
  case 94: return "Sparsity_size1";
  case 95: return "Sparsity_rows";
  case 96: return "Sparsity_size2";
  case 97: return "Sparsity_columns";
  case 98: return "Sparsity_numel";
  case 99: return "Sparsity_density";
  case 100: return "Sparsity_is_empty";
  case 101: return "Sparsity_nnz";
  case 102: return "Sparsity_nnz_upper";
  case 103: return "Sparsity_nnz_lower";
  case 104: return "Sparsity_nnz_diag";
  case 105: return "Sparsity_bw_upper";
  case 106: return "Sparsity_bw_lower";
  case 107: return "Sparsity_size";
  case 108: return "Sparsity_info";
  case 109: return "Sparsity_to_file";
  case 110: return "Sparsity_from_file";
  case 111: return "Sparsity_serialize";
  case 112: return "Sparsity_deserialize";
  case 113: return "Sparsity_colind";
  case 114: return "Sparsity_row";
  case 115: return "Sparsity_get_col";
  case 116: return "Sparsity_resize";
  case 117: return "Sparsity_add_nz";
  case 118: return "Sparsity_has_nz";
  case 119: return "Sparsity_get_nz";
  case 120: return "Sparsity_get_lower";
  case 121: return "Sparsity_get_upper";
  case 122: return "Sparsity_get_ccs";
  case 123: return "Sparsity_get_crs";
  case 124: return "Sparsity_get_triplet";
  case 125: return "Sparsity_sub";
  case 126: return "Sparsity_T";
  case 127: return "Sparsity_transpose";
  case 128: return "Sparsity_is_transpose";
  case 129: return "Sparsity_is_reshape";
  case 130: return "Sparsity_combine";
  case 131: return "Sparsity_unite";
  case 132: return "Sparsity_plus";
  case 133: return "Sparsity_intersect";
  case 134: return "Sparsity_mtimes";
  case 135: return "Sparsity_is_subset";
  case 136: return "Sparsity_sparsity_cast_mod";
  case 137: return "Sparsity_pattern_inverse";
  case 138: return "Sparsity_enlarge";
  case 139: return "Sparsity_enlargeRows";
  case 140: return "Sparsity_enlargeColumns";
  case 141: return "Sparsity_makeDense";
  case 142: return "Sparsity_erase";
  case 143: return "Sparsity_append";
  case 144: return "Sparsity_appendColumns";
  case 145: return "Sparsity_is_scalar";
  case 146: return "Sparsity_is_dense";
  case 147: return "Sparsity_is_row";
  case 148: return "Sparsity_is_column";
  case 149: return "Sparsity_is_vector";
  case 150: return "Sparsity_is_diag";
  case 151: return "Sparsity_is_square";
  case 152: return "Sparsity_is_symmetric";
  case 153: return "Sparsity_is_triu";
  case 154: return "Sparsity_is_tril";
  case 155: return "Sparsity_is_singular";
  case 156: return "Sparsity_is_permutation";
  case 157: return "Sparsity_is_selection";
  case 158: return "Sparsity_is_orthonormal";
  case 159: return "Sparsity_is_orthonormal_rows";
  case 160: return "Sparsity_is_orthonormal_columns";
  case 161: return "Sparsity_rowsSequential";
  case 162: return "Sparsity_removeDuplicates";
  case 163: return "Sparsity_etree";
  case 164: return "Sparsity_ldl";
  case 165: return "Sparsity_qr_sparse";
  case 166: return "Sparsity_dfs";
  case 167: return "Sparsity_scc";
  case 168: return "Sparsity_btf";
  case 169: return "Sparsity_amd";
  case 170: return "Sparsity_find";
  case 171: return "Sparsity_uni_coloring";
  case 172: return "Sparsity_star_coloring";
  case 173: return "Sparsity_star_coloring2";
  case 174: return "Sparsity_largest_first";
  case 175: return "Sparsity_pmult";
  case 176: return "Sparsity_dim";
  case 177: return "Sparsity_postfix_dim";
  case 178: return "Sparsity_repr_el";
  case 179: return "Sparsity_spy";
  case 180: return "Sparsity_spy_matlab";
  case 181: return "Sparsity_export_code";
  case 182: return "Sparsity_type_name";
  case 183: return "Sparsity_hash";
  case 184: return "Sparsity_test_cast";
  case 185: return "Sparsity_kkt";
  case 186: return "new_Sparsity";
  case 187: return "delete_Sparsity";
  case 188: return "_wrap_hash_sparsity";
  case 189: return "Slice_start_get";
  case 190: return "Slice_stop_get";
  case 191: return "Slice_step_get";
  case 192: return "Slice_all";
  case 193: return "Slice_size";
  case 194: return "Slice_is_empty";
  case 195: return "Slice_is_scalar";
  case 196: return "Slice_scalar";
  case 197: return "Slice_eq";
  case 198: return "Slice_ne";
  case 199: return "Slice_apply";
  case 200: return "Slice_minus";
  case 201: return "Slice_mtimes";
  case 202: return "Slice_type_name";
  case 203: return "Slice_disp";
  case 204: return "Slice_str";
  case 205: return "Slice_info";
  case 206: return "Slice_serialize";
  case 207: return "Slice_deserialize";
  case 208: return "new_Slice";
  case 209: return "delete_Slice";
  case 210: return "_wrap_to_slice";
  case 211: return "_wrap_to_slice2";
  case 212: return "_wrap_is_slice";
  case 213: return "_wrap_is_slice2";
  case 214: return "GenericMatrixCommon_mpower";
  case 215: return "GenericMatrixCommon_mrdivide";
  case 216: return "GenericMatrixCommon_mldivide";
  case 217: return "GenericMatrixCommon_symvar";
  case 218: return "GenericMatrixCommon_bilin";
  case 219: return "GenericMatrixCommon_rank1";
  case 220: return "GenericMatrixCommon_sumsqr";
  case 221: return "GenericMatrixCommon_linspace";
  case 222: return "GenericMatrixCommon_logsumexp";
  case 223: return "GenericMatrixCommon_interp1d";
  case 224: return "GenericMatrixCommon_soc";
  case 225: return "GenericMatrixCommon_cross";
  case 226: return "GenericMatrixCommon_skew";
  case 227: return "GenericMatrixCommon_inv_skew";
  case 228: return "GenericMatrixCommon_det";
  case 229: return "GenericMatrixCommon_inv_minor";
  case 230: return "GenericMatrixCommon_inv";
  case 231: return "GenericMatrixCommon_trace";
  case 232: return "GenericMatrixCommon_tril2symm";
  case 233: return "GenericMatrixCommon_triu2symm";
  case 234: return "GenericMatrixCommon_norm_fro";
  case 235: return "GenericMatrixCommon_norm_2";
  case 236: return "GenericMatrixCommon_norm_1";
  case 237: return "GenericMatrixCommon_norm_inf";
  case 238: return "GenericMatrixCommon_dot";
  case 239: return "GenericMatrixCommon_nullspace";
  case 240: return "GenericMatrixCommon_polyval";
  case 241: return "GenericMatrixCommon_diag";
  case 242: return "GenericMatrixCommon_unite";
  case 243: return "GenericMatrixCommon_densify";
  case 244: return "GenericMatrixCommon_project";
  case 245: return "GenericMatrixCommon_if_else";
  case 246: return "GenericMatrixCommon_conditional";
  case 247: return "GenericMatrixCommon_depends_on";
  case 248: return "GenericMatrixCommon_solve";
  case 249: return "GenericMatrixCommon_pinv";
  case 250: return "GenericMatrixCommon_expm_const";
  case 251: return "GenericMatrixCommon_expm";
  case 252: return "GenericMatrixCommon_jacobian";
  case 253: return "GenericMatrixCommon_jtimes";
  case 254: return "GenericMatrixCommon_linearize";
  case 255: return "GenericMatrixCommon_which_depends";
  case 256: return "GenericMatrixCommon_jacobian_sparsity";
  case 257: return "GenericMatrixCommon_is_linear";
  case 258: return "GenericMatrixCommon_is_quadratic";
  case 259: return "GenericMatrixCommon_gradient";
  case 260: return "GenericMatrixCommon_tangent";
  case 261: return "GenericMatrixCommon_hessian";
  case 262: return "GenericMatrixCommon_quadratic_coeff";
  case 263: return "GenericMatrixCommon_linear_coeff";
  case 264: return "GenericMatrixCommon_n_nodes";
  case 265: return "GenericMatrixCommon_print_operator";
  case 266: return "GenericMatrixCommon_repsum";
  case 267: return "GenericMatrixCommon_diff";
  case 268: return "GenericMatrixCommon_cumsum";
  case 269: return "GenericMatrixCommon_einstein";
  case 270: return "GenericMatrixCommon_mmin";
  case 271: return "GenericMatrixCommon_mmax";
  case 272: return "GenericMatrixCommon_evalf";
  case 273: return "GenericMatrixCommon_cse";
  case 274: return "new_GenericMatrixCommon";
  case 275: return "delete_GenericMatrixCommon";
  case 276: return "_wrap_index_interp1d";
  case 277: return "GenDM_nnz";
  case 278: return "GenDM_nnz_lower";
  case 279: return "GenDM_nnz_upper";
  case 280: return "GenDM_nnz_diag";
  case 281: return "GenDM_numel";
  case 282: return "GenDM_size1";
  case 283: return "GenDM_rows";
  case 284: return "GenDM_size2";
  case 285: return "GenDM_columns";
  case 286: return "GenDM_dim";
  case 287: return "GenDM_size";
  case 288: return "GenDM_is_empty";
  case 289: return "GenDM_is_dense";
  case 290: return "GenDM_is_scalar";
  case 291: return "GenDM_is_square";
  case 292: return "GenDM_is_vector";
  case 293: return "GenDM_is_row";
  case 294: return "GenDM_is_column";
  case 295: return "GenDM_is_triu";
  case 296: return "GenDM_is_tril";
  case 297: return "GenDM_row";
  case 298: return "GenDM_colind";
  case 299: return "GenDM_sparsity";
  case 300: return "GenDM_sym";
  case 301: return "GenDM_zeros";
  case 302: return "GenDM_ones";
  case 303: return "new_GenDM";
  case 304: return "delete_GenDM";
  case 305: return "GenSX_nnz";
  case 306: return "GenSX_nnz_lower";
  case 307: return "GenSX_nnz_upper";
  case 308: return "GenSX_nnz_diag";
  case 309: return "GenSX_numel";
  case 310: return "GenSX_size1";
  case 311: return "GenSX_rows";
  case 312: return "GenSX_size2";
  case 313: return "GenSX_columns";
  case 314: return "GenSX_dim";
  case 315: return "GenSX_size";
  case 316: return "GenSX_is_empty";
  case 317: return "GenSX_is_dense";
  case 318: return "GenSX_is_scalar";
  case 319: return "GenSX_is_square";
  case 320: return "GenSX_is_vector";
  case 321: return "GenSX_is_row";
  case 322: return "GenSX_is_column";
  case 323: return "GenSX_is_triu";
  case 324: return "GenSX_is_tril";
  case 325: return "GenSX_row";
  case 326: return "GenSX_colind";
  case 327: return "GenSX_sparsity";
  case 328: return "GenSX_sym";
  case 329: return "GenSX_zeros";
  case 330: return "GenSX_ones";
  case 331: return "new_GenSX";
  case 332: return "delete_GenSX";
  case 333: return "GenMX_nnz";
  case 334: return "GenMX_nnz_lower";
  case 335: return "GenMX_nnz_upper";
  case 336: return "GenMX_nnz_diag";
  case 337: return "GenMX_numel";
  case 338: return "GenMX_size1";
  case 339: return "GenMX_rows";
  case 340: return "GenMX_size2";
  case 341: return "GenMX_columns";
  case 342: return "GenMX_dim";
  case 343: return "GenMX_size";
  case 344: return "GenMX_is_empty";
  case 345: return "GenMX_is_dense";
  case 346: return "GenMX_is_scalar";
  case 347: return "GenMX_is_square";
  case 348: return "GenMX_is_vector";
  case 349: return "GenMX_is_row";
  case 350: return "GenMX_is_column";
  case 351: return "GenMX_is_triu";
  case 352: return "GenMX_is_tril";
  case 353: return "GenMX_row";
  case 354: return "GenMX_colind";
  case 355: return "GenMX_sparsity";
  case 356: return "GenMX_sym";
  case 357: return "GenMX_zeros";
  case 358: return "GenMX_ones";
  case 359: return "new_GenMX";
  case 360: return "delete_GenMX";
  case 361: return "GenericExpressionCommon_plus";
  case 362: return "GenericExpressionCommon_minus";
  case 363: return "GenericExpressionCommon_times";
  case 364: return "GenericExpressionCommon_rdivide";
  case 365: return "GenericExpressionCommon_ldivide";
  case 366: return "GenericExpressionCommon_lt";
  case 367: return "GenericExpressionCommon_le";
  case 368: return "GenericExpressionCommon_gt";
  case 369: return "GenericExpressionCommon_ge";
  case 370: return "GenericExpressionCommon_eq";
  case 371: return "GenericExpressionCommon_ne";
  case 372: return "GenericExpressionCommon_and";
  case 373: return "GenericExpressionCommon_or";
  case 374: return "GenericExpressionCommon_not";
  case 375: return "GenericExpressionCommon_abs";
  case 376: return "GenericExpressionCommon_sqrt";
  case 377: return "GenericExpressionCommon_sin";
  case 378: return "GenericExpressionCommon_cos";
  case 379: return "GenericExpressionCommon_tan";
  case 380: return "GenericExpressionCommon_atan";
  case 381: return "GenericExpressionCommon_asin";
  case 382: return "GenericExpressionCommon_acos";
  case 383: return "GenericExpressionCommon_tanh";
  case 384: return "GenericExpressionCommon_sinh";
  case 385: return "GenericExpressionCommon_cosh";
  case 386: return "GenericExpressionCommon_atanh";
  case 387: return "GenericExpressionCommon_asinh";
  case 388: return "GenericExpressionCommon_acosh";
  case 389: return "GenericExpressionCommon_exp";
  case 390: return "GenericExpressionCommon_log";
  case 391: return "GenericExpressionCommon_log10";
  case 392: return "GenericExpressionCommon_log1p";
  case 393: return "GenericExpressionCommon_expm1";
  case 394: return "GenericExpressionCommon_floor";
  case 395: return "GenericExpressionCommon_ceil";
  case 396: return "GenericExpressionCommon_erf";
  case 397: return "GenericExpressionCommon_erfinv";
  case 398: return "GenericExpressionCommon_sign";
  case 399: return "GenericExpressionCommon_power";
  case 400: return "GenericExpressionCommon_rem";
  case 401: return "GenericExpressionCommon_fmod";
  case 402: return "GenericExpressionCommon_remainder";
  case 403: return "GenericExpressionCommon_atan2";
  case 404: return "GenericExpressionCommon_fmin";
  case 405: return "GenericExpressionCommon_fmax";
  case 406: return "GenericExpressionCommon_hypot";
  case 407: return "GenericExpressionCommon_simplify";
  case 408: return "GenericExpressionCommon_is_equal";
  case 409: return "GenericExpressionCommon_copysign";
  case 410: return "GenericExpressionCommon_constpow";
  case 411: return "new_GenericExpressionCommon";
  case 412: return "delete_GenericExpressionCommon";
  case 413: return "MatrixCommon_all";
  case 414: return "MatrixCommon_any";
  case 415: return "MatrixCommon_adj";
  case 416: return "MatrixCommon_minor";
  case 417: return "MatrixCommon_cofactor";
  case 418: return "MatrixCommon_qr";
  case 419: return "MatrixCommon_qr_sparse";
  case 420: return "MatrixCommon_qr_solve";
  case 421: return "MatrixCommon_ldl";
  case 422: return "MatrixCommon_ldl_solve";
  case 423: return "MatrixCommon_chol";
  case 424: return "MatrixCommon_norm_inf_mul";
  case 425: return "MatrixCommon_sparsify";
  case 426: return "MatrixCommon_expand";
  case 427: return "MatrixCommon_pw_const";
  case 428: return "MatrixCommon_pw_lin";
  case 429: return "MatrixCommon_heaviside";
  case 430: return "MatrixCommon_rectangle";
  case 431: return "MatrixCommon_triangle";
  case 432: return "MatrixCommon_ramp";
  case 433: return "MatrixCommon_gauss_quadrature";
  case 434: return "MatrixCommon_taylor";
  case 435: return "MatrixCommon_mtaylor";
  case 436: return "MatrixCommon_poly_coeff";
  case 437: return "MatrixCommon_poly_roots";
  case 438: return "MatrixCommon_eig_symbolic";
  case 439: return "new_MatrixCommon";
  case 440: return "delete_MatrixCommon";
  case 441: return "DM_has_nz";
  case 442: return "DM_nonzero";
  case 443: return "DM_get";
  case 444: return "DM_set";
  case 445: return "DM_get_nz";
  case 446: return "DM_set_nz";
  case 447: return "DM_uplus";
  case 448: return "DM_uminus";
  case 449: return "DM_binary";
  case 450: return "DM_unary";
  case 451: return "DM_scalar_matrix";
  case 452: return "DM_matrix_scalar";
  case 453: return "DM_matrix_matrix";
  case 454: return "DM_printme";
  case 455: return "DM_T";
  case 456: return "DM_set_max_depth";
  case 457: return "DM_get_max_depth";
  case 458: return "DM_get_input";
  case 459: return "DM_get_free";
  case 460: return "DM_type_name";
  case 461: return "DM_print_split";
  case 462: return "DM_disp";
  case 463: return "DM_str";
  case 464: return "DM_print_scalar";
  case 465: return "DM_print_vector";
  case 466: return "DM_print_dense";
  case 467: return "DM_print_sparse";
  case 468: return "DM_clear";
  case 469: return "DM_resize";
  case 470: return "DM_reserve";
  case 471: return "DM_erase";
  case 472: return "DM_remove";
  case 473: return "DM_enlarge";
  case 474: return "DM_sparsity";
  case 475: return "DM_triplet";
  case 476: return "DM_inf";
  case 477: return "DM_nan";
  case 478: return "DM_eye";
  case 479: return "DM_element_hash";
  case 480: return "DM_is_regular";
  case 481: return "DM_is_smooth";
  case 482: return "DM_is_leaf";
  case 483: return "DM_is_commutative";
  case 484: return "DM_is_symbolic";
  case 485: return "DM_is_valid_input";
  case 486: return "DM_has_duplicates";
  case 487: return "DM_reset_input";
  case 488: return "DM_is_constant";
  case 489: return "DM_is_integer";
  case 490: return "DM_is_zero";
  case 491: return "DM_is_one";
  case 492: return "DM_is_minus_one";
  case 493: return "DM_is_eye";
  case 494: return "DM_op";
  case 495: return "DM_is_op";
  case 496: return "DM_has_zeros";
  case 497: return "DM_nonzeros";
  case 498: return "DM_elements";
  case 499: return "DM_to_double";
  case 500: return "DM_to_int";
  case 501: return "DM_name";
  case 502: return "DM_dep";
  case 503: return "DM_n_dep";
  case 504: return "DM_set_precision";
  case 505: return "DM_set_width";
  case 506: return "DM_set_scientific";
  case 507: return "DM_rng";
  case 508: return "DM_rand";
  case 509: return "DM_export_code";
  case 510: return "DM_info";
  case 511: return "DM_serialize";
  case 512: return "DM_deserialize";
  case 513: return "DM_to_file";
  case 514: return "DM_from_file";
  case 515: return "new_DM";
  case 516: return "DM_assign";
  case 517: return "DM_paren";
  case 518: return "DM_paren_asgn";
  case 519: return "DM_brace";
  case 520: return "DM_setbrace";
  case 521: return "DM_end";
  case 522: return "DM_numel";
  case 523: return "DM_ctranspose";
  case 524: return "DM_full";
  case 525: return "DM_sparse";
  case 526: return "delete_DM";
  case 527: return "new_SXElem";
  case 528: return "delete_SXElem";
  case 529: return "SX_has_nz";
  case 530: return "SX_nonzero";
  case 531: return "SX_get";
  case 532: return "SX_set";
  case 533: return "SX_get_nz";
  case 534: return "SX_set_nz";
  case 535: return "SX_uplus";
  case 536: return "SX_uminus";
  case 537: return "SX_binary";
  case 538: return "SX_unary";
  case 539: return "SX_scalar_matrix";
  case 540: return "SX_matrix_scalar";
  case 541: return "SX_matrix_matrix";
  case 542: return "SX_printme";
  case 543: return "SX_T";
  case 544: return "SX_set_max_depth";
  case 545: return "SX_get_max_depth";
  case 546: return "SX_get_input";
  case 547: return "SX_get_free";
  case 548: return "SX_type_name";
  case 549: return "SX_print_split";
  case 550: return "SX_disp";
  case 551: return "SX_str";
  case 552: return "SX_print_scalar";
  case 553: return "SX_print_vector";
  case 554: return "SX_print_dense";
  case 555: return "SX_print_sparse";
  case 556: return "SX_clear";
  case 557: return "SX_resize";
  case 558: return "SX_reserve";
  case 559: return "SX_erase";
  case 560: return "SX_remove";
  case 561: return "SX_enlarge";
  case 562: return "SX_sparsity";
  case 563: return "SX_triplet";
  case 564: return "SX_inf";
  case 565: return "SX_nan";
  case 566: return "SX_eye";
  case 567: return "SX_element_hash";
  case 568: return "SX_is_regular";
  case 569: return "SX_is_smooth";
  case 570: return "SX_is_leaf";
  case 571: return "SX_is_commutative";
  case 572: return "SX_is_symbolic";
  case 573: return "SX_is_valid_input";
  case 574: return "SX_has_duplicates";
  case 575: return "SX_reset_input";
  case 576: return "SX_is_constant";
  case 577: return "SX_is_integer";
  case 578: return "SX_is_zero";
  case 579: return "SX_is_one";
  case 580: return "SX_is_minus_one";
  case 581: return "SX_is_eye";
  case 582: return "SX_op";
  case 583: return "SX_is_op";
  case 584: return "SX_has_zeros";
  case 585: return "SX_nonzeros";
  case 586: return "SX_elements";
  case 587: return "SX_to_double";
  case 588: return "SX_to_int";
  case 589: return "SX_name";
  case 590: return "SX_dep";
  case 591: return "SX_n_dep";
  case 592: return "SX_set_precision";
  case 593: return "SX_set_width";
  case 594: return "SX_set_scientific";
  case 595: return "SX_rng";
  case 596: return "SX_rand";
  case 597: return "SX_export_code";
  case 598: return "SX_info";
  case 599: return "SX_serialize";
  case 600: return "SX_deserialize";
  case 601: return "SX_to_file";
  case 602: return "SX_from_file";
  case 603: return "SX_paren";
  case 604: return "SX_paren_asgn";
  case 605: return "SX_brace";
  case 606: return "SX_setbrace";
  case 607: return "SX_end";
  case 608: return "SX_numel";
  case 609: return "SX_ctranspose";
  case 610: return "new_SX";
  case 611: return "delete_SX";
  case 612: return "MX_type_name";
  case 613: return "delete_MX";
  case 614: return "MX_nonzero";
  case 615: return "MX_sparsity";
  case 616: return "MX_erase";
  case 617: return "MX_enlarge";
  case 618: return "MX_uminus";
  case 619: return "MX_dep";
  case 620: return "MX_n_out";
  case 621: return "MX_get_output";
  case 622: return "MX_n_dep";
  case 623: return "MX_name";
  case 624: return "MX_to_double";
  case 625: return "MX_to_DM";
  case 626: return "MX_is_symbolic";
  case 627: return "MX_is_constant";
  case 628: return "MX_is_call";
  case 629: return "MX_which_function";
  case 630: return "MX_is_output";
  case 631: return "MX_which_output";
  case 632: return "MX_is_op";
  case 633: return "MX_is_multiplication";
  case 634: return "MX_is_commutative";
  case 635: return "MX_is_norm";
  case 636: return "MX_is_valid_input";
  case 637: return "MX_n_primitives";
  case 638: return "MX_primitives";
  case 639: return "MX_split_primitives";
  case 640: return "MX_join_primitives";
  case 641: return "MX_has_duplicates";
  case 642: return "MX_reset_input";
  case 643: return "MX_is_eye";
  case 644: return "MX_is_zero";
  case 645: return "MX_is_one";
  case 646: return "MX_is_minus_one";
  case 647: return "MX_is_transpose";
  case 648: return "MX_is_regular";
  case 649: return "MX_is_binary";
  case 650: return "MX_is_unary";
  case 651: return "MX_op";
  case 652: return "MX_info";
  case 653: return "MX_serialize";
  case 654: return "MX_deserialize";
  case 655: return "MX_get_temp";
  case 656: return "MX_set_temp";
  case 657: return "MX_binary";
  case 658: return "MX_unary";
  case 659: return "MX_inf";
  case 660: return "MX_nan";
  case 661: return "MX_eye";
  case 662: return "MX_get";
  case 663: return "MX_set";
  case 664: return "MX_get_nz";
  case 665: return "MX_set_nz";
  case 666: return "MX_einstein";
  case 667: return "MX_bspline_dual";
  case 668: return "MX_interpn_linear";
  case 669: return "MX_printme";
  case 670: return "MX_attachAssert";
  case 671: return "MX_monitor";
  case 672: return "MX_T";
  case 673: return "MX_mapping";
  case 674: return "MX_set_max_depth";
  case 675: return "MX_get_max_depth";
  case 676: return "MX_test_cast";
  case 677: return "MX_get_input";
  case 678: return "MX_get_free";
  case 679: return "MX_eval_mx";
  case 680: return "MX_paren_asgn";
  case 681: return "MX_setbrace";
  case 682: return "MX_end";
  case 683: return "MX_numel";
  case 684: return "MX_ctranspose";
  case 685: return "MX_find";
  case 686: return "MX_low";
  case 687: return "MX_inv_node";
  case 688: return "MX_brace";
  case 689: return "MX_paren";
  case 690: return "new_MX";
  case 691: return "Function_type_name";
  case 692: return "Function_jit";
  case 693: return "delete_Function";
  case 694: return "Function_expand";
  case 695: return "Function_n_in";
  case 696: return "Function_n_out";
  case 697: return "Function_size1_in";
  case 698: return "Function_size2_in";
  case 699: return "Function_size_in";
  case 700: return "Function_size1_out";
  case 701: return "Function_size2_out";
  case 702: return "Function_size_out";
  case 703: return "Function_nnz_in";
  case 704: return "Function_nnz_out";
  case 705: return "Function_numel_in";
  case 706: return "Function_numel_out";
  case 707: return "Function_name_in";
  case 708: return "Function_name_out";
  case 709: return "Function_index_in";
  case 710: return "Function_index_out";
  case 711: return "Function_default_in";
  case 712: return "Function_max_in";
  case 713: return "Function_min_in";
  case 714: return "Function_nominal_in";
  case 715: return "Function_nominal_out";
  case 716: return "Function_sparsity_in";
  case 717: return "Function_sparsity_out";
  case 718: return "Function_is_diff_in";
  case 719: return "Function_is_diff_out";
  case 720: return "Function_factory";
  case 721: return "Function_oracle";
  case 722: return "Function_wrap";
  case 723: return "Function_wrap_as_needed";
  case 724: return "Function_which_depends";
  case 725: return "Function_print_dimensions";
  case 726: return "Function_print_options";
  case 727: return "Function_print_option";
  case 728: return "Function_has_option";
  case 729: return "Function_change_option";
  case 730: return "Function_uses_output";
  case 731: return "Function_jacobian_old";
  case 732: return "Function_hessian_old";
  case 733: return "Function_sparsity_jac";
  case 734: return "Function_jacobian";
  case 735: return "Function_call";
  case 736: return "Function_mapsum";
  case 737: return "Function_mapaccum";
  case 738: return "Function_fold";
  case 739: return "Function_map";
  case 740: return "Function_slice";
  case 741: return "Function_conditional";
  case 742: return "Function_bspline";
  case 743: return "Function_if_else";
  case 744: return "Function_forward";
  case 745: return "Function_reverse";
  case 746: return "Function_jac_sparsity";
  case 747: return "Function_generate";
  case 748: return "Function_generate_dependencies";
  case 749: return "Function_generate_in";
  case 750: return "Function_generate_out";
  case 751: return "Function_serialize";
  case 752: return "Function_save";
  case 753: return "Function_export_code";
  case 754: return "Function_stats";
  case 755: return "Function_sx_in";
  case 756: return "Function_mx_in";
  case 757: return "Function_sx_out";
  case 758: return "Function_mx_out";
  case 759: return "Function_nz_from_in";
  case 760: return "Function_nz_from_out";
  case 761: return "Function_nz_to_in";
  case 762: return "Function_nz_to_out";
  case 763: return "Function_convert_in";
  case 764: return "Function_convert_out";
  case 765: return "Function_has_free";
  case 766: return "Function_get_free";
  case 767: return "Function_free_sx";
  case 768: return "Function_free_mx";
  case 769: return "Function_generate_lifted";
  case 770: return "Function_n_nodes";
  case 771: return "Function_n_instructions";
  case 772: return "Function_instruction_id";
  case 773: return "Function_instruction_input";
  case 774: return "Function_instruction_constant";
  case 775: return "Function_instruction_output";
  case 776: return "Function_instruction_MX";
  case 777: return "Function_instructions_sx";
  case 778: return "Function_has_spfwd";
  case 779: return "Function_has_sprev";
  case 780: return "Function_sz_arg";
  case 781: return "Function_sz_res";
  case 782: return "Function_sz_iw";
  case 783: return "Function_sz_w";
  case 784: return "Function_name";
  case 785: return "Function_is_a";
  case 786: return "Function_check_name";
  case 787: return "Function_fix_name";
  case 788: return "Function_load";
  case 789: return "Function_deserialize";
  case 790: return "Function_assert_size_in";
  case 791: return "Function_assert_size_out";
  case 792: return "Function_assert_sparsity_out";
  case 793: return "Function_checkout";
  case 794: return "Function_release";
  case 795: return "Function_cache";
  case 796: return "Function_get_function";
  case 797: return "Function_has_function";
  case 798: return "Function_find_functions";
  case 799: return "Function_find_function";
  case 800: return "Function_info";
  case 801: return "new_Function";
  case 802: return "_wrap_external";
  case 803: return "_wrap_integrator";
  case 804: return "_wrap_has_integrator";
  case 805: return "_wrap_load_integrator";
  case 806: return "_wrap_doc_integrator";
  case 807: return "_wrap_integrator_in";
  case 808: return "_wrap_integrator_out";
  case 809: return "_wrap_integrator_n_in";
  case 810: return "_wrap_integrator_n_out";
  case 811: return "_wrap_dyn_in";
  case 812: return "_wrap_dyn_out";
  case 813: return "_wrap_dyn_n_in";
  case 814: return "_wrap_dyn_n_out";
  case 815: return "_wrap_conic";
  case 816: return "_wrap_qpsol";
  case 817: return "_wrap_conic_in";
  case 818: return "_wrap_conic_out";
  case 819: return "_wrap_conic_n_in";
  case 820: return "_wrap_conic_n_out";
  case 821: return "_wrap_conic_options";
  case 822: return "_wrap_conic_option_type";
  case 823: return "_wrap_conic_option_info";
  case 824: return "_wrap_has_conic";
  case 825: return "_wrap_load_conic";
  case 826: return "_wrap_doc_conic";
  case 827: return "_wrap_conic_debug";
  case 828: return "_wrap_nlpsol";
  case 829: return "_wrap_nlpsol_in";
  case 830: return "_wrap_nlpsol_out";
  case 831: return "_wrap_nlpsol_n_in";
  case 832: return "_wrap_nlpsol_n_out";
  case 833: return "_wrap_nlpsol_default_in";
  case 834: return "_wrap_nlpsol_options";
  case 835: return "_wrap_nlpsol_option_type";
  case 836: return "_wrap_nlpsol_option_info";
  case 837: return "_wrap_has_nlpsol";
  case 838: return "_wrap_load_nlpsol";
  case 839: return "_wrap_doc_nlpsol";
  case 840: return "_wrap_rootfinder";
  case 841: return "_wrap_rootfinder_in";
  case 842: return "_wrap_rootfinder_out";
  case 843: return "_wrap_rootfinder_n_in";
  case 844: return "_wrap_rootfinder_n_out";
  case 845: return "_wrap_rootfinder_options";
  case 846: return "_wrap_rootfinder_option_type";
  case 847: return "_wrap_rootfinder_option_info";
  case 848: return "_wrap_has_rootfinder";
  case 849: return "_wrap_load_rootfinder";
  case 850: return "_wrap_doc_rootfinder";
  case 851: return "Linsol_type_name";
  case 852: return "Linsol_has_plugin";
  case 853: return "Linsol_load_plugin";
  case 854: return "Linsol_doc";
  case 855: return "Linsol_plugin_name";
  case 856: return "Linsol_sparsity";
  case 857: return "Linsol_sfact";
  case 858: return "Linsol_nfact";
  case 859: return "Linsol_solve";
  case 860: return "Linsol_neig";
  case 861: return "Linsol_rank";
  case 862: return "Linsol_stats";
  case 863: return "new_Linsol";
  case 864: return "delete_Linsol";
  case 865: return "_wrap_has_linsol";
  case 866: return "_wrap_load_linsol";
  case 867: return "_wrap_doc_linsol";
  case 868: return "_wrap_dplesol";
  case 869: return "_wrap_dple_in";
  case 870: return "_wrap_dple_out";
  case 871: return "_wrap_dple_n_in";
  case 872: return "_wrap_dple_n_out";
  case 873: return "_wrap_has_dple";
  case 874: return "_wrap_load_dple";
  case 875: return "_wrap_doc_dple";
  case 876: return "_wrap_expmsol";
  case 877: return "_wrap_expm_n_in";
  case 878: return "_wrap_expm_n_out";
  case 879: return "_wrap_has_expm";
  case 880: return "_wrap_load_expm";
  case 881: return "_wrap_doc_expm";
  case 882: return "_wrap_interpolant";
  case 883: return "_wrap_has_interpolant";
  case 884: return "_wrap_load_interpolant";
  case 885: return "_wrap_doc_interpolant";
  case 886: return "new_CodeGenerator";
  case 887: return "CodeGenerator_add";
  case 888: return "CodeGenerator_dump";
  case 889: return "CodeGenerator_generate";
  case 890: return "CodeGenerator_add_include";
  case 891: return "delete_CodeGenerator";
  case 892: return "_wrap_forward";
  case 893: return "_wrap_reverse";
  case 894: return "_wrap_substitute";
  case 895: return "_wrap_substitute_inplace";
  case 896: return "_wrap_extract";
  case 897: return "_wrap_shared";
  case 898: return "_wrap_blockcat";
  case 899: return "_wrap_matrix_expand";
  case 900: return "_wrap_graph_substitute";
  case 901: return "_wrap_bspline";
  case 902: return "_wrap_convexify";
  case 903: return "_wrap_stop_diff";
  case 904: return "_wrap_no_hess";
  case 905: return "_wrap_no_grad";
  case 906: return "Importer_type_name";
  case 907: return "Importer_test_cast";
  case 908: return "Importer_has_plugin";
  case 909: return "Importer_load_plugin";
  case 910: return "Importer_doc";
  case 911: return "Importer_plugin_name";
  case 912: return "Importer_has_function";
  case 913: return "Importer_has_meta";
  case 914: return "Importer_get_meta";
  case 915: return "Importer_inlined";
  case 916: return "Importer_body";
  case 917: return "Importer_library";
  case 918: return "Importer_serialize";
  case 919: return "Importer_deserialize";
  case 920: return "new_Importer";
  case 921: return "delete_Importer";
  case 922: return "Callback_type_name";
  case 923: return "new_Callback";
  case 924: return "delete_Callback";
  case 925: return "Callback_construct";
  case 926: return "Callback_init";
  case 927: return "Callback_finalize";
  case 928: return "Callback_eval";
  case 929: return "Callback_eval_buffer";
  case 930: return "Callback_has_eval_buffer";
  case 931: return "Callback_get_n_in";
  case 932: return "Callback_get_n_out";
  case 933: return "Callback_get_sparsity_in";
  case 934: return "Callback_get_sparsity_out";
  case 935: return "Callback_get_name_in";
  case 936: return "Callback_get_name_out";
  case 937: return "Callback_uses_output";
  case 938: return "Callback_has_jacobian";
  case 939: return "Callback_get_jacobian";
  case 940: return "Callback_has_forward";
  case 941: return "Callback_get_forward";
  case 942: return "Callback_has_reverse";
  case 943: return "Callback_get_reverse";
  case 944: return "Callback_has_jac_sparsity";
  case 945: return "Callback_get_jac_sparsity";
  case 946: return "GlobalOptions_setSimplificationOnTheFly";
  case 947: return "GlobalOptions_getSimplificationOnTheFly";
  case 948: return "GlobalOptions_setHierarchicalSparsity";
  case 949: return "GlobalOptions_getHierarchicalSparsity";
  case 950: return "GlobalOptions_setCasadiPath";
  case 951: return "GlobalOptions_getCasadiPath";
  case 952: return "GlobalOptions_setCasadiIncludePath";
  case 953: return "GlobalOptions_getCasadiIncludePath";
  case 954: return "GlobalOptions_setMaxNumDir";
  case 955: return "GlobalOptions_getMaxNumDir";
  case 956: return "new_GlobalOptions";
  case 957: return "delete_GlobalOptions";
  case 958: return "CasadiMeta_version";
  case 959: return "CasadiMeta_git_revision";
  case 960: return "CasadiMeta_git_describe";
  case 961: return "CasadiMeta_feature_list";
  case 962: return "CasadiMeta_build_type";
  case 963: return "CasadiMeta_compiler_id";
  case 964: return "CasadiMeta_compiler";
  case 965: return "CasadiMeta_compiler_flags";
  case 966: return "CasadiMeta_modules";
  case 967: return "CasadiMeta_plugins";
  case 968: return "CasadiMeta_install_prefix";
  case 969: return "new_CasadiMeta";
  case 970: return "delete_CasadiMeta";
  case 971: return "_wrap_collocation_points";
  case 972: return "_wrap_collocation_interpolators";
  case 973: return "_wrap_collocation_coeff";
  case 974: return "_wrap_simpleRK";
  case 975: return "_wrap_simpleIRK";
  case 976: return "_wrap_simpleIntegrator";
  case 977: return "_wrap_dae_reduce_index";
  case 978: return "_wrap_dae_map_semi_expl";
  case 979: return "_wrap_dae_init_gen";
  case 980: return "_wrap_detect_simple_bounds";
  case 981: return "_wrap_external_transform";
  case 982: return "NlpBuilder_x_get";
  case 983: return "NlpBuilder_f_get";
  case 984: return "NlpBuilder_g_get";
  case 985: return "NlpBuilder_x_lb_get";
  case 986: return "NlpBuilder_x_ub_get";
  case 987: return "NlpBuilder_g_lb_get";
  case 988: return "NlpBuilder_g_ub_get";
  case 989: return "NlpBuilder_x_init_get";
  case 990: return "NlpBuilder_lambda_init_get";
  case 991: return "NlpBuilder_discrete_get";
  case 992: return "NlpBuilder_import_nl";
  case 993: return "NlpBuilder_type_name";
  case 994: return "NlpBuilder_disp";
  case 995: return "NlpBuilder_str";
  case 996: return "new_NlpBuilder";
  case 997: return "delete_NlpBuilder";
  case 998: return "DaeBuilder_type_name";
  case 999: return "DaeBuilder_name";
  case 1000: return "DaeBuilder_t";
  case 1001: return "DaeBuilder_x";
  case 1002: return "DaeBuilder_ode";
  case 1003: return "DaeBuilder_z";
  case 1004: return "DaeBuilder_alg";
  case 1005: return "DaeBuilder_q";
  case 1006: return "DaeBuilder_quad";
  case 1007: return "DaeBuilder_y";
  case 1008: return "DaeBuilder_ydef";
  case 1009: return "DaeBuilder_u";
  case 1010: return "DaeBuilder_p";
  case 1011: return "DaeBuilder_c";
  case 1012: return "DaeBuilder_cdef";
  case 1013: return "DaeBuilder_d";
  case 1014: return "DaeBuilder_ddef";
  case 1015: return "DaeBuilder_w";
  case 1016: return "DaeBuilder_wdef";
  case 1017: return "DaeBuilder_aux";
  case 1018: return "DaeBuilder_init_lhs";
  case 1019: return "DaeBuilder_init_rhs";
  case 1020: return "DaeBuilder_when_cond";
  case 1021: return "DaeBuilder_when_lhs";
  case 1022: return "DaeBuilder_when_rhs";
  case 1023: return "DaeBuilder_outputs";
  case 1024: return "DaeBuilder_derivatives";
  case 1025: return "DaeBuilder_initial_unknowns";
  case 1026: return "DaeBuilder_has_t";
  case 1027: return "DaeBuilder_nx";
  case 1028: return "DaeBuilder_nz";
  case 1029: return "DaeBuilder_nq";
  case 1030: return "DaeBuilder_ny";
  case 1031: return "DaeBuilder_nu";
  case 1032: return "DaeBuilder_np";
  case 1033: return "DaeBuilder_nc";
  case 1034: return "DaeBuilder_nd";
  case 1035: return "DaeBuilder_nw";
  case 1036: return "DaeBuilder_add_t";
  case 1037: return "DaeBuilder_add_p";
  case 1038: return "DaeBuilder_add_u";
  case 1039: return "DaeBuilder_add_x";
  case 1040: return "DaeBuilder_add_z";
  case 1041: return "DaeBuilder_add_q";
  case 1042: return "DaeBuilder_add_c";
  case 1043: return "DaeBuilder_add_d";
  case 1044: return "DaeBuilder_add_w";
  case 1045: return "DaeBuilder_add_y";
  case 1046: return "DaeBuilder_set_ode";
  case 1047: return "DaeBuilder_set_alg";
  case 1048: return "DaeBuilder_add_aux";
  case 1049: return "DaeBuilder_add_init";
  case 1050: return "DaeBuilder_add_when";
  case 1051: return "DaeBuilder_sanity_check";
  case 1052: return "DaeBuilder_clear_all";
  case 1053: return "DaeBuilder_set_all";
  case 1054: return "DaeBuilder_register_t";
  case 1055: return "DaeBuilder_register_p";
  case 1056: return "DaeBuilder_register_u";
  case 1057: return "DaeBuilder_register_x";
  case 1058: return "DaeBuilder_register_z";
  case 1059: return "DaeBuilder_register_q";
  case 1060: return "DaeBuilder_register_c";
  case 1061: return "DaeBuilder_register_d";
  case 1062: return "DaeBuilder_register_w";
  case 1063: return "DaeBuilder_register_y";
  case 1064: return "DaeBuilder_set_u";
  case 1065: return "DaeBuilder_set_x";
  case 1066: return "DaeBuilder_set_z";
  case 1067: return "DaeBuilder_set_q";
  case 1068: return "DaeBuilder_set_y";
  case 1069: return "DaeBuilder_clear_in";
  case 1070: return "DaeBuilder_eliminate_w";
  case 1071: return "DaeBuilder_lift";
  case 1072: return "DaeBuilder_eliminate_quad";
  case 1073: return "DaeBuilder_sort_d";
  case 1074: return "DaeBuilder_sort_w";
  case 1075: return "DaeBuilder_sort_z";
  case 1076: return "DaeBuilder_prune";
  case 1077: return "DaeBuilder_tear";
  case 1078: return "DaeBuilder_add_fun";
  case 1079: return "DaeBuilder_has_fun";
  case 1080: return "DaeBuilder_fun";
  case 1081: return "DaeBuilder_gather_fun";
  case 1082: return "DaeBuilder_parse_fmi";
  case 1083: return "DaeBuilder_provides_directional_derivative";
  case 1084: return "DaeBuilder_load_fmi_description";
  case 1085: return "DaeBuilder_export_fmu";
  case 1086: return "DaeBuilder_add_lc";
  case 1087: return "DaeBuilder_create";
  case 1088: return "DaeBuilder_dependent_fun";
  case 1089: return "DaeBuilder_var";
  case 1090: return "DaeBuilder_paren";
  case 1091: return "DaeBuilder_der";
  case 1092: return "DaeBuilder_beq";
  case 1093: return "DaeBuilder_set_beq";
  case 1094: return "DaeBuilder_value_reference";
  case 1095: return "DaeBuilder_set_value_reference";
  case 1096: return "DaeBuilder_description";
  case 1097: return "DaeBuilder_set_description";
  case 1098: return "DaeBuilder_type";
  case 1099: return "DaeBuilder_set_type";
  case 1100: return "DaeBuilder_causality";
  case 1101: return "DaeBuilder_set_causality";
  case 1102: return "DaeBuilder_variability";
  case 1103: return "DaeBuilder_set_variability";
  case 1104: return "DaeBuilder_initial";
  case 1105: return "DaeBuilder_set_initial";
  case 1106: return "DaeBuilder_unit";
  case 1107: return "DaeBuilder_set_unit";
  case 1108: return "DaeBuilder_display_unit";
  case 1109: return "DaeBuilder_set_display_unit";
  case 1110: return "DaeBuilder_numel";
  case 1111: return "DaeBuilder_dimension";
  case 1112: return "DaeBuilder_attribute";
  case 1113: return "DaeBuilder_set_attribute";
  case 1114: return "DaeBuilder_min";
  case 1115: return "DaeBuilder_set_min";
  case 1116: return "DaeBuilder_max";
  case 1117: return "DaeBuilder_set_max";
  case 1118: return "DaeBuilder_nominal";
  case 1119: return "DaeBuilder_set_nominal";
  case 1120: return "DaeBuilder_start";
  case 1121: return "DaeBuilder_set_start";
  case 1122: return "DaeBuilder_set";
  case 1123: return "DaeBuilder_get";
  case 1124: return "DaeBuilder_add_variable";
  case 1125: return "DaeBuilder_add_variable_new";
  case 1126: return "DaeBuilder_has_variable";
  case 1127: return "DaeBuilder_all_variables";
  case 1128: return "DaeBuilder_oracle";
  case 1129: return "DaeBuilder_jac_sparsity";
  case 1130: return "new_DaeBuilder";
  case 1131: return "delete_DaeBuilder";
  case 1132: return "XmlFile_type_name";
  case 1133: return "delete_XmlFile";
  case 1134: return "XmlFile_load_plugin";
  case 1135: return "XmlFile_doc";
  case 1136: return "new_XmlFile";
  case 1137: return "delete_SerializerBase";
  case 1138: return "SerializerBase_pack";
  case 1139: return "SerializerBase_type_to_string";
  case 1140: return "SerializerBase_connect";
  case 1141: return "SerializerBase_reset";
  case 1142: return "delete_DeserializerBase";
  case 1143: return "DeserializerBase_internal_pop_type";
  case 1144: return "DeserializerBase_blind_unpack_sparsity";
  case 1145: return "DeserializerBase_blind_unpack_mx";
  case 1146: return "DeserializerBase_blind_unpack_dm";
  case 1147: return "DeserializerBase_blind_unpack_sx";
  case 1148: return "DeserializerBase_blind_unpack_linsol";
  case 1149: return "DeserializerBase_blind_unpack_function";
  case 1150: return "DeserializerBase_blind_unpack_generictype";
  case 1151: return "DeserializerBase_blind_unpack_int";
  case 1152: return "DeserializerBase_blind_unpack_double";
  case 1153: return "DeserializerBase_blind_unpack_string";
  case 1154: return "DeserializerBase_blind_unpack_sparsity_vector";
  case 1155: return "DeserializerBase_blind_unpack_mx_vector";
  case 1156: return "DeserializerBase_blind_unpack_dm_vector";
  case 1157: return "DeserializerBase_blind_unpack_sx_vector";
  case 1158: return "DeserializerBase_blind_unpack_linsol_vector";
  case 1159: return "DeserializerBase_blind_unpack_function_vector";
  case 1160: return "DeserializerBase_blind_unpack_generictype_vector";
  case 1161: return "DeserializerBase_blind_unpack_int_vector";
  case 1162: return "DeserializerBase_blind_unpack_double_vector";
  case 1163: return "DeserializerBase_blind_unpack_string_vector";
  case 1164: return "DeserializerBase_unpack_sparsity";
  case 1165: return "DeserializerBase_unpack_mx";
  case 1166: return "DeserializerBase_unpack_dm";
  case 1167: return "DeserializerBase_unpack_sx";
  case 1168: return "DeserializerBase_unpack_linsol";
  case 1169: return "DeserializerBase_unpack_function";
  case 1170: return "DeserializerBase_unpack_generictype";
  case 1171: return "DeserializerBase_unpack_int";
  case 1172: return "DeserializerBase_unpack_double";
  case 1173: return "DeserializerBase_unpack_string";
  case 1174: return "DeserializerBase_unpack_sparsity_vector";
  case 1175: return "DeserializerBase_unpack_mx_vector";
  case 1176: return "DeserializerBase_unpack_dm_vector";
  case 1177: return "DeserializerBase_unpack_sx_vector";
  case 1178: return "DeserializerBase_unpack_linsol_vector";
  case 1179: return "DeserializerBase_unpack_function_vector";
  case 1180: return "DeserializerBase_unpack_generictype_vector";
  case 1181: return "DeserializerBase_unpack_int_vector";
  case 1182: return "DeserializerBase_unpack_double_vector";
  case 1183: return "DeserializerBase_unpack_string_vector";
  case 1184: return "DeserializerBase_connect";
  case 1185: return "DeserializerBase_reset";
  case 1186: return "new_StringSerializer";
  case 1187: return "delete_StringSerializer";
  case 1188: return "StringSerializer_encode";
  case 1189: return "new_FileSerializer";
  case 1190: return "delete_FileSerializer";
  case 1191: return "new_StringDeserializer";
  case 1192: return "delete_StringDeserializer";
  case 1193: return "StringDeserializer_decode";
  case 1194: return "new_FileDeserializer";
  case 1195: return "delete_FileDeserializer";
  case 1196: return "Opti_internal_variable";
  case 1197: return "Opti_internal_parameter";
  case 1198: return "Opti_minimize";
  case 1199: return "Opti_internal_subject_to";
  case 1200: return "Opti_solver";
  case 1201: return "Opti_set_initial";
  case 1202: return "Opti_set_value";
  case 1203: return "Opti_solve";
  case 1204: return "Opti_solve_limited";
  case 1205: return "Opti_value";
  case 1206: return "Opti_stats";
  case 1207: return "Opti_return_status";
  case 1208: return "Opti_initial";
  case 1209: return "Opti_value_variables";
  case 1210: return "Opti_value_parameters";
  case 1211: return "Opti_dual";
  case 1212: return "Opti_nx";
  case 1213: return "Opti_np";
  case 1214: return "Opti_ng";
  case 1215: return "Opti_x";
  case 1216: return "Opti_p";
  case 1217: return "Opti_g";
  case 1218: return "Opti_f";
  case 1219: return "Opti_lbg";
  case 1220: return "Opti_ubg";
  case 1221: return "Opti_lam_g";
  case 1222: return "Opti_to_function";
  case 1223: return "Opti_debug";
  case 1224: return "Opti_advanced";
  case 1225: return "Opti_copy";
  case 1226: return "Opti_update_user_dict";
  case 1227: return "Opti_user_dict";
  case 1228: return "Opti_type_name";
  case 1229: return "Opti_disp";
  case 1230: return "Opti_str";
  case 1231: return "Opti_callback_class";
  case 1232: return "new_Opti";
  case 1233: return "delete_Opti";
  case 1234: return "IndexAbstraction_start_get";
  case 1235: return "IndexAbstraction_stop_get";
  case 1236: return "new_IndexAbstraction";
  case 1237: return "delete_IndexAbstraction";
  case 1238: return "MetaCon_original_get";
  case 1239: return "MetaCon_canon_get";
  case 1240: return "MetaCon_type_get";
  case 1241: return "MetaCon_lb_get";
  case 1242: return "MetaCon_ub_get";
  case 1243: return "MetaCon_n_get";
  case 1244: return "MetaCon_flipped_get";
  case 1245: return "MetaCon_dual_canon_get";
  case 1246: return "MetaCon_dual_get";
  case 1247: return "MetaCon_extra_get";
  case 1248: return "new_MetaCon";
  case 1249: return "delete_MetaCon";
  case 1250: return "MetaVar_attribute_get";
  case 1251: return "MetaVar_n_get";
  case 1252: return "MetaVar_m_get";
  case 1253: return "MetaVar_type_get";
  case 1254: return "MetaVar_count_get";
  case 1255: return "MetaVar_i_get";
  case 1256: return "MetaVar_active_i_get";
  case 1257: return "MetaVar_extra_get";
  case 1258: return "new_MetaVar";
  case 1259: return "delete_MetaVar";
  case 1260: return "new_OptiCallback";
  case 1261: return "OptiCallback_call";
  case 1262: return "delete_OptiCallback";
  case 1263: return "delete_OptiAdvanced";
  case 1264: return "OptiAdvanced_solver";
  case 1265: return "OptiAdvanced_is_parametric";
  case 1266: return "OptiAdvanced_symvar";
  case 1267: return "OptiAdvanced_canon_expr";
  case 1268: return "OptiAdvanced_get_meta";
  case 1269: return "OptiAdvanced_get_meta_con";
  case 1270: return "OptiAdvanced_set_meta";
  case 1271: return "OptiAdvanced_set_meta_con";
  case 1272: return "OptiAdvanced_assert_active_symbol";
  case 1273: return "OptiAdvanced_active_symvar";
  case 1274: return "OptiAdvanced_active_values";
  case 1275: return "OptiAdvanced_x_lookup";
  case 1276: return "OptiAdvanced_g_lookup";
  case 1277: return "OptiAdvanced_x_describe";
  case 1278: return "OptiAdvanced_g_describe";
  case 1279: return "OptiAdvanced_describe";
  case 1280: return "OptiAdvanced_show_infeasibilities";
  case 1281: return "OptiAdvanced_solve_prepare";
  case 1282: return "OptiAdvanced_solve_actual";
  case 1283: return "OptiAdvanced_arg";
  case 1284: return "OptiAdvanced_res";
  case 1285: return "OptiAdvanced_constraints";
  case 1286: return "OptiAdvanced_objective";
  case 1287: return "OptiAdvanced_baked_copy";
  case 1288: return "OptiAdvanced_assert_empty";
  case 1289: return "OptiAdvanced_bake";
  case 1290: return "OptiAdvanced_problem_dirty__get";
  case 1291: return "OptiAdvanced_mark_problem_dirty";
  case 1292: return "OptiAdvanced_problem_dirty";
  case 1293: return "OptiAdvanced_solver_dirty__get";
  case 1294: return "OptiAdvanced_mark_solver_dirty";
  case 1295: return "OptiAdvanced_solver_dirty";
  case 1296: return "OptiAdvanced_solved__get";
  case 1297: return "OptiAdvanced_mark_solved";
  case 1298: return "OptiAdvanced_solved";
  case 1299: return "OptiAdvanced_assert_solved";
  case 1300: return "OptiAdvanced_assert_baked";
  case 1301: return "OptiAdvanced_instance_number";
  case 1302: return "new_OptiAdvanced";
  case 1303: return "OptiSol_type_name";
  case 1304: return "OptiSol_disp";
  case 1305: return "OptiSol_str";
  case 1306: return "OptiSol_value";
  case 1307: return "OptiSol_value_variables";
  case 1308: return "OptiSol_value_parameters";
  case 1309: return "OptiSol_stats";
  case 1310: return "OptiSol_opti";
  case 1311: return "new_OptiSol";
  case 1312: return "delete_OptiSol";
  default: return 0;
  }
}

SWIGINTERN int swigFunctionName(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc!=1 || !mxIsDouble(*argv) || mxGetNumberOfElements(*argv)!=1) {
    SWIG_Error(SWIG_RuntimeError, "This mex file should only be called from inside the .m files generated by SWIG. The input should be the function ID.");
    return 1;
  }
  if (resc!=1) {
    SWIG_Error(SWIG_RuntimeError, "The function should have one output.");
    return 1;
  }
  int fcn_id = (int)mxGetScalar(*argv);
  const char* s = SwigFunctionName(fcn_id);
  if (s==0) {
    SWIG_Error(SWIG_RuntimeError, "No such function ID.");
    return 1;
  }
  *resv = mxCreateString(s);
  return 0;
}

SWIGINTERN int swigThis(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  if (argc!=1 || resc!=1) {
    SWIG_Error(SWIG_RuntimeError, "swigThis should have one input and one output.");
    return 1;
  }
  SwigPtr* swig_ptr = SWIG_Matlab_getSwigPtr(argv[0]);
  if (!swig_ptr) {
    SWIG_Error(SWIG_RuntimeError, "The argument should be a SWIG class.");
    return 1;
  }
  resv[0] = mxCreateNumericMatrix(1, 1, mxUINT64_CLASS, mxREAL);
  *(uint64_T *)mxGetData(resv[0]) = (uint64_T)swig_ptr->ptr;
  return 0;
}

SWIGINTERN int swigTouch(int resc, mxArray** SWIGUNUSEDPARM(resv), int argc, mxArray** SWIGUNUSEDPARM(argv)) {
  if (argc!=0 || resc!=0) {
    SWIG_Error(SWIG_RuntimeError, "swigTouch should have no inputs or outputs.");
    return 1;
  }
  return 0;
}

extern "C"
SWIGEXPORT
void mexFunction(int resc, mxArray *resv[], int argc, const mxArray *argv[]) {
  /* Initialize module if first call */
  SWIG_Matlab_LoadModule();

  if (--argc < 0 || !mxIsDouble(*argv) || mxGetNumberOfElements(*argv)!=1)
    SWIG_Matlab_Error("This mex file should only be called from inside the .m files generated by SWIG. First input should be the function ID .");
  int fcn_id = (int)mxGetScalar(*argv++);
  int flag=0;
  switch (fcn_id) {
  case 0: flag=swigConstant(resc,resv,argc,(mxArray**)(argv)); break;
  case 1: flag=swigFunctionName(resc,resv,argc,(mxArray**)(argv)); break;
  case 2: flag=swigConstantName(resc,resv,argc,(mxArray**)(argv)); break;
  case 3: flag=swigThis(resc,resv,argc,(mxArray**)(argv)); break;
  case 4: flag=swigTouch(resc,resv,argc,(mxArray**)(argv)); break;
  case 5: flag=_wrap_delete_MatlabSwigIterator(resc,resv,argc,(mxArray**)(argv)); break;
  case 6: flag=_wrap_MatlabSwigIterator_value(resc,resv,argc,(mxArray**)(argv)); break;
  case 7: flag=_wrap_MatlabSwigIterator_incr(resc,resv,argc,(mxArray**)(argv)); break;
  case 8: flag=_wrap_MatlabSwigIterator_decr(resc,resv,argc,(mxArray**)(argv)); break;
  case 9: flag=_wrap_MatlabSwigIterator_distance(resc,resv,argc,(mxArray**)(argv)); break;
  case 10: flag=_wrap_MatlabSwigIterator_equal(resc,resv,argc,(mxArray**)(argv)); break;
  case 11: flag=_wrap_MatlabSwigIterator_copy(resc,resv,argc,(mxArray**)(argv)); break;
  case 12: flag=_wrap_MatlabSwigIterator_next(resc,resv,argc,(mxArray**)(argv)); break;
  case 13: flag=_wrap_MatlabSwigIterator_previous(resc,resv,argc,(mxArray**)(argv)); break;
  case 14: flag=_wrap_MatlabSwigIterator_advance(resc,resv,argc,(mxArray**)(argv)); break;
  case 15: flag=_wrap_MatlabSwigIterator_eq(resc,resv,argc,(mxArray**)(argv)); break;
  case 16: flag=_wrap_MatlabSwigIterator_ne(resc,resv,argc,(mxArray**)(argv)); break;
  case 17: flag=_wrap_MatlabSwigIterator_TODOincr(resc,resv,argc,(mxArray**)(argv)); break;
  case 18: flag=_wrap_MatlabSwigIterator_TODOdecr(resc,resv,argc,(mxArray**)(argv)); break;
  case 19: flag=_wrap_MatlabSwigIterator_plus(resc,resv,argc,(mxArray**)(argv)); break;
  case 20: flag=_wrap_MatlabSwigIterator_minus(resc,resv,argc,(mxArray**)(argv)); break;
  case 21: flag=_wrap_new_PrintableCommon(resc,resv,argc,(mxArray**)(argv)); break;
  case 22: flag=_wrap_delete_PrintableCommon(resc,resv,argc,(mxArray**)(argv)); break;
  case 23: flag=_wrap_SharedObject_class_name(resc,resv,argc,(mxArray**)(argv)); break;
  case 24: flag=_wrap_SharedObject_disp(resc,resv,argc,(mxArray**)(argv)); break;
  case 25: flag=_wrap_SharedObject_str(resc,resv,argc,(mxArray**)(argv)); break;
  case 26: flag=_wrap_SharedObject_print_ptr(resc,resv,argc,(mxArray**)(argv)); break;
  case 27: flag=_wrap_SharedObject_is_null(resc,resv,argc,(mxArray**)(argv)); break;
  case 28: flag=_wrap_SharedObject_hash(resc,resv,argc,(mxArray**)(argv)); break;
  case 29: flag=_wrap_new_SharedObject(resc,resv,argc,(mxArray**)(argv)); break;
  case 30: flag=_wrap_delete_SharedObject(resc,resv,argc,(mxArray**)(argv)); break;
  case 31: flag=_wrap_WeakRef_shared(resc,resv,argc,(mxArray**)(argv)); break;
  case 32: flag=_wrap_WeakRef_alive(resc,resv,argc,(mxArray**)(argv)); break;
  case 33: flag=_wrap_new_WeakRef(resc,resv,argc,(mxArray**)(argv)); break;
  case 34: flag=_wrap_delete_WeakRef(resc,resv,argc,(mxArray**)(argv)); break;
  case 35: flag=_wrap_complement(resc,resv,argc,(mxArray**)(argv)); break;
  case 36: flag=_wrap_lookupvector(resc,resv,argc,(mxArray**)(argv)); break;
  case 37: flag=_wrap_temporary_file(resc,resv,argc,(mxArray**)(argv)); break;
  case 38: flag=_wrap_normalized_setup(resc,resv,argc,(mxArray**)(argv)); break;
  case 39: flag=_wrap_normalized_out(resc,resv,argc,(mxArray**)(argv)); break;
  case 40: flag=_wrap_normalized_in(resc,resv,argc,(mxArray**)(argv)); break;
  case 41: flag=_wrap_GenericType_serialize(resc,resv,argc,(mxArray**)(argv)); break;
  case 42: flag=_wrap_GenericType_deserialize(resc,resv,argc,(mxArray**)(argv)); break;
  case 43: flag=_wrap_new_GenericType(resc,resv,argc,(mxArray**)(argv)); break;
  case 44: flag=_wrap_delete_GenericType(resc,resv,argc,(mxArray**)(argv)); break;
  case 45: flag=_wrap_SparsityInterfaceCommon_horzcat(resc,resv,argc,(mxArray**)(argv)); break;
  case 46: flag=_wrap_SparsityInterfaceCommon_vertcat(resc,resv,argc,(mxArray**)(argv)); break;
  case 47: flag=_wrap_SparsityInterfaceCommon_horzsplit(resc,resv,argc,(mxArray**)(argv)); break;
  case 48: flag=_wrap_SparsityInterfaceCommon_horzsplit_n(resc,resv,argc,(mxArray**)(argv)); break;
  case 49: flag=_wrap_SparsityInterfaceCommon_offset(resc,resv,argc,(mxArray**)(argv)); break;
  case 50: flag=_wrap_SparsityInterfaceCommon_vertsplit(resc,resv,argc,(mxArray**)(argv)); break;
  case 51: flag=_wrap_SparsityInterfaceCommon_vertsplit_n(resc,resv,argc,(mxArray**)(argv)); break;
  case 52: flag=_wrap_SparsityInterfaceCommon_blockcat(resc,resv,argc,(mxArray**)(argv)); break;
  case 53: flag=_wrap_SparsityInterfaceCommon_blocksplit(resc,resv,argc,(mxArray**)(argv)); break;
  case 54: flag=_wrap_SparsityInterfaceCommon_diagcat(resc,resv,argc,(mxArray**)(argv)); break;
  case 55: flag=_wrap_SparsityInterfaceCommon_diagsplit(resc,resv,argc,(mxArray**)(argv)); break;
  case 56: flag=_wrap_SparsityInterfaceCommon_veccat(resc,resv,argc,(mxArray**)(argv)); break;
  case 57: flag=_wrap_SparsityInterfaceCommon_mtimes(resc,resv,argc,(mxArray**)(argv)); break;
  case 58: flag=_wrap_SparsityInterfaceCommon_mac(resc,resv,argc,(mxArray**)(argv)); break;
  case 59: flag=_wrap_SparsityInterfaceCommon_transpose(resc,resv,argc,(mxArray**)(argv)); break;
  case 60: flag=_wrap_SparsityInterfaceCommon_vec(resc,resv,argc,(mxArray**)(argv)); break;
  case 61: flag=_wrap_SparsityInterfaceCommon_reshape(resc,resv,argc,(mxArray**)(argv)); break;
  case 62: flag=_wrap_SparsityInterfaceCommon_sparsity_cast(resc,resv,argc,(mxArray**)(argv)); break;
  case 63: flag=_wrap_SparsityInterfaceCommon_sprank(resc,resv,argc,(mxArray**)(argv)); break;
  case 64: flag=_wrap_SparsityInterfaceCommon_norm_0_mul(resc,resv,argc,(mxArray**)(argv)); break;
  case 65: flag=_wrap_SparsityInterfaceCommon_triu(resc,resv,argc,(mxArray**)(argv)); break;
  case 66: flag=_wrap_SparsityInterfaceCommon_tril(resc,resv,argc,(mxArray**)(argv)); break;
  case 67: flag=_wrap_SparsityInterfaceCommon_kron(resc,resv,argc,(mxArray**)(argv)); break;
  case 68: flag=_wrap_SparsityInterfaceCommon_repmat(resc,resv,argc,(mxArray**)(argv)); break;
  case 69: flag=_wrap_SparsityInterfaceCommon_sum2(resc,resv,argc,(mxArray**)(argv)); break;
  case 70: flag=_wrap_SparsityInterfaceCommon_sum1(resc,resv,argc,(mxArray**)(argv)); break;
  case 71: flag=_wrap_SparsityInterfaceCommon_length(resc,resv,argc,(mxArray**)(argv)); break;
  case 72: flag=_wrap_new_SparsityInterfaceCommon(resc,resv,argc,(mxArray**)(argv)); break;
  case 73: flag=_wrap_delete_SparsityInterfaceCommon(resc,resv,argc,(mxArray**)(argv)); break;
  case 74: flag=_wrap_Sparsity_scalar(resc,resv,argc,(mxArray**)(argv)); break;
  case 75: flag=_wrap_Sparsity_dense(resc,resv,argc,(mxArray**)(argv)); break;
  case 76: flag=_wrap_Sparsity_unit(resc,resv,argc,(mxArray**)(argv)); break;
  case 77: flag=_wrap_Sparsity_upper(resc,resv,argc,(mxArray**)(argv)); break;
  case 78: flag=_wrap_Sparsity_lower(resc,resv,argc,(mxArray**)(argv)); break;
  case 79: flag=_wrap_Sparsity_diag(resc,resv,argc,(mxArray**)(argv)); break;
  case 80: flag=_wrap_Sparsity_band(resc,resv,argc,(mxArray**)(argv)); break;
  case 81: flag=_wrap_Sparsity_banded(resc,resv,argc,(mxArray**)(argv)); break;
  case 82: flag=_wrap_Sparsity_rowcol(resc,resv,argc,(mxArray**)(argv)); break;
  case 83: flag=_wrap_Sparsity_triplet(resc,resv,argc,(mxArray**)(argv)); break;
  case 84: flag=_wrap_Sparsity_nonzeros(resc,resv,argc,(mxArray**)(argv)); break;
  case 85: flag=_wrap_Sparsity_compressed(resc,resv,argc,(mxArray**)(argv)); break;
  case 86: flag=_wrap_Sparsity_permutation(resc,resv,argc,(mxArray**)(argv)); break;
  case 87: flag=_wrap_Sparsity_permutation_vector(resc,resv,argc,(mxArray**)(argv)); break;
  case 88: flag=_wrap_Sparsity_get_diag(resc,resv,argc,(mxArray**)(argv)); break;
  case 89: flag=_wrap_Sparsity_compress(resc,resv,argc,(mxArray**)(argv)); break;
  case 90: flag=_wrap_Sparsity_is_equal(resc,resv,argc,(mxArray**)(argv)); break;
  case 91: flag=_wrap_Sparsity_eq(resc,resv,argc,(mxArray**)(argv)); break;
  case 92: flag=_wrap_Sparsity_ne(resc,resv,argc,(mxArray**)(argv)); break;
  case 93: flag=_wrap_Sparsity_is_stacked(resc,resv,argc,(mxArray**)(argv)); break;
  case 94: flag=_wrap_Sparsity_size1(resc,resv,argc,(mxArray**)(argv)); break;
  case 95: flag=_wrap_Sparsity_rows(resc,resv,argc,(mxArray**)(argv)); break;
  case 96: flag=_wrap_Sparsity_size2(resc,resv,argc,(mxArray**)(argv)); break;
  case 97: flag=_wrap_Sparsity_columns(resc,resv,argc,(mxArray**)(argv)); break;
  case 98: flag=_wrap_Sparsity_numel(resc,resv,argc,(mxArray**)(argv)); break;
  case 99: flag=_wrap_Sparsity_density(resc,resv,argc,(mxArray**)(argv)); break;
  case 100: flag=_wrap_Sparsity_is_empty(resc,resv,argc,(mxArray**)(argv)); break;
  case 101: flag=_wrap_Sparsity_nnz(resc,resv,argc,(mxArray**)(argv)); break;
  case 102: flag=_wrap_Sparsity_nnz_upper(resc,resv,argc,(mxArray**)(argv)); break;
  case 103: flag=_wrap_Sparsity_nnz_lower(resc,resv,argc,(mxArray**)(argv)); break;
  case 104: flag=_wrap_Sparsity_nnz_diag(resc,resv,argc,(mxArray**)(argv)); break;
  case 105: flag=_wrap_Sparsity_bw_upper(resc,resv,argc,(mxArray**)(argv)); break;
  case 106: flag=_wrap_Sparsity_bw_lower(resc,resv,argc,(mxArray**)(argv)); break;
  case 107: flag=_wrap_Sparsity_size(resc,resv,argc,(mxArray**)(argv)); break;
  case 108: flag=_wrap_Sparsity_info(resc,resv,argc,(mxArray**)(argv)); break;
  case 109: flag=_wrap_Sparsity_to_file(resc,resv,argc,(mxArray**)(argv)); break;
  case 110: flag=_wrap_Sparsity_from_file(resc,resv,argc,(mxArray**)(argv)); break;
  case 111: flag=_wrap_Sparsity_serialize(resc,resv,argc,(mxArray**)(argv)); break;
  case 112: flag=_wrap_Sparsity_deserialize(resc,resv,argc,(mxArray**)(argv)); break;
  case 113: flag=_wrap_Sparsity_colind(resc,resv,argc,(mxArray**)(argv)); break;
  case 114: flag=_wrap_Sparsity_row(resc,resv,argc,(mxArray**)(argv)); break;
  case 115: flag=_wrap_Sparsity_get_col(resc,resv,argc,(mxArray**)(argv)); break;
  case 116: flag=_wrap_Sparsity_resize(resc,resv,argc,(mxArray**)(argv)); break;
  case 117: flag=_wrap_Sparsity_add_nz(resc,resv,argc,(mxArray**)(argv)); break;
  case 118: flag=_wrap_Sparsity_has_nz(resc,resv,argc,(mxArray**)(argv)); break;
  case 119: flag=_wrap_Sparsity_get_nz(resc,resv,argc,(mxArray**)(argv)); break;
  case 120: flag=_wrap_Sparsity_get_lower(resc,resv,argc,(mxArray**)(argv)); break;
  case 121: flag=_wrap_Sparsity_get_upper(resc,resv,argc,(mxArray**)(argv)); break;
  case 122: flag=_wrap_Sparsity_get_ccs(resc,resv,argc,(mxArray**)(argv)); break;
  case 123: flag=_wrap_Sparsity_get_crs(resc,resv,argc,(mxArray**)(argv)); break;
  case 124: flag=_wrap_Sparsity_get_triplet(resc,resv,argc,(mxArray**)(argv)); break;
  case 125: flag=_wrap_Sparsity_sub(resc,resv,argc,(mxArray**)(argv)); break;
  case 126: flag=_wrap_Sparsity_T(resc,resv,argc,(mxArray**)(argv)); break;
  case 127: flag=_wrap_Sparsity_transpose(resc,resv,argc,(mxArray**)(argv)); break;
  case 128: flag=_wrap_Sparsity_is_transpose(resc,resv,argc,(mxArray**)(argv)); break;
  case 129: flag=_wrap_Sparsity_is_reshape(resc,resv,argc,(mxArray**)(argv)); break;
  case 130: flag=_wrap_Sparsity_combine(resc,resv,argc,(mxArray**)(argv)); break;
  case 131: flag=_wrap_Sparsity_unite(resc,resv,argc,(mxArray**)(argv)); break;
  case 132: flag=_wrap_Sparsity_plus(resc,resv,argc,(mxArray**)(argv)); break;
  case 133: flag=_wrap_Sparsity_intersect(resc,resv,argc,(mxArray**)(argv)); break;
  case 134: flag=_wrap_Sparsity_mtimes(resc,resv,argc,(mxArray**)(argv)); break;
  case 135: flag=_wrap_Sparsity_is_subset(resc,resv,argc,(mxArray**)(argv)); break;
  case 136: flag=_wrap_Sparsity_sparsity_cast_mod(resc,resv,argc,(mxArray**)(argv)); break;
  case 137: flag=_wrap_Sparsity_pattern_inverse(resc,resv,argc,(mxArray**)(argv)); break;
  case 138: flag=_wrap_Sparsity_enlarge(resc,resv,argc,(mxArray**)(argv)); break;
  case 139: flag=_wrap_Sparsity_enlargeRows(resc,resv,argc,(mxArray**)(argv)); break;
  case 140: flag=_wrap_Sparsity_enlargeColumns(resc,resv,argc,(mxArray**)(argv)); break;
  case 141: flag=_wrap_Sparsity_makeDense(resc,resv,argc,(mxArray**)(argv)); break;
  case 142: flag=_wrap_Sparsity_erase(resc,resv,argc,(mxArray**)(argv)); break;
  case 143: flag=_wrap_Sparsity_append(resc,resv,argc,(mxArray**)(argv)); break;
  case 144: flag=_wrap_Sparsity_appendColumns(resc,resv,argc,(mxArray**)(argv)); break;
  case 145: flag=_wrap_Sparsity_is_scalar(resc,resv,argc,(mxArray**)(argv)); break;
  case 146: flag=_wrap_Sparsity_is_dense(resc,resv,argc,(mxArray**)(argv)); break;
  case 147: flag=_wrap_Sparsity_is_row(resc,resv,argc,(mxArray**)(argv)); break;
  case 148: flag=_wrap_Sparsity_is_column(resc,resv,argc,(mxArray**)(argv)); break;
  case 149: flag=_wrap_Sparsity_is_vector(resc,resv,argc,(mxArray**)(argv)); break;
  case 150: flag=_wrap_Sparsity_is_diag(resc,resv,argc,(mxArray**)(argv)); break;
  case 151: flag=_wrap_Sparsity_is_square(resc,resv,argc,(mxArray**)(argv)); break;
  case 152: flag=_wrap_Sparsity_is_symmetric(resc,resv,argc,(mxArray**)(argv)); break;
  case 153: flag=_wrap_Sparsity_is_triu(resc,resv,argc,(mxArray**)(argv)); break;
  case 154: flag=_wrap_Sparsity_is_tril(resc,resv,argc,(mxArray**)(argv)); break;
  case 155: flag=_wrap_Sparsity_is_singular(resc,resv,argc,(mxArray**)(argv)); break;
  case 156: flag=_wrap_Sparsity_is_permutation(resc,resv,argc,(mxArray**)(argv)); break;
  case 157: flag=_wrap_Sparsity_is_selection(resc,resv,argc,(mxArray**)(argv)); break;
  case 158: flag=_wrap_Sparsity_is_orthonormal(resc,resv,argc,(mxArray**)(argv)); break;
  case 159: flag=_wrap_Sparsity_is_orthonormal_rows(resc,resv,argc,(mxArray**)(argv)); break;
  case 160: flag=_wrap_Sparsity_is_orthonormal_columns(resc,resv,argc,(mxArray**)(argv)); break;
  case 161: flag=_wrap_Sparsity_rowsSequential(resc,resv,argc,(mxArray**)(argv)); break;
  case 162: flag=_wrap_Sparsity_removeDuplicates(resc,resv,argc,(mxArray**)(argv)); break;
  case 163: flag=_wrap_Sparsity_etree(resc,resv,argc,(mxArray**)(argv)); break;
  case 164: flag=_wrap_Sparsity_ldl(resc,resv,argc,(mxArray**)(argv)); break;
  case 165: flag=_wrap_Sparsity_qr_sparse(resc,resv,argc,(mxArray**)(argv)); break;
  case 166: flag=_wrap_Sparsity_dfs(resc,resv,argc,(mxArray**)(argv)); break;
  case 167: flag=_wrap_Sparsity_scc(resc,resv,argc,(mxArray**)(argv)); break;
  case 168: flag=_wrap_Sparsity_btf(resc,resv,argc,(mxArray**)(argv)); break;
  case 169: flag=_wrap_Sparsity_amd(resc,resv,argc,(mxArray**)(argv)); break;
  case 170: flag=_wrap_Sparsity_find(resc,resv,argc,(mxArray**)(argv)); break;
  case 171: flag=_wrap_Sparsity_uni_coloring(resc,resv,argc,(mxArray**)(argv)); break;
  case 172: flag=_wrap_Sparsity_star_coloring(resc,resv,argc,(mxArray**)(argv)); break;
  case 173: flag=_wrap_Sparsity_star_coloring2(resc,resv,argc,(mxArray**)(argv)); break;
  case 174: flag=_wrap_Sparsity_largest_first(resc,resv,argc,(mxArray**)(argv)); break;
  case 175: flag=_wrap_Sparsity_pmult(resc,resv,argc,(mxArray**)(argv)); break;
  case 176: flag=_wrap_Sparsity_dim(resc,resv,argc,(mxArray**)(argv)); break;
  case 177: flag=_wrap_Sparsity_postfix_dim(resc,resv,argc,(mxArray**)(argv)); break;
  case 178: flag=_wrap_Sparsity_repr_el(resc,resv,argc,(mxArray**)(argv)); break;
  case 179: flag=_wrap_Sparsity_spy(resc,resv,argc,(mxArray**)(argv)); break;
  case 180: flag=_wrap_Sparsity_spy_matlab(resc,resv,argc,(mxArray**)(argv)); break;
  case 181: flag=_wrap_Sparsity_export_code(resc,resv,argc,(mxArray**)(argv)); break;
  case 182: flag=_wrap_Sparsity_type_name(resc,resv,argc,(mxArray**)(argv)); break;
  case 183: flag=_wrap_Sparsity_hash(resc,resv,argc,(mxArray**)(argv)); break;
  case 184: flag=_wrap_Sparsity_test_cast(resc,resv,argc,(mxArray**)(argv)); break;
  case 185: flag=_wrap_Sparsity_kkt(resc,resv,argc,(mxArray**)(argv)); break;
  case 186: flag=_wrap_new_Sparsity(resc,resv,argc,(mxArray**)(argv)); break;
  case 187: flag=_wrap_delete_Sparsity(resc,resv,argc,(mxArray**)(argv)); break;
  case 188: flag=_wrap_hash_sparsity(resc,resv,argc,(mxArray**)(argv)); break;
  case 189: flag=_wrap_Slice_start_get(resc,resv,argc,(mxArray**)(argv)); break;
  case 190: flag=_wrap_Slice_stop_get(resc,resv,argc,(mxArray**)(argv)); break;
  case 191: flag=_wrap_Slice_step_get(resc,resv,argc,(mxArray**)(argv)); break;
  case 192: flag=_wrap_Slice_all(resc,resv,argc,(mxArray**)(argv)); break;
  case 193: flag=_wrap_Slice_size(resc,resv,argc,(mxArray**)(argv)); break;
  case 194: flag=_wrap_Slice_is_empty(resc,resv,argc,(mxArray**)(argv)); break;
  case 195: flag=_wrap_Slice_is_scalar(resc,resv,argc,(mxArray**)(argv)); break;
  case 196: flag=_wrap_Slice_scalar(resc,resv,argc,(mxArray**)(argv)); break;
  case 197: flag=_wrap_Slice_eq(resc,resv,argc,(mxArray**)(argv)); break;
  case 198: flag=_wrap_Slice_ne(resc,resv,argc,(mxArray**)(argv)); break;
  case 199: flag=_wrap_Slice_apply(resc,resv,argc,(mxArray**)(argv)); break;
  case 200: flag=_wrap_Slice_minus(resc,resv,argc,(mxArray**)(argv)); break;
  case 201: flag=_wrap_Slice_mtimes(resc,resv,argc,(mxArray**)(argv)); break;
  case 202: flag=_wrap_Slice_type_name(resc,resv,argc,(mxArray**)(argv)); break;
  case 203: flag=_wrap_Slice_disp(resc,resv,argc,(mxArray**)(argv)); break;
  case 204: flag=_wrap_Slice_str(resc,resv,argc,(mxArray**)(argv)); break;
  case 205: flag=_wrap_Slice_info(resc,resv,argc,(mxArray**)(argv)); break;
  case 206: flag=_wrap_Slice_serialize(resc,resv,argc,(mxArray**)(argv)); break;
  case 207: flag=_wrap_Slice_deserialize(resc,resv,argc,(mxArray**)(argv)); break;
  case 208: flag=_wrap_new_Slice(resc,resv,argc,(mxArray**)(argv)); break;
  case 209: flag=_wrap_delete_Slice(resc,resv,argc,(mxArray**)(argv)); break;
  case 210: flag=_wrap_to_slice(resc,resv,argc,(mxArray**)(argv)); break;
  case 211: flag=_wrap_to_slice2(resc,resv,argc,(mxArray**)(argv)); break;
  case 212: flag=_wrap_is_slice(resc,resv,argc,(mxArray**)(argv)); break;
  case 213: flag=_wrap_is_slice2(resc,resv,argc,(mxArray**)(argv)); break;
  case 214: flag=_wrap_GenericMatrixCommon_mpower(resc,resv,argc,(mxArray**)(argv)); break;
  case 215: flag=_wrap_GenericMatrixCommon_mrdivide(resc,resv,argc,(mxArray**)(argv)); break;
  case 216: flag=_wrap_GenericMatrixCommon_mldivide(resc,resv,argc,(mxArray**)(argv)); break;
  case 217: flag=_wrap_GenericMatrixCommon_symvar(resc,resv,argc,(mxArray**)(argv)); break;
  case 218: flag=_wrap_GenericMatrixCommon_bilin(resc,resv,argc,(mxArray**)(argv)); break;
  case 219: flag=_wrap_GenericMatrixCommon_rank1(resc,resv,argc,(mxArray**)(argv)); break;
  case 220: flag=_wrap_GenericMatrixCommon_sumsqr(resc,resv,argc,(mxArray**)(argv)); break;
  case 221: flag=_wrap_GenericMatrixCommon_linspace(resc,resv,argc,(mxArray**)(argv)); break;
  case 222: flag=_wrap_GenericMatrixCommon_logsumexp(resc,resv,argc,(mxArray**)(argv)); break;
  case 223: flag=_wrap_GenericMatrixCommon_interp1d(resc,resv,argc,(mxArray**)(argv)); break;
  case 224: flag=_wrap_GenericMatrixCommon_soc(resc,resv,argc,(mxArray**)(argv)); break;
  case 225: flag=_wrap_GenericMatrixCommon_cross(resc,resv,argc,(mxArray**)(argv)); break;
  case 226: flag=_wrap_GenericMatrixCommon_skew(resc,resv,argc,(mxArray**)(argv)); break;
  case 227: flag=_wrap_GenericMatrixCommon_inv_skew(resc,resv,argc,(mxArray**)(argv)); break;
  case 228: flag=_wrap_GenericMatrixCommon_det(resc,resv,argc,(mxArray**)(argv)); break;
  case 229: flag=_wrap_GenericMatrixCommon_inv_minor(resc,resv,argc,(mxArray**)(argv)); break;
  case 230: flag=_wrap_GenericMatrixCommon_inv(resc,resv,argc,(mxArray**)(argv)); break;
  case 231: flag=_wrap_GenericMatrixCommon_trace(resc,resv,argc,(mxArray**)(argv)); break;
  case 232: flag=_wrap_GenericMatrixCommon_tril2symm(resc,resv,argc,(mxArray**)(argv)); break;
  case 233: flag=_wrap_GenericMatrixCommon_triu2symm(resc,resv,argc,(mxArray**)(argv)); break;
  case 234: flag=_wrap_GenericMatrixCommon_norm_fro(resc,resv,argc,(mxArray**)(argv)); break;
  case 235: flag=_wrap_GenericMatrixCommon_norm_2(resc,resv,argc,(mxArray**)(argv)); break;
  case 236: flag=_wrap_GenericMatrixCommon_norm_1(resc,resv,argc,(mxArray**)(argv)); break;
  case 237: flag=_wrap_GenericMatrixCommon_norm_inf(resc,resv,argc,(mxArray**)(argv)); break;
  case 238: flag=_wrap_GenericMatrixCommon_dot(resc,resv,argc,(mxArray**)(argv)); break;
  case 239: flag=_wrap_GenericMatrixCommon_nullspace(resc,resv,argc,(mxArray**)(argv)); break;
  case 240: flag=_wrap_GenericMatrixCommon_polyval(resc,resv,argc,(mxArray**)(argv)); break;
  case 241: flag=_wrap_GenericMatrixCommon_diag(resc,resv,argc,(mxArray**)(argv)); break;
  case 242: flag=_wrap_GenericMatrixCommon_unite(resc,resv,argc,(mxArray**)(argv)); break;
  case 243: flag=_wrap_GenericMatrixCommon_densify(resc,resv,argc,(mxArray**)(argv)); break;
  case 244: flag=_wrap_GenericMatrixCommon_project(resc,resv,argc,(mxArray**)(argv)); break;
  case 245: flag=_wrap_GenericMatrixCommon_if_else(resc,resv,argc,(mxArray**)(argv)); break;
  case 246: flag=_wrap_GenericMatrixCommon_conditional(resc,resv,argc,(mxArray**)(argv)); break;
  case 247: flag=_wrap_GenericMatrixCommon_depends_on(resc,resv,argc,(mxArray**)(argv)); break;
  case 248: flag=_wrap_GenericMatrixCommon_solve(resc,resv,argc,(mxArray**)(argv)); break;
  case 249: flag=_wrap_GenericMatrixCommon_pinv(resc,resv,argc,(mxArray**)(argv)); break;
  case 250: flag=_wrap_GenericMatrixCommon_expm_const(resc,resv,argc,(mxArray**)(argv)); break;
  case 251: flag=_wrap_GenericMatrixCommon_expm(resc,resv,argc,(mxArray**)(argv)); break;
  case 252: flag=_wrap_GenericMatrixCommon_jacobian(resc,resv,argc,(mxArray**)(argv)); break;
  case 253: flag=_wrap_GenericMatrixCommon_jtimes(resc,resv,argc,(mxArray**)(argv)); break;
  case 254: flag=_wrap_GenericMatrixCommon_linearize(resc,resv,argc,(mxArray**)(argv)); break;
  case 255: flag=_wrap_GenericMatrixCommon_which_depends(resc,resv,argc,(mxArray**)(argv)); break;
  case 256: flag=_wrap_GenericMatrixCommon_jacobian_sparsity(resc,resv,argc,(mxArray**)(argv)); break;
  case 257: flag=_wrap_GenericMatrixCommon_is_linear(resc,resv,argc,(mxArray**)(argv)); break;
  case 258: flag=_wrap_GenericMatrixCommon_is_quadratic(resc,resv,argc,(mxArray**)(argv)); break;
  case 259: flag=_wrap_GenericMatrixCommon_gradient(resc,resv,argc,(mxArray**)(argv)); break;
  case 260: flag=_wrap_GenericMatrixCommon_tangent(resc,resv,argc,(mxArray**)(argv)); break;
  case 261: flag=_wrap_GenericMatrixCommon_hessian(resc,resv,argc,(mxArray**)(argv)); break;
  case 262: flag=_wrap_GenericMatrixCommon_quadratic_coeff(resc,resv,argc,(mxArray**)(argv)); break;
  case 263: flag=_wrap_GenericMatrixCommon_linear_coeff(resc,resv,argc,(mxArray**)(argv)); break;
  case 264: flag=_wrap_GenericMatrixCommon_n_nodes(resc,resv,argc,(mxArray**)(argv)); break;
  case 265: flag=_wrap_GenericMatrixCommon_print_operator(resc,resv,argc,(mxArray**)(argv)); break;
  case 266: flag=_wrap_GenericMatrixCommon_repsum(resc,resv,argc,(mxArray**)(argv)); break;
  case 267: flag=_wrap_GenericMatrixCommon_diff(resc,resv,argc,(mxArray**)(argv)); break;
  case 268: flag=_wrap_GenericMatrixCommon_cumsum(resc,resv,argc,(mxArray**)(argv)); break;
  case 269: flag=_wrap_GenericMatrixCommon_einstein(resc,resv,argc,(mxArray**)(argv)); break;
  case 270: flag=_wrap_GenericMatrixCommon_mmin(resc,resv,argc,(mxArray**)(argv)); break;
  case 271: flag=_wrap_GenericMatrixCommon_mmax(resc,resv,argc,(mxArray**)(argv)); break;
  case 272: flag=_wrap_GenericMatrixCommon_evalf(resc,resv,argc,(mxArray**)(argv)); break;
  case 273: flag=_wrap_GenericMatrixCommon_cse(resc,resv,argc,(mxArray**)(argv)); break;
  case 274: flag=_wrap_new_GenericMatrixCommon(resc,resv,argc,(mxArray**)(argv)); break;
  case 275: flag=_wrap_delete_GenericMatrixCommon(resc,resv,argc,(mxArray**)(argv)); break;
  case 276: flag=_wrap_index_interp1d(resc,resv,argc,(mxArray**)(argv)); break;
  case 277: flag=_wrap_GenDM_nnz(resc,resv,argc,(mxArray**)(argv)); break;
  case 278: flag=_wrap_GenDM_nnz_lower(resc,resv,argc,(mxArray**)(argv)); break;
  case 279: flag=_wrap_GenDM_nnz_upper(resc,resv,argc,(mxArray**)(argv)); break;
  case 280: flag=_wrap_GenDM_nnz_diag(resc,resv,argc,(mxArray**)(argv)); break;
  case 281: flag=_wrap_GenDM_numel(resc,resv,argc,(mxArray**)(argv)); break;
  case 282: flag=_wrap_GenDM_size1(resc,resv,argc,(mxArray**)(argv)); break;
  case 283: flag=_wrap_GenDM_rows(resc,resv,argc,(mxArray**)(argv)); break;
  case 284: flag=_wrap_GenDM_size2(resc,resv,argc,(mxArray**)(argv)); break;
  case 285: flag=_wrap_GenDM_columns(resc,resv,argc,(mxArray**)(argv)); break;
  case 286: flag=_wrap_GenDM_dim(resc,resv,argc,(mxArray**)(argv)); break;
  case 287: flag=_wrap_GenDM_size(resc,resv,argc,(mxArray**)(argv)); break;
  case 288: flag=_wrap_GenDM_is_empty(resc,resv,argc,(mxArray**)(argv)); break;
  case 289: flag=_wrap_GenDM_is_dense(resc,resv,argc,(mxArray**)(argv)); break;
  case 290: flag=_wrap_GenDM_is_scalar(resc,resv,argc,(mxArray**)(argv)); break;
  case 291: flag=_wrap_GenDM_is_square(resc,resv,argc,(mxArray**)(argv)); break;
  case 292: flag=_wrap_GenDM_is_vector(resc,resv,argc,(mxArray**)(argv)); break;
  case 293: flag=_wrap_GenDM_is_row(resc,resv,argc,(mxArray**)(argv)); break;
  case 294: flag=_wrap_GenDM_is_column(resc,resv,argc,(mxArray**)(argv)); break;
  case 295: flag=_wrap_GenDM_is_triu(resc,resv,argc,(mxArray**)(argv)); break;
  case 296: flag=_wrap_GenDM_is_tril(resc,resv,argc,(mxArray**)(argv)); break;
  case 297: flag=_wrap_GenDM_row(resc,resv,argc,(mxArray**)(argv)); break;
  case 298: flag=_wrap_GenDM_colind(resc,resv,argc,(mxArray**)(argv)); break;
  case 299: flag=_wrap_GenDM_sparsity(resc,resv,argc,(mxArray**)(argv)); break;
  case 300: flag=_wrap_GenDM_sym(resc,resv,argc,(mxArray**)(argv)); break;
  case 301: flag=_wrap_GenDM_zeros(resc,resv,argc,(mxArray**)(argv)); break;
  case 302: flag=_wrap_GenDM_ones(resc,resv,argc,(mxArray**)(argv)); break;
  case 303: flag=_wrap_new_GenDM(resc,resv,argc,(mxArray**)(argv)); break;
  case 304: flag=_wrap_delete_GenDM(resc,resv,argc,(mxArray**)(argv)); break;
  case 305: flag=_wrap_GenSX_nnz(resc,resv,argc,(mxArray**)(argv)); break;
  case 306: flag=_wrap_GenSX_nnz_lower(resc,resv,argc,(mxArray**)(argv)); break;
  case 307: flag=_wrap_GenSX_nnz_upper(resc,resv,argc,(mxArray**)(argv)); break;
  case 308: flag=_wrap_GenSX_nnz_diag(resc,resv,argc,(mxArray**)(argv)); break;
  case 309: flag=_wrap_GenSX_numel(resc,resv,argc,(mxArray**)(argv)); break;
  case 310: flag=_wrap_GenSX_size1(resc,resv,argc,(mxArray**)(argv)); break;
  case 311: flag=_wrap_GenSX_rows(resc,resv,argc,(mxArray**)(argv)); break;
  case 312: flag=_wrap_GenSX_size2(resc,resv,argc,(mxArray**)(argv)); break;
  case 313: flag=_wrap_GenSX_columns(resc,resv,argc,(mxArray**)(argv)); break;
  case 314: flag=_wrap_GenSX_dim(resc,resv,argc,(mxArray**)(argv)); break;
  case 315: flag=_wrap_GenSX_size(resc,resv,argc,(mxArray**)(argv)); break;
  case 316: flag=_wrap_GenSX_is_empty(resc,resv,argc,(mxArray**)(argv)); break;
  case 317: flag=_wrap_GenSX_is_dense(resc,resv,argc,(mxArray**)(argv)); break;
  case 318: flag=_wrap_GenSX_is_scalar(resc,resv,argc,(mxArray**)(argv)); break;
  case 319: flag=_wrap_GenSX_is_square(resc,resv,argc,(mxArray**)(argv)); break;
  case 320: flag=_wrap_GenSX_is_vector(resc,resv,argc,(mxArray**)(argv)); break;
  case 321: flag=_wrap_GenSX_is_row(resc,resv,argc,(mxArray**)(argv)); break;
  case 322: flag=_wrap_GenSX_is_column(resc,resv,argc,(mxArray**)(argv)); break;
  case 323: flag=_wrap_GenSX_is_triu(resc,resv,argc,(mxArray**)(argv)); break;
  case 324: flag=_wrap_GenSX_is_tril(resc,resv,argc,(mxArray**)(argv)); break;
  case 325: flag=_wrap_GenSX_row(resc,resv,argc,(mxArray**)(argv)); break;
  case 326: flag=_wrap_GenSX_colind(resc,resv,argc,(mxArray**)(argv)); break;
  case 327: flag=_wrap_GenSX_sparsity(resc,resv,argc,(mxArray**)(argv)); break;
  case 328: flag=_wrap_GenSX_sym(resc,resv,argc,(mxArray**)(argv)); break;
  case 329: flag=_wrap_GenSX_zeros(resc,resv,argc,(mxArray**)(argv)); break;
  case 330: flag=_wrap_GenSX_ones(resc,resv,argc,(mxArray**)(argv)); break;
  case 331: flag=_wrap_new_GenSX(resc,resv,argc,(mxArray**)(argv)); break;
  case 332: flag=_wrap_delete_GenSX(resc,resv,argc,(mxArray**)(argv)); break;
  case 333: flag=_wrap_GenMX_nnz(resc,resv,argc,(mxArray**)(argv)); break;
  case 334: flag=_wrap_GenMX_nnz_lower(resc,resv,argc,(mxArray**)(argv)); break;
  case 335: flag=_wrap_GenMX_nnz_upper(resc,resv,argc,(mxArray**)(argv)); break;
  case 336: flag=_wrap_GenMX_nnz_diag(resc,resv,argc,(mxArray**)(argv)); break;
  case 337: flag=_wrap_GenMX_numel(resc,resv,argc,(mxArray**)(argv)); break;
  case 338: flag=_wrap_GenMX_size1(resc,resv,argc,(mxArray**)(argv)); break;
  case 339: flag=_wrap_GenMX_rows(resc,resv,argc,(mxArray**)(argv)); break;
  case 340: flag=_wrap_GenMX_size2(resc,resv,argc,(mxArray**)(argv)); break;
  case 341: flag=_wrap_GenMX_columns(resc,resv,argc,(mxArray**)(argv)); break;
  case 342: flag=_wrap_GenMX_dim(resc,resv,argc,(mxArray**)(argv)); break;
  case 343: flag=_wrap_GenMX_size(resc,resv,argc,(mxArray**)(argv)); break;
  case 344: flag=_wrap_GenMX_is_empty(resc,resv,argc,(mxArray**)(argv)); break;
  case 345: flag=_wrap_GenMX_is_dense(resc,resv,argc,(mxArray**)(argv)); break;
  case 346: flag=_wrap_GenMX_is_scalar(resc,resv,argc,(mxArray**)(argv)); break;
  case 347: flag=_wrap_GenMX_is_square(resc,resv,argc,(mxArray**)(argv)); break;
  case 348: flag=_wrap_GenMX_is_vector(resc,resv,argc,(mxArray**)(argv)); break;
  case 349: flag=_wrap_GenMX_is_row(resc,resv,argc,(mxArray**)(argv)); break;
  case 350: flag=_wrap_GenMX_is_column(resc,resv,argc,(mxArray**)(argv)); break;
  case 351: flag=_wrap_GenMX_is_triu(resc,resv,argc,(mxArray**)(argv)); break;
  case 352: flag=_wrap_GenMX_is_tril(resc,resv,argc,(mxArray**)(argv)); break;
  case 353: flag=_wrap_GenMX_row(resc,resv,argc,(mxArray**)(argv)); break;
  case 354: flag=_wrap_GenMX_colind(resc,resv,argc,(mxArray**)(argv)); break;
  case 355: flag=_wrap_GenMX_sparsity(resc,resv,argc,(mxArray**)(argv)); break;
  case 356: flag=_wrap_GenMX_sym(resc,resv,argc,(mxArray**)(argv)); break;
  case 357: flag=_wrap_GenMX_zeros(resc,resv,argc,(mxArray**)(argv)); break;
  case 358: flag=_wrap_GenMX_ones(resc,resv,argc,(mxArray**)(argv)); break;
  case 359: flag=_wrap_new_GenMX(resc,resv,argc,(mxArray**)(argv)); break;
  case 360: flag=_wrap_delete_GenMX(resc,resv,argc,(mxArray**)(argv)); break;
  case 361: flag=_wrap_GenericExpressionCommon_plus(resc,resv,argc,(mxArray**)(argv)); break;
  case 362: flag=_wrap_GenericExpressionCommon_minus(resc,resv,argc,(mxArray**)(argv)); break;
  case 363: flag=_wrap_GenericExpressionCommon_times(resc,resv,argc,(mxArray**)(argv)); break;
  case 364: flag=_wrap_GenericExpressionCommon_rdivide(resc,resv,argc,(mxArray**)(argv)); break;
  case 365: flag=_wrap_GenericExpressionCommon_ldivide(resc,resv,argc,(mxArray**)(argv)); break;
  case 366: flag=_wrap_GenericExpressionCommon_lt(resc,resv,argc,(mxArray**)(argv)); break;
  case 367: flag=_wrap_GenericExpressionCommon_le(resc,resv,argc,(mxArray**)(argv)); break;
  case 368: flag=_wrap_GenericExpressionCommon_gt(resc,resv,argc,(mxArray**)(argv)); break;
  case 369: flag=_wrap_GenericExpressionCommon_ge(resc,resv,argc,(mxArray**)(argv)); break;
  case 370: flag=_wrap_GenericExpressionCommon_eq(resc,resv,argc,(mxArray**)(argv)); break;
  case 371: flag=_wrap_GenericExpressionCommon_ne(resc,resv,argc,(mxArray**)(argv)); break;
  case 372: flag=_wrap_GenericExpressionCommon_and(resc,resv,argc,(mxArray**)(argv)); break;
  case 373: flag=_wrap_GenericExpressionCommon_or(resc,resv,argc,(mxArray**)(argv)); break;
  case 374: flag=_wrap_GenericExpressionCommon_not(resc,resv,argc,(mxArray**)(argv)); break;
  case 375: flag=_wrap_GenericExpressionCommon_abs(resc,resv,argc,(mxArray**)(argv)); break;
  case 376: flag=_wrap_GenericExpressionCommon_sqrt(resc,resv,argc,(mxArray**)(argv)); break;
  case 377: flag=_wrap_GenericExpressionCommon_sin(resc,resv,argc,(mxArray**)(argv)); break;
  case 378: flag=_wrap_GenericExpressionCommon_cos(resc,resv,argc,(mxArray**)(argv)); break;
  case 379: flag=_wrap_GenericExpressionCommon_tan(resc,resv,argc,(mxArray**)(argv)); break;
  case 380: flag=_wrap_GenericExpressionCommon_atan(resc,resv,argc,(mxArray**)(argv)); break;
  case 381: flag=_wrap_GenericExpressionCommon_asin(resc,resv,argc,(mxArray**)(argv)); break;
  case 382: flag=_wrap_GenericExpressionCommon_acos(resc,resv,argc,(mxArray**)(argv)); break;
  case 383: flag=_wrap_GenericExpressionCommon_tanh(resc,resv,argc,(mxArray**)(argv)); break;
  case 384: flag=_wrap_GenericExpressionCommon_sinh(resc,resv,argc,(mxArray**)(argv)); break;
  case 385: flag=_wrap_GenericExpressionCommon_cosh(resc,resv,argc,(mxArray**)(argv)); break;
  case 386: flag=_wrap_GenericExpressionCommon_atanh(resc,resv,argc,(mxArray**)(argv)); break;
  case 387: flag=_wrap_GenericExpressionCommon_asinh(resc,resv,argc,(mxArray**)(argv)); break;
  case 388: flag=_wrap_GenericExpressionCommon_acosh(resc,resv,argc,(mxArray**)(argv)); break;
  case 389: flag=_wrap_GenericExpressionCommon_exp(resc,resv,argc,(mxArray**)(argv)); break;
  case 390: flag=_wrap_GenericExpressionCommon_log(resc,resv,argc,(mxArray**)(argv)); break;
  case 391: flag=_wrap_GenericExpressionCommon_log10(resc,resv,argc,(mxArray**)(argv)); break;
  case 392: flag=_wrap_GenericExpressionCommon_log1p(resc,resv,argc,(mxArray**)(argv)); break;
  case 393: flag=_wrap_GenericExpressionCommon_expm1(resc,resv,argc,(mxArray**)(argv)); break;
  case 394: flag=_wrap_GenericExpressionCommon_floor(resc,resv,argc,(mxArray**)(argv)); break;
  case 395: flag=_wrap_GenericExpressionCommon_ceil(resc,resv,argc,(mxArray**)(argv)); break;
  case 396: flag=_wrap_GenericExpressionCommon_erf(resc,resv,argc,(mxArray**)(argv)); break;
  case 397: flag=_wrap_GenericExpressionCommon_erfinv(resc,resv,argc,(mxArray**)(argv)); break;
  case 398: flag=_wrap_GenericExpressionCommon_sign(resc,resv,argc,(mxArray**)(argv)); break;
  case 399: flag=_wrap_GenericExpressionCommon_power(resc,resv,argc,(mxArray**)(argv)); break;
  case 400: flag=_wrap_GenericExpressionCommon_rem(resc,resv,argc,(mxArray**)(argv)); break;
  case 401: flag=_wrap_GenericExpressionCommon_fmod(resc,resv,argc,(mxArray**)(argv)); break;
  case 402: flag=_wrap_GenericExpressionCommon_remainder(resc,resv,argc,(mxArray**)(argv)); break;
  case 403: flag=_wrap_GenericExpressionCommon_atan2(resc,resv,argc,(mxArray**)(argv)); break;
  case 404: flag=_wrap_GenericExpressionCommon_fmin(resc,resv,argc,(mxArray**)(argv)); break;
  case 405: flag=_wrap_GenericExpressionCommon_fmax(resc,resv,argc,(mxArray**)(argv)); break;
  case 406: flag=_wrap_GenericExpressionCommon_hypot(resc,resv,argc,(mxArray**)(argv)); break;
  case 407: flag=_wrap_GenericExpressionCommon_simplify(resc,resv,argc,(mxArray**)(argv)); break;
  case 408: flag=_wrap_GenericExpressionCommon_is_equal(resc,resv,argc,(mxArray**)(argv)); break;
  case 409: flag=_wrap_GenericExpressionCommon_copysign(resc,resv,argc,(mxArray**)(argv)); break;
  case 410: flag=_wrap_GenericExpressionCommon_constpow(resc,resv,argc,(mxArray**)(argv)); break;
  case 411: flag=_wrap_new_GenericExpressionCommon(resc,resv,argc,(mxArray**)(argv)); break;
  case 412: flag=_wrap_delete_GenericExpressionCommon(resc,resv,argc,(mxArray**)(argv)); break;
  case 413: flag=_wrap_MatrixCommon_all(resc,resv,argc,(mxArray**)(argv)); break;
  case 414: flag=_wrap_MatrixCommon_any(resc,resv,argc,(mxArray**)(argv)); break;
  case 415: flag=_wrap_MatrixCommon_adj(resc,resv,argc,(mxArray**)(argv)); break;
  case 416: flag=_wrap_MatrixCommon_minor(resc,resv,argc,(mxArray**)(argv)); break;
  case 417: flag=_wrap_MatrixCommon_cofactor(resc,resv,argc,(mxArray**)(argv)); break;
  case 418: flag=_wrap_MatrixCommon_qr(resc,resv,argc,(mxArray**)(argv)); break;
  case 419: flag=_wrap_MatrixCommon_qr_sparse(resc,resv,argc,(mxArray**)(argv)); break;
  case 420: flag=_wrap_MatrixCommon_qr_solve(resc,resv,argc,(mxArray**)(argv)); break;
  case 421: flag=_wrap_MatrixCommon_ldl(resc,resv,argc,(mxArray**)(argv)); break;
  case 422: flag=_wrap_MatrixCommon_ldl_solve(resc,resv,argc,(mxArray**)(argv)); break;
  case 423: flag=_wrap_MatrixCommon_chol(resc,resv,argc,(mxArray**)(argv)); break;
  case 424: flag=_wrap_MatrixCommon_norm_inf_mul(resc,resv,argc,(mxArray**)(argv)); break;
  case 425: flag=_wrap_MatrixCommon_sparsify(resc,resv,argc,(mxArray**)(argv)); break;
  case 426: flag=_wrap_MatrixCommon_expand(resc,resv,argc,(mxArray**)(argv)); break;
  case 427: flag=_wrap_MatrixCommon_pw_const(resc,resv,argc,(mxArray**)(argv)); break;
  case 428: flag=_wrap_MatrixCommon_pw_lin(resc,resv,argc,(mxArray**)(argv)); break;
  case 429: flag=_wrap_MatrixCommon_heaviside(resc,resv,argc,(mxArray**)(argv)); break;
  case 430: flag=_wrap_MatrixCommon_rectangle(resc,resv,argc,(mxArray**)(argv)); break;
  case 431: flag=_wrap_MatrixCommon_triangle(resc,resv,argc,(mxArray**)(argv)); break;
  case 432: flag=_wrap_MatrixCommon_ramp(resc,resv,argc,(mxArray**)(argv)); break;
  case 433: flag=_wrap_MatrixCommon_gauss_quadrature(resc,resv,argc,(mxArray**)(argv)); break;
  case 434: flag=_wrap_MatrixCommon_taylor(resc,resv,argc,(mxArray**)(argv)); break;
  case 435: flag=_wrap_MatrixCommon_mtaylor(resc,resv,argc,(mxArray**)(argv)); break;
  case 436: flag=_wrap_MatrixCommon_poly_coeff(resc,resv,argc,(mxArray**)(argv)); break;
  case 437: flag=_wrap_MatrixCommon_poly_roots(resc,resv,argc,(mxArray**)(argv)); break;
  case 438: flag=_wrap_MatrixCommon_eig_symbolic(resc,resv,argc,(mxArray**)(argv)); break;
  case 439: flag=_wrap_new_MatrixCommon(resc,resv,argc,(mxArray**)(argv)); break;
  case 440: flag=_wrap_delete_MatrixCommon(resc,resv,argc,(mxArray**)(argv)); break;
  case 441: flag=_wrap_DM_has_nz(resc,resv,argc,(mxArray**)(argv)); break;
  case 442: flag=_wrap_DM_nonzero(resc,resv,argc,(mxArray**)(argv)); break;
  case 443: flag=_wrap_DM_get(resc,resv,argc,(mxArray**)(argv)); break;
  case 444: flag=_wrap_DM_set(resc,resv,argc,(mxArray**)(argv)); break;
  case 445: flag=_wrap_DM_get_nz(resc,resv,argc,(mxArray**)(argv)); break;
  case 446: flag=_wrap_DM_set_nz(resc,resv,argc,(mxArray**)(argv)); break;
  case 447: flag=_wrap_DM_uplus(resc,resv,argc,(mxArray**)(argv)); break;
  case 448: flag=_wrap_DM_uminus(resc,resv,argc,(mxArray**)(argv)); break;
  case 449: flag=_wrap_DM_binary(resc,resv,argc,(mxArray**)(argv)); break;
  case 450: flag=_wrap_DM_unary(resc,resv,argc,(mxArray**)(argv)); break;
  case 451: flag=_wrap_DM_scalar_matrix(resc,resv,argc,(mxArray**)(argv)); break;
  case 452: flag=_wrap_DM_matrix_scalar(resc,resv,argc,(mxArray**)(argv)); break;
  case 453: flag=_wrap_DM_matrix_matrix(resc,resv,argc,(mxArray**)(argv)); break;
  case 454: flag=_wrap_DM_printme(resc,resv,argc,(mxArray**)(argv)); break;
  case 455: flag=_wrap_DM_T(resc,resv,argc,(mxArray**)(argv)); break;
  case 456: flag=_wrap_DM_set_max_depth(resc,resv,argc,(mxArray**)(argv)); break;
  case 457: flag=_wrap_DM_get_max_depth(resc,resv,argc,(mxArray**)(argv)); break;
  case 458: flag=_wrap_DM_get_input(resc,resv,argc,(mxArray**)(argv)); break;
  case 459: flag=_wrap_DM_get_free(resc,resv,argc,(mxArray**)(argv)); break;
  case 460: flag=_wrap_DM_type_name(resc,resv,argc,(mxArray**)(argv)); break;
  case 461: flag=_wrap_DM_print_split(resc,resv,argc,(mxArray**)(argv)); break;
  case 462: flag=_wrap_DM_disp(resc,resv,argc,(mxArray**)(argv)); break;
  case 463: flag=_wrap_DM_str(resc,resv,argc,(mxArray**)(argv)); break;
  case 464: flag=_wrap_DM_print_scalar(resc,resv,argc,(mxArray**)(argv)); break;
  case 465: flag=_wrap_DM_print_vector(resc,resv,argc,(mxArray**)(argv)); break;
  case 466: flag=_wrap_DM_print_dense(resc,resv,argc,(mxArray**)(argv)); break;
  case 467: flag=_wrap_DM_print_sparse(resc,resv,argc,(mxArray**)(argv)); break;
  case 468: flag=_wrap_DM_clear(resc,resv,argc,(mxArray**)(argv)); break;
  case 469: flag=_wrap_DM_resize(resc,resv,argc,(mxArray**)(argv)); break;
  case 470: flag=_wrap_DM_reserve(resc,resv,argc,(mxArray**)(argv)); break;
  case 471: flag=_wrap_DM_erase(resc,resv,argc,(mxArray**)(argv)); break;
  case 472: flag=_wrap_DM_remove(resc,resv,argc,(mxArray**)(argv)); break;
  case 473: flag=_wrap_DM_enlarge(resc,resv,argc,(mxArray**)(argv)); break;
  case 474: flag=_wrap_DM_sparsity(resc,resv,argc,(mxArray**)(argv)); break;
  case 475: flag=_wrap_DM_triplet(resc,resv,argc,(mxArray**)(argv)); break;
  case 476: flag=_wrap_DM_inf(resc,resv,argc,(mxArray**)(argv)); break;
  case 477: flag=_wrap_DM_nan(resc,resv,argc,(mxArray**)(argv)); break;
  case 478: flag=_wrap_DM_eye(resc,resv,argc,(mxArray**)(argv)); break;
  case 479: flag=_wrap_DM_element_hash(resc,resv,argc,(mxArray**)(argv)); break;
  case 480: flag=_wrap_DM_is_regular(resc,resv,argc,(mxArray**)(argv)); break;
  case 481: flag=_wrap_DM_is_smooth(resc,resv,argc,(mxArray**)(argv)); break;
  case 482: flag=_wrap_DM_is_leaf(resc,resv,argc,(mxArray**)(argv)); break;
  case 483: flag=_wrap_DM_is_commutative(resc,resv,argc,(mxArray**)(argv)); break;
  case 484: flag=_wrap_DM_is_symbolic(resc,resv,argc,(mxArray**)(argv)); break;
  case 485: flag=_wrap_DM_is_valid_input(resc,resv,argc,(mxArray**)(argv)); break;
  case 486: flag=_wrap_DM_has_duplicates(resc,resv,argc,(mxArray**)(argv)); break;
  case 487: flag=_wrap_DM_reset_input(resc,resv,argc,(mxArray**)(argv)); break;
  case 488: flag=_wrap_DM_is_constant(resc,resv,argc,(mxArray**)(argv)); break;
  case 489: flag=_wrap_DM_is_integer(resc,resv,argc,(mxArray**)(argv)); break;
  case 490: flag=_wrap_DM_is_zero(resc,resv,argc,(mxArray**)(argv)); break;
  case 491: flag=_wrap_DM_is_one(resc,resv,argc,(mxArray**)(argv)); break;
  case 492: flag=_wrap_DM_is_minus_one(resc,resv,argc,(mxArray**)(argv)); break;
  case 493: flag=_wrap_DM_is_eye(resc,resv,argc,(mxArray**)(argv)); break;
  case 494: flag=_wrap_DM_op(resc,resv,argc,(mxArray**)(argv)); break;
  case 495: flag=_wrap_DM_is_op(resc,resv,argc,(mxArray**)(argv)); break;
  case 496: flag=_wrap_DM_has_zeros(resc,resv,argc,(mxArray**)(argv)); break;
  case 497: flag=_wrap_DM_nonzeros(resc,resv,argc,(mxArray**)(argv)); break;
  case 498: flag=_wrap_DM_elements(resc,resv,argc,(mxArray**)(argv)); break;
  case 499: flag=_wrap_DM_to_double(resc,resv,argc,(mxArray**)(argv)); break;
  case 500: flag=_wrap_DM_to_int(resc,resv,argc,(mxArray**)(argv)); break;
  case 501: flag=_wrap_DM_name(resc,resv,argc,(mxArray**)(argv)); break;
  case 502: flag=_wrap_DM_dep(resc,resv,argc,(mxArray**)(argv)); break;
  case 503: flag=_wrap_DM_n_dep(resc,resv,argc,(mxArray**)(argv)); break;
  case 504: flag=_wrap_DM_set_precision(resc,resv,argc,(mxArray**)(argv)); break;
  case 505: flag=_wrap_DM_set_width(resc,resv,argc,(mxArray**)(argv)); break;
  case 506: flag=_wrap_DM_set_scientific(resc,resv,argc,(mxArray**)(argv)); break;
  case 507: flag=_wrap_DM_rng(resc,resv,argc,(mxArray**)(argv)); break;
  case 508: flag=_wrap_DM_rand(resc,resv,argc,(mxArray**)(argv)); break;
  case 509: flag=_wrap_DM_export_code(resc,resv,argc,(mxArray**)(argv)); break;
  case 510: flag=_wrap_DM_info(resc,resv,argc,(mxArray**)(argv)); break;
  case 511: flag=_wrap_DM_serialize(resc,resv,argc,(mxArray**)(argv)); break;
  case 512: flag=_wrap_DM_deserialize(resc,resv,argc,(mxArray**)(argv)); break;
  case 513: flag=_wrap_DM_to_file(resc,resv,argc,(mxArray**)(argv)); break;
  case 514: flag=_wrap_DM_from_file(resc,resv,argc,(mxArray**)(argv)); break;
  case 515: flag=_wrap_new_DM(resc,resv,argc,(mxArray**)(argv)); break;
  case 516: flag=_wrap_DM_assign(resc,resv,argc,(mxArray**)(argv)); break;
  case 517: flag=_wrap_DM_paren(resc,resv,argc,(mxArray**)(argv)); break;
  case 518: flag=_wrap_DM_paren_asgn(resc,resv,argc,(mxArray**)(argv)); break;
  case 519: flag=_wrap_DM_brace(resc,resv,argc,(mxArray**)(argv)); break;
  case 520: flag=_wrap_DM_setbrace(resc,resv,argc,(mxArray**)(argv)); break;
  case 521: flag=_wrap_DM_end(resc,resv,argc,(mxArray**)(argv)); break;
  case 522: flag=_wrap_DM_numel(resc,resv,argc,(mxArray**)(argv)); break;
  case 523: flag=_wrap_DM_ctranspose(resc,resv,argc,(mxArray**)(argv)); break;
  case 524: flag=_wrap_DM_full(resc,resv,argc,(mxArray**)(argv)); break;
  case 525: flag=_wrap_DM_sparse(resc,resv,argc,(mxArray**)(argv)); break;
  case 526: flag=_wrap_delete_DM(resc,resv,argc,(mxArray**)(argv)); break;
  case 527: flag=_wrap_new_SXElem(resc,resv,argc,(mxArray**)(argv)); break;
  case 528: flag=_wrap_delete_SXElem(resc,resv,argc,(mxArray**)(argv)); break;
  case 529: flag=_wrap_SX_has_nz(resc,resv,argc,(mxArray**)(argv)); break;
  case 530: flag=_wrap_SX_nonzero(resc,resv,argc,(mxArray**)(argv)); break;
  case 531: flag=_wrap_SX_get(resc,resv,argc,(mxArray**)(argv)); break;
  case 532: flag=_wrap_SX_set(resc,resv,argc,(mxArray**)(argv)); break;
  case 533: flag=_wrap_SX_get_nz(resc,resv,argc,(mxArray**)(argv)); break;
  case 534: flag=_wrap_SX_set_nz(resc,resv,argc,(mxArray**)(argv)); break;
  case 535: flag=_wrap_SX_uplus(resc,resv,argc,(mxArray**)(argv)); break;
  case 536: flag=_wrap_SX_uminus(resc,resv,argc,(mxArray**)(argv)); break;
  case 537: flag=_wrap_SX_binary(resc,resv,argc,(mxArray**)(argv)); break;
  case 538: flag=_wrap_SX_unary(resc,resv,argc,(mxArray**)(argv)); break;
  case 539: flag=_wrap_SX_scalar_matrix(resc,resv,argc,(mxArray**)(argv)); break;
  case 540: flag=_wrap_SX_matrix_scalar(resc,resv,argc,(mxArray**)(argv)); break;
  case 541: flag=_wrap_SX_matrix_matrix(resc,resv,argc,(mxArray**)(argv)); break;
  case 542: flag=_wrap_SX_printme(resc,resv,argc,(mxArray**)(argv)); break;
  case 543: flag=_wrap_SX_T(resc,resv,argc,(mxArray**)(argv)); break;
  case 544: flag=_wrap_SX_set_max_depth(resc,resv,argc,(mxArray**)(argv)); break;
  case 545: flag=_wrap_SX_get_max_depth(resc,resv,argc,(mxArray**)(argv)); break;
  case 546: flag=_wrap_SX_get_input(resc,resv,argc,(mxArray**)(argv)); break;
  case 547: flag=_wrap_SX_get_free(resc,resv,argc,(mxArray**)(argv)); break;
  case 548: flag=_wrap_SX_type_name(resc,resv,argc,(mxArray**)(argv)); break;
  case 549: flag=_wrap_SX_print_split(resc,resv,argc,(mxArray**)(argv)); break;
  case 550: flag=_wrap_SX_disp(resc,resv,argc,(mxArray**)(argv)); break;
  case 551: flag=_wrap_SX_str(resc,resv,argc,(mxArray**)(argv)); break;
  case 552: flag=_wrap_SX_print_scalar(resc,resv,argc,(mxArray**)(argv)); break;
  case 553: flag=_wrap_SX_print_vector(resc,resv,argc,(mxArray**)(argv)); break;
  case 554: flag=_wrap_SX_print_dense(resc,resv,argc,(mxArray**)(argv)); break;
  case 555: flag=_wrap_SX_print_sparse(resc,resv,argc,(mxArray**)(argv)); break;
  case 556: flag=_wrap_SX_clear(resc,resv,argc,(mxArray**)(argv)); break;
  case 557: flag=_wrap_SX_resize(resc,resv,argc,(mxArray**)(argv)); break;
  case 558: flag=_wrap_SX_reserve(resc,resv,argc,(mxArray**)(argv)); break;
  case 559: flag=_wrap_SX_erase(resc,resv,argc,(mxArray**)(argv)); break;
  case 560: flag=_wrap_SX_remove(resc,resv,argc,(mxArray**)(argv)); break;
  case 561: flag=_wrap_SX_enlarge(resc,resv,argc,(mxArray**)(argv)); break;
  case 562: flag=_wrap_SX_sparsity(resc,resv,argc,(mxArray**)(argv)); break;
  case 563: flag=_wrap_SX_triplet(resc,resv,argc,(mxArray**)(argv)); break;
  case 564: flag=_wrap_SX_inf(resc,resv,argc,(mxArray**)(argv)); break;
  case 565: flag=_wrap_SX_nan(resc,resv,argc,(mxArray**)(argv)); break;
  case 566: flag=_wrap_SX_eye(resc,resv,argc,(mxArray**)(argv)); break;
  case 567: flag=_wrap_SX_element_hash(resc,resv,argc,(mxArray**)(argv)); break;
  case 568: flag=_wrap_SX_is_regular(resc,resv,argc,(mxArray**)(argv)); break;
  case 569: flag=_wrap_SX_is_smooth(resc,resv,argc,(mxArray**)(argv)); break;
  case 570: flag=_wrap_SX_is_leaf(resc,resv,argc,(mxArray**)(argv)); break;
  case 571: flag=_wrap_SX_is_commutative(resc,resv,argc,(mxArray**)(argv)); break;
  case 572: flag=_wrap_SX_is_symbolic(resc,resv,argc,(mxArray**)(argv)); break;
  case 573: flag=_wrap_SX_is_valid_input(resc,resv,argc,(mxArray**)(argv)); break;
  case 574: flag=_wrap_SX_has_duplicates(resc,resv,argc,(mxArray**)(argv)); break;
  case 575: flag=_wrap_SX_reset_input(resc,resv,argc,(mxArray**)(argv)); break;
  case 576: flag=_wrap_SX_is_constant(resc,resv,argc,(mxArray**)(argv)); break;
  case 577: flag=_wrap_SX_is_integer(resc,resv,argc,(mxArray**)(argv)); break;
  case 578: flag=_wrap_SX_is_zero(resc,resv,argc,(mxArray**)(argv)); break;
  case 579: flag=_wrap_SX_is_one(resc,resv,argc,(mxArray**)(argv)); break;
  case 580: flag=_wrap_SX_is_minus_one(resc,resv,argc,(mxArray**)(argv)); break;
  case 581: flag=_wrap_SX_is_eye(resc,resv,argc,(mxArray**)(argv)); break;
  case 582: flag=_wrap_SX_op(resc,resv,argc,(mxArray**)(argv)); break;
  case 583: flag=_wrap_SX_is_op(resc,resv,argc,(mxArray**)(argv)); break;
  case 584: flag=_wrap_SX_has_zeros(resc,resv,argc,(mxArray**)(argv)); break;
  case 585: flag=_wrap_SX_nonzeros(resc,resv,argc,(mxArray**)(argv)); break;
  case 586: flag=_wrap_SX_elements(resc,resv,argc,(mxArray**)(argv)); break;
  case 587: flag=_wrap_SX_to_double(resc,resv,argc,(mxArray**)(argv)); break;
  case 588: flag=_wrap_SX_to_int(resc,resv,argc,(mxArray**)(argv)); break;
  case 589: flag=_wrap_SX_name(resc,resv,argc,(mxArray**)(argv)); break;
  case 590: flag=_wrap_SX_dep(resc,resv,argc,(mxArray**)(argv)); break;
  case 591: flag=_wrap_SX_n_dep(resc,resv,argc,(mxArray**)(argv)); break;
  case 592: flag=_wrap_SX_set_precision(resc,resv,argc,(mxArray**)(argv)); break;
  case 593: flag=_wrap_SX_set_width(resc,resv,argc,(mxArray**)(argv)); break;
  case 594: flag=_wrap_SX_set_scientific(resc,resv,argc,(mxArray**)(argv)); break;
  case 595: flag=_wrap_SX_rng(resc,resv,argc,(mxArray**)(argv)); break;
  case 596: flag=_wrap_SX_rand(resc,resv,argc,(mxArray**)(argv)); break;
  case 597: flag=_wrap_SX_export_code(resc,resv,argc,(mxArray**)(argv)); break;
  case 598: flag=_wrap_SX_info(resc,resv,argc,(mxArray**)(argv)); break;
  case 599: flag=_wrap_SX_serialize(resc,resv,argc,(mxArray**)(argv)); break;
  case 600: flag=_wrap_SX_deserialize(resc,resv,argc,(mxArray**)(argv)); break;
  case 601: flag=_wrap_SX_to_file(resc,resv,argc,(mxArray**)(argv)); break;
  case 602: flag=_wrap_SX_from_file(resc,resv,argc,(mxArray**)(argv)); break;
  case 603: flag=_wrap_SX_paren(resc,resv,argc,(mxArray**)(argv)); break;
  case 604: flag=_wrap_SX_paren_asgn(resc,resv,argc,(mxArray**)(argv)); break;
  case 605: flag=_wrap_SX_brace(resc,resv,argc,(mxArray**)(argv)); break;
  case 606: flag=_wrap_SX_setbrace(resc,resv,argc,(mxArray**)(argv)); break;
  case 607: flag=_wrap_SX_end(resc,resv,argc,(mxArray**)(argv)); break;
  case 608: flag=_wrap_SX_numel(resc,resv,argc,(mxArray**)(argv)); break;
  case 609: flag=_wrap_SX_ctranspose(resc,resv,argc,(mxArray**)(argv)); break;
  case 610: flag=_wrap_new_SX(resc,resv,argc,(mxArray**)(argv)); break;
  case 611: flag=_wrap_delete_SX(resc,resv,argc,(mxArray**)(argv)); break;
  case 612: flag=_wrap_MX_type_name(resc,resv,argc,(mxArray**)(argv)); break;
  case 613: flag=_wrap_delete_MX(resc,resv,argc,(mxArray**)(argv)); break;
  case 614: flag=_wrap_MX_nonzero(resc,resv,argc,(mxArray**)(argv)); break;
  case 615: flag=_wrap_MX_sparsity(resc,resv,argc,(mxArray**)(argv)); break;
  case 616: flag=_wrap_MX_erase(resc,resv,argc,(mxArray**)(argv)); break;
  case 617: flag=_wrap_MX_enlarge(resc,resv,argc,(mxArray**)(argv)); break;
  case 618: flag=_wrap_MX_uminus(resc,resv,argc,(mxArray**)(argv)); break;
  case 619: flag=_wrap_MX_dep(resc,resv,argc,(mxArray**)(argv)); break;
  case 620: flag=_wrap_MX_n_out(resc,resv,argc,(mxArray**)(argv)); break;
  case 621: flag=_wrap_MX_get_output(resc,resv,argc,(mxArray**)(argv)); break;
  case 622: flag=_wrap_MX_n_dep(resc,resv,argc,(mxArray**)(argv)); break;
  case 623: flag=_wrap_MX_name(resc,resv,argc,(mxArray**)(argv)); break;
  case 624: flag=_wrap_MX_to_double(resc,resv,argc,(mxArray**)(argv)); break;
  case 625: flag=_wrap_MX_to_DM(resc,resv,argc,(mxArray**)(argv)); break;
  case 626: flag=_wrap_MX_is_symbolic(resc,resv,argc,(mxArray**)(argv)); break;
  case 627: flag=_wrap_MX_is_constant(resc,resv,argc,(mxArray**)(argv)); break;
  case 628: flag=_wrap_MX_is_call(resc,resv,argc,(mxArray**)(argv)); break;
  case 629: flag=_wrap_MX_which_function(resc,resv,argc,(mxArray**)(argv)); break;
  case 630: flag=_wrap_MX_is_output(resc,resv,argc,(mxArray**)(argv)); break;
  case 631: flag=_wrap_MX_which_output(resc,resv,argc,(mxArray**)(argv)); break;
  case 632: flag=_wrap_MX_is_op(resc,resv,argc,(mxArray**)(argv)); break;
  case 633: flag=_wrap_MX_is_multiplication(resc,resv,argc,(mxArray**)(argv)); break;
  case 634: flag=_wrap_MX_is_commutative(resc,resv,argc,(mxArray**)(argv)); break;
  case 635: flag=_wrap_MX_is_norm(resc,resv,argc,(mxArray**)(argv)); break;
  case 636: flag=_wrap_MX_is_valid_input(resc,resv,argc,(mxArray**)(argv)); break;
  case 637: flag=_wrap_MX_n_primitives(resc,resv,argc,(mxArray**)(argv)); break;
  case 638: flag=_wrap_MX_primitives(resc,resv,argc,(mxArray**)(argv)); break;
  case 639: flag=_wrap_MX_split_primitives(resc,resv,argc,(mxArray**)(argv)); break;
  case 640: flag=_wrap_MX_join_primitives(resc,resv,argc,(mxArray**)(argv)); break;
  case 641: flag=_wrap_MX_has_duplicates(resc,resv,argc,(mxArray**)(argv)); break;
  case 642: flag=_wrap_MX_reset_input(resc,resv,argc,(mxArray**)(argv)); break;
  case 643: flag=_wrap_MX_is_eye(resc,resv,argc,(mxArray**)(argv)); break;
  case 644: flag=_wrap_MX_is_zero(resc,resv,argc,(mxArray**)(argv)); break;
  case 645: flag=_wrap_MX_is_one(resc,resv,argc,(mxArray**)(argv)); break;
  case 646: flag=_wrap_MX_is_minus_one(resc,resv,argc,(mxArray**)(argv)); break;
  case 647: flag=_wrap_MX_is_transpose(resc,resv,argc,(mxArray**)(argv)); break;
  case 648: flag=_wrap_MX_is_regular(resc,resv,argc,(mxArray**)(argv)); break;
  case 649: flag=_wrap_MX_is_binary(resc,resv,argc,(mxArray**)(argv)); break;
  case 650: flag=_wrap_MX_is_unary(resc,resv,argc,(mxArray**)(argv)); break;
  case 651: flag=_wrap_MX_op(resc,resv,argc,(mxArray**)(argv)); break;
  case 652: flag=_wrap_MX_info(resc,resv,argc,(mxArray**)(argv)); break;
  case 653: flag=_wrap_MX_serialize(resc,resv,argc,(mxArray**)(argv)); break;
  case 654: flag=_wrap_MX_deserialize(resc,resv,argc,(mxArray**)(argv)); break;
  case 655: flag=_wrap_MX_get_temp(resc,resv,argc,(mxArray**)(argv)); break;
  case 656: flag=_wrap_MX_set_temp(resc,resv,argc,(mxArray**)(argv)); break;
  case 657: flag=_wrap_MX_binary(resc,resv,argc,(mxArray**)(argv)); break;
  case 658: flag=_wrap_MX_unary(resc,resv,argc,(mxArray**)(argv)); break;
  case 659: flag=_wrap_MX_inf(resc,resv,argc,(mxArray**)(argv)); break;
  case 660: flag=_wrap_MX_nan(resc,resv,argc,(mxArray**)(argv)); break;
  case 661: flag=_wrap_MX_eye(resc,resv,argc,(mxArray**)(argv)); break;
  case 662: flag=_wrap_MX_get(resc,resv,argc,(mxArray**)(argv)); break;
  case 663: flag=_wrap_MX_set(resc,resv,argc,(mxArray**)(argv)); break;
  case 664: flag=_wrap_MX_get_nz(resc,resv,argc,(mxArray**)(argv)); break;
  case 665: flag=_wrap_MX_set_nz(resc,resv,argc,(mxArray**)(argv)); break;
  case 666: flag=_wrap_MX_einstein(resc,resv,argc,(mxArray**)(argv)); break;
  case 667: flag=_wrap_MX_bspline_dual(resc,resv,argc,(mxArray**)(argv)); break;
  case 668: flag=_wrap_MX_interpn_linear(resc,resv,argc,(mxArray**)(argv)); break;
  case 669: flag=_wrap_MX_printme(resc,resv,argc,(mxArray**)(argv)); break;
  case 670: flag=_wrap_MX_attachAssert(resc,resv,argc,(mxArray**)(argv)); break;
  case 671: flag=_wrap_MX_monitor(resc,resv,argc,(mxArray**)(argv)); break;
  case 672: flag=_wrap_MX_T(resc,resv,argc,(mxArray**)(argv)); break;
  case 673: flag=_wrap_MX_mapping(resc,resv,argc,(mxArray**)(argv)); break;
  case 674: flag=_wrap_MX_set_max_depth(resc,resv,argc,(mxArray**)(argv)); break;
  case 675: flag=_wrap_MX_get_max_depth(resc,resv,argc,(mxArray**)(argv)); break;
  case 676: flag=_wrap_MX_test_cast(resc,resv,argc,(mxArray**)(argv)); break;
  case 677: flag=_wrap_MX_get_input(resc,resv,argc,(mxArray**)(argv)); break;
  case 678: flag=_wrap_MX_get_free(resc,resv,argc,(mxArray**)(argv)); break;
  case 679: flag=_wrap_MX_eval_mx(resc,resv,argc,(mxArray**)(argv)); break;
  case 680: flag=_wrap_MX_paren_asgn(resc,resv,argc,(mxArray**)(argv)); break;
  case 681: flag=_wrap_MX_setbrace(resc,resv,argc,(mxArray**)(argv)); break;
  case 682: flag=_wrap_MX_end(resc,resv,argc,(mxArray**)(argv)); break;
  case 683: flag=_wrap_MX_numel(resc,resv,argc,(mxArray**)(argv)); break;
  case 684: flag=_wrap_MX_ctranspose(resc,resv,argc,(mxArray**)(argv)); break;
  case 685: flag=_wrap_MX_find(resc,resv,argc,(mxArray**)(argv)); break;
  case 686: flag=_wrap_MX_low(resc,resv,argc,(mxArray**)(argv)); break;
  case 687: flag=_wrap_MX_inv_node(resc,resv,argc,(mxArray**)(argv)); break;
  case 688: flag=_wrap_MX_brace(resc,resv,argc,(mxArray**)(argv)); break;
  case 689: flag=_wrap_MX_paren(resc,resv,argc,(mxArray**)(argv)); break;
  case 690: flag=_wrap_new_MX(resc,resv,argc,(mxArray**)(argv)); break;
  case 691: flag=_wrap_Function_type_name(resc,resv,argc,(mxArray**)(argv)); break;
  case 692: flag=_wrap_Function_jit(resc,resv,argc,(mxArray**)(argv)); break;
  case 693: flag=_wrap_delete_Function(resc,resv,argc,(mxArray**)(argv)); break;
  case 694: flag=_wrap_Function_expand(resc,resv,argc,(mxArray**)(argv)); break;
  case 695: flag=_wrap_Function_n_in(resc,resv,argc,(mxArray**)(argv)); break;
  case 696: flag=_wrap_Function_n_out(resc,resv,argc,(mxArray**)(argv)); break;
  case 697: flag=_wrap_Function_size1_in(resc,resv,argc,(mxArray**)(argv)); break;
  case 698: flag=_wrap_Function_size2_in(resc,resv,argc,(mxArray**)(argv)); break;
  case 699: flag=_wrap_Function_size_in(resc,resv,argc,(mxArray**)(argv)); break;
  case 700: flag=_wrap_Function_size1_out(resc,resv,argc,(mxArray**)(argv)); break;
  case 701: flag=_wrap_Function_size2_out(resc,resv,argc,(mxArray**)(argv)); break;
  case 702: flag=_wrap_Function_size_out(resc,resv,argc,(mxArray**)(argv)); break;
  case 703: flag=_wrap_Function_nnz_in(resc,resv,argc,(mxArray**)(argv)); break;
  case 704: flag=_wrap_Function_nnz_out(resc,resv,argc,(mxArray**)(argv)); break;
  case 705: flag=_wrap_Function_numel_in(resc,resv,argc,(mxArray**)(argv)); break;
  case 706: flag=_wrap_Function_numel_out(resc,resv,argc,(mxArray**)(argv)); break;
  case 707: flag=_wrap_Function_name_in(resc,resv,argc,(mxArray**)(argv)); break;
  case 708: flag=_wrap_Function_name_out(resc,resv,argc,(mxArray**)(argv)); break;
  case 709: flag=_wrap_Function_index_in(resc,resv,argc,(mxArray**)(argv)); break;
  case 710: flag=_wrap_Function_index_out(resc,resv,argc,(mxArray**)(argv)); break;
  case 711: flag=_wrap_Function_default_in(resc,resv,argc,(mxArray**)(argv)); break;
  case 712: flag=_wrap_Function_max_in(resc,resv,argc,(mxArray**)(argv)); break;
  case 713: flag=_wrap_Function_min_in(resc,resv,argc,(mxArray**)(argv)); break;
  case 714: flag=_wrap_Function_nominal_in(resc,resv,argc,(mxArray**)(argv)); break;
  case 715: flag=_wrap_Function_nominal_out(resc,resv,argc,(mxArray**)(argv)); break;
  case 716: flag=_wrap_Function_sparsity_in(resc,resv,argc,(mxArray**)(argv)); break;
  case 717: flag=_wrap_Function_sparsity_out(resc,resv,argc,(mxArray**)(argv)); break;
  case 718: flag=_wrap_Function_is_diff_in(resc,resv,argc,(mxArray**)(argv)); break;
  case 719: flag=_wrap_Function_is_diff_out(resc,resv,argc,(mxArray**)(argv)); break;
  case 720: flag=_wrap_Function_factory(resc,resv,argc,(mxArray**)(argv)); break;
  case 721: flag=_wrap_Function_oracle(resc,resv,argc,(mxArray**)(argv)); break;
  case 722: flag=_wrap_Function_wrap(resc,resv,argc,(mxArray**)(argv)); break;
  case 723: flag=_wrap_Function_wrap_as_needed(resc,resv,argc,(mxArray**)(argv)); break;
  case 724: flag=_wrap_Function_which_depends(resc,resv,argc,(mxArray**)(argv)); break;
  case 725: flag=_wrap_Function_print_dimensions(resc,resv,argc,(mxArray**)(argv)); break;
  case 726: flag=_wrap_Function_print_options(resc,resv,argc,(mxArray**)(argv)); break;
  case 727: flag=_wrap_Function_print_option(resc,resv,argc,(mxArray**)(argv)); break;
  case 728: flag=_wrap_Function_has_option(resc,resv,argc,(mxArray**)(argv)); break;
  case 729: flag=_wrap_Function_change_option(resc,resv,argc,(mxArray**)(argv)); break;
  case 730: flag=_wrap_Function_uses_output(resc,resv,argc,(mxArray**)(argv)); break;
  case 731: flag=_wrap_Function_jacobian_old(resc,resv,argc,(mxArray**)(argv)); break;
  case 732: flag=_wrap_Function_hessian_old(resc,resv,argc,(mxArray**)(argv)); break;
  case 733: flag=_wrap_Function_sparsity_jac(resc,resv,argc,(mxArray**)(argv)); break;
  case 734: flag=_wrap_Function_jacobian(resc,resv,argc,(mxArray**)(argv)); break;
  case 735: flag=_wrap_Function_call(resc,resv,argc,(mxArray**)(argv)); break;
  case 736: flag=_wrap_Function_mapsum(resc,resv,argc,(mxArray**)(argv)); break;
  case 737: flag=_wrap_Function_mapaccum(resc,resv,argc,(mxArray**)(argv)); break;
  case 738: flag=_wrap_Function_fold(resc,resv,argc,(mxArray**)(argv)); break;
  case 739: flag=_wrap_Function_map(resc,resv,argc,(mxArray**)(argv)); break;
  case 740: flag=_wrap_Function_slice(resc,resv,argc,(mxArray**)(argv)); break;
  case 741: flag=_wrap_Function_conditional(resc,resv,argc,(mxArray**)(argv)); break;
  case 742: flag=_wrap_Function_bspline(resc,resv,argc,(mxArray**)(argv)); break;
  case 743: flag=_wrap_Function_if_else(resc,resv,argc,(mxArray**)(argv)); break;
  case 744: flag=_wrap_Function_forward(resc,resv,argc,(mxArray**)(argv)); break;
  case 745: flag=_wrap_Function_reverse(resc,resv,argc,(mxArray**)(argv)); break;
  case 746: flag=_wrap_Function_jac_sparsity(resc,resv,argc,(mxArray**)(argv)); break;
  case 747: flag=_wrap_Function_generate(resc,resv,argc,(mxArray**)(argv)); break;
  case 748: flag=_wrap_Function_generate_dependencies(resc,resv,argc,(mxArray**)(argv)); break;
  case 749: flag=_wrap_Function_generate_in(resc,resv,argc,(mxArray**)(argv)); break;
  case 750: flag=_wrap_Function_generate_out(resc,resv,argc,(mxArray**)(argv)); break;
  case 751: flag=_wrap_Function_serialize(resc,resv,argc,(mxArray**)(argv)); break;
  case 752: flag=_wrap_Function_save(resc,resv,argc,(mxArray**)(argv)); break;
  case 753: flag=_wrap_Function_export_code(resc,resv,argc,(mxArray**)(argv)); break;
  case 754: flag=_wrap_Function_stats(resc,resv,argc,(mxArray**)(argv)); break;
  case 755: flag=_wrap_Function_sx_in(resc,resv,argc,(mxArray**)(argv)); break;
  case 756: flag=_wrap_Function_mx_in(resc,resv,argc,(mxArray**)(argv)); break;
  case 757: flag=_wrap_Function_sx_out(resc,resv,argc,(mxArray**)(argv)); break;
  case 758: flag=_wrap_Function_mx_out(resc,resv,argc,(mxArray**)(argv)); break;
  case 759: flag=_wrap_Function_nz_from_in(resc,resv,argc,(mxArray**)(argv)); break;
  case 760: flag=_wrap_Function_nz_from_out(resc,resv,argc,(mxArray**)(argv)); break;
  case 761: flag=_wrap_Function_nz_to_in(resc,resv,argc,(mxArray**)(argv)); break;
  case 762: flag=_wrap_Function_nz_to_out(resc,resv,argc,(mxArray**)(argv)); break;
  case 763: flag=_wrap_Function_convert_in(resc,resv,argc,(mxArray**)(argv)); break;
  case 764: flag=_wrap_Function_convert_out(resc,resv,argc,(mxArray**)(argv)); break;
  case 765: flag=_wrap_Function_has_free(resc,resv,argc,(mxArray**)(argv)); break;
  case 766: flag=_wrap_Function_get_free(resc,resv,argc,(mxArray**)(argv)); break;
  case 767: flag=_wrap_Function_free_sx(resc,resv,argc,(mxArray**)(argv)); break;
  case 768: flag=_wrap_Function_free_mx(resc,resv,argc,(mxArray**)(argv)); break;
  case 769: flag=_wrap_Function_generate_lifted(resc,resv,argc,(mxArray**)(argv)); break;
  case 770: flag=_wrap_Function_n_nodes(resc,resv,argc,(mxArray**)(argv)); break;
  case 771: flag=_wrap_Function_n_instructions(resc,resv,argc,(mxArray**)(argv)); break;
  case 772: flag=_wrap_Function_instruction_id(resc,resv,argc,(mxArray**)(argv)); break;
  case 773: flag=_wrap_Function_instruction_input(resc,resv,argc,(mxArray**)(argv)); break;
  case 774: flag=_wrap_Function_instruction_constant(resc,resv,argc,(mxArray**)(argv)); break;
  case 775: flag=_wrap_Function_instruction_output(resc,resv,argc,(mxArray**)(argv)); break;
  case 776: flag=_wrap_Function_instruction_MX(resc,resv,argc,(mxArray**)(argv)); break;
  case 777: flag=_wrap_Function_instructions_sx(resc,resv,argc,(mxArray**)(argv)); break;
  case 778: flag=_wrap_Function_has_spfwd(resc,resv,argc,(mxArray**)(argv)); break;
  case 779: flag=_wrap_Function_has_sprev(resc,resv,argc,(mxArray**)(argv)); break;
  case 780: flag=_wrap_Function_sz_arg(resc,resv,argc,(mxArray**)(argv)); break;
  case 781: flag=_wrap_Function_sz_res(resc,resv,argc,(mxArray**)(argv)); break;
  case 782: flag=_wrap_Function_sz_iw(resc,resv,argc,(mxArray**)(argv)); break;
  case 783: flag=_wrap_Function_sz_w(resc,resv,argc,(mxArray**)(argv)); break;
  case 784: flag=_wrap_Function_name(resc,resv,argc,(mxArray**)(argv)); break;
  case 785: flag=_wrap_Function_is_a(resc,resv,argc,(mxArray**)(argv)); break;
  case 786: flag=_wrap_Function_check_name(resc,resv,argc,(mxArray**)(argv)); break;
  case 787: flag=_wrap_Function_fix_name(resc,resv,argc,(mxArray**)(argv)); break;
  case 788: flag=_wrap_Function_load(resc,resv,argc,(mxArray**)(argv)); break;
  case 789: flag=_wrap_Function_deserialize(resc,resv,argc,(mxArray**)(argv)); break;
  case 790: flag=_wrap_Function_assert_size_in(resc,resv,argc,(mxArray**)(argv)); break;
  case 791: flag=_wrap_Function_assert_size_out(resc,resv,argc,(mxArray**)(argv)); break;
  case 792: flag=_wrap_Function_assert_sparsity_out(resc,resv,argc,(mxArray**)(argv)); break;
  case 793: flag=_wrap_Function_checkout(resc,resv,argc,(mxArray**)(argv)); break;
  case 794: flag=_wrap_Function_release(resc,resv,argc,(mxArray**)(argv)); break;
  case 795: flag=_wrap_Function_cache(resc,resv,argc,(mxArray**)(argv)); break;
  case 796: flag=_wrap_Function_get_function(resc,resv,argc,(mxArray**)(argv)); break;
  case 797: flag=_wrap_Function_has_function(resc,resv,argc,(mxArray**)(argv)); break;
  case 798: flag=_wrap_Function_find_functions(resc,resv,argc,(mxArray**)(argv)); break;
  case 799: flag=_wrap_Function_find_function(resc,resv,argc,(mxArray**)(argv)); break;
  case 800: flag=_wrap_Function_info(resc,resv,argc,(mxArray**)(argv)); break;
  case 801: flag=_wrap_new_Function(resc,resv,argc,(mxArray**)(argv)); break;
  case 802: flag=_wrap_external(resc,resv,argc,(mxArray**)(argv)); break;
  case 803: flag=_wrap_integrator(resc,resv,argc,(mxArray**)(argv)); break;
  case 804: flag=_wrap_has_integrator(resc,resv,argc,(mxArray**)(argv)); break;
  case 805: flag=_wrap_load_integrator(resc,resv,argc,(mxArray**)(argv)); break;
  case 806: flag=_wrap_doc_integrator(resc,resv,argc,(mxArray**)(argv)); break;
  case 807: flag=_wrap_integrator_in(resc,resv,argc,(mxArray**)(argv)); break;
  case 808: flag=_wrap_integrator_out(resc,resv,argc,(mxArray**)(argv)); break;
  case 809: flag=_wrap_integrator_n_in(resc,resv,argc,(mxArray**)(argv)); break;
  case 810: flag=_wrap_integrator_n_out(resc,resv,argc,(mxArray**)(argv)); break;
  case 811: flag=_wrap_dyn_in(resc,resv,argc,(mxArray**)(argv)); break;
  case 812: flag=_wrap_dyn_out(resc,resv,argc,(mxArray**)(argv)); break;
  case 813: flag=_wrap_dyn_n_in(resc,resv,argc,(mxArray**)(argv)); break;
  case 814: flag=_wrap_dyn_n_out(resc,resv,argc,(mxArray**)(argv)); break;
  case 815: flag=_wrap_conic(resc,resv,argc,(mxArray**)(argv)); break;
  case 816: flag=_wrap_qpsol(resc,resv,argc,(mxArray**)(argv)); break;
  case 817: flag=_wrap_conic_in(resc,resv,argc,(mxArray**)(argv)); break;
  case 818: flag=_wrap_conic_out(resc,resv,argc,(mxArray**)(argv)); break;
  case 819: flag=_wrap_conic_n_in(resc,resv,argc,(mxArray**)(argv)); break;
  case 820: flag=_wrap_conic_n_out(resc,resv,argc,(mxArray**)(argv)); break;
  case 821: flag=_wrap_conic_options(resc,resv,argc,(mxArray**)(argv)); break;
  case 822: flag=_wrap_conic_option_type(resc,resv,argc,(mxArray**)(argv)); break;
  case 823: flag=_wrap_conic_option_info(resc,resv,argc,(mxArray**)(argv)); break;
  case 824: flag=_wrap_has_conic(resc,resv,argc,(mxArray**)(argv)); break;
  case 825: flag=_wrap_load_conic(resc,resv,argc,(mxArray**)(argv)); break;
  case 826: flag=_wrap_doc_conic(resc,resv,argc,(mxArray**)(argv)); break;
  case 827: flag=_wrap_conic_debug(resc,resv,argc,(mxArray**)(argv)); break;
  case 828: flag=_wrap_nlpsol(resc,resv,argc,(mxArray**)(argv)); break;
  case 829: flag=_wrap_nlpsol_in(resc,resv,argc,(mxArray**)(argv)); break;
  case 830: flag=_wrap_nlpsol_out(resc,resv,argc,(mxArray**)(argv)); break;
  case 831: flag=_wrap_nlpsol_n_in(resc,resv,argc,(mxArray**)(argv)); break;
  case 832: flag=_wrap_nlpsol_n_out(resc,resv,argc,(mxArray**)(argv)); break;
  case 833: flag=_wrap_nlpsol_default_in(resc,resv,argc,(mxArray**)(argv)); break;
  case 834: flag=_wrap_nlpsol_options(resc,resv,argc,(mxArray**)(argv)); break;
  case 835: flag=_wrap_nlpsol_option_type(resc,resv,argc,(mxArray**)(argv)); break;
  case 836: flag=_wrap_nlpsol_option_info(resc,resv,argc,(mxArray**)(argv)); break;
  case 837: flag=_wrap_has_nlpsol(resc,resv,argc,(mxArray**)(argv)); break;
  case 838: flag=_wrap_load_nlpsol(resc,resv,argc,(mxArray**)(argv)); break;
  case 839: flag=_wrap_doc_nlpsol(resc,resv,argc,(mxArray**)(argv)); break;
  case 840: flag=_wrap_rootfinder(resc,resv,argc,(mxArray**)(argv)); break;
  case 841: flag=_wrap_rootfinder_in(resc,resv,argc,(mxArray**)(argv)); break;
  case 842: flag=_wrap_rootfinder_out(resc,resv,argc,(mxArray**)(argv)); break;
  case 843: flag=_wrap_rootfinder_n_in(resc,resv,argc,(mxArray**)(argv)); break;
  case 844: flag=_wrap_rootfinder_n_out(resc,resv,argc,(mxArray**)(argv)); break;
  case 845: flag=_wrap_rootfinder_options(resc,resv,argc,(mxArray**)(argv)); break;
  case 846: flag=_wrap_rootfinder_option_type(resc,resv,argc,(mxArray**)(argv)); break;
  case 847: flag=_wrap_rootfinder_option_info(resc,resv,argc,(mxArray**)(argv)); break;
  case 848: flag=_wrap_has_rootfinder(resc,resv,argc,(mxArray**)(argv)); break;
  case 849: flag=_wrap_load_rootfinder(resc,resv,argc,(mxArray**)(argv)); break;
  case 850: flag=_wrap_doc_rootfinder(resc,resv,argc,(mxArray**)(argv)); break;
  case 851: flag=_wrap_Linsol_type_name(resc,resv,argc,(mxArray**)(argv)); break;
  case 852: flag=_wrap_Linsol_has_plugin(resc,resv,argc,(mxArray**)(argv)); break;
  case 853: flag=_wrap_Linsol_load_plugin(resc,resv,argc,(mxArray**)(argv)); break;
  case 854: flag=_wrap_Linsol_doc(resc,resv,argc,(mxArray**)(argv)); break;
  case 855: flag=_wrap_Linsol_plugin_name(resc,resv,argc,(mxArray**)(argv)); break;
  case 856: flag=_wrap_Linsol_sparsity(resc,resv,argc,(mxArray**)(argv)); break;
  case 857: flag=_wrap_Linsol_sfact(resc,resv,argc,(mxArray**)(argv)); break;
  case 858: flag=_wrap_Linsol_nfact(resc,resv,argc,(mxArray**)(argv)); break;
  case 859: flag=_wrap_Linsol_solve(resc,resv,argc,(mxArray**)(argv)); break;
  case 860: flag=_wrap_Linsol_neig(resc,resv,argc,(mxArray**)(argv)); break;
  case 861: flag=_wrap_Linsol_rank(resc,resv,argc,(mxArray**)(argv)); break;
  case 862: flag=_wrap_Linsol_stats(resc,resv,argc,(mxArray**)(argv)); break;
  case 863: flag=_wrap_new_Linsol(resc,resv,argc,(mxArray**)(argv)); break;
  case 864: flag=_wrap_delete_Linsol(resc,resv,argc,(mxArray**)(argv)); break;
  case 865: flag=_wrap_has_linsol(resc,resv,argc,(mxArray**)(argv)); break;
  case 866: flag=_wrap_load_linsol(resc,resv,argc,(mxArray**)(argv)); break;
  case 867: flag=_wrap_doc_linsol(resc,resv,argc,(mxArray**)(argv)); break;
  case 868: flag=_wrap_dplesol(resc,resv,argc,(mxArray**)(argv)); break;
  case 869: flag=_wrap_dple_in(resc,resv,argc,(mxArray**)(argv)); break;
  case 870: flag=_wrap_dple_out(resc,resv,argc,(mxArray**)(argv)); break;
  case 871: flag=_wrap_dple_n_in(resc,resv,argc,(mxArray**)(argv)); break;
  case 872: flag=_wrap_dple_n_out(resc,resv,argc,(mxArray**)(argv)); break;
  case 873: flag=_wrap_has_dple(resc,resv,argc,(mxArray**)(argv)); break;
  case 874: flag=_wrap_load_dple(resc,resv,argc,(mxArray**)(argv)); break;
  case 875: flag=_wrap_doc_dple(resc,resv,argc,(mxArray**)(argv)); break;
  case 876: flag=_wrap_expmsol(resc,resv,argc,(mxArray**)(argv)); break;
  case 877: flag=_wrap_expm_n_in(resc,resv,argc,(mxArray**)(argv)); break;
  case 878: flag=_wrap_expm_n_out(resc,resv,argc,(mxArray**)(argv)); break;
  case 879: flag=_wrap_has_expm(resc,resv,argc,(mxArray**)(argv)); break;
  case 880: flag=_wrap_load_expm(resc,resv,argc,(mxArray**)(argv)); break;
  case 881: flag=_wrap_doc_expm(resc,resv,argc,(mxArray**)(argv)); break;
  case 882: flag=_wrap_interpolant(resc,resv,argc,(mxArray**)(argv)); break;
  case 883: flag=_wrap_has_interpolant(resc,resv,argc,(mxArray**)(argv)); break;
  case 884: flag=_wrap_load_interpolant(resc,resv,argc,(mxArray**)(argv)); break;
  case 885: flag=_wrap_doc_interpolant(resc,resv,argc,(mxArray**)(argv)); break;
  case 886: flag=_wrap_new_CodeGenerator(resc,resv,argc,(mxArray**)(argv)); break;
  case 887: flag=_wrap_CodeGenerator_add(resc,resv,argc,(mxArray**)(argv)); break;
  case 888: flag=_wrap_CodeGenerator_dump(resc,resv,argc,(mxArray**)(argv)); break;
  case 889: flag=_wrap_CodeGenerator_generate(resc,resv,argc,(mxArray**)(argv)); break;
  case 890: flag=_wrap_CodeGenerator_add_include(resc,resv,argc,(mxArray**)(argv)); break;
  case 891: flag=_wrap_delete_CodeGenerator(resc,resv,argc,(mxArray**)(argv)); break;
  case 892: flag=_wrap_forward(resc,resv,argc,(mxArray**)(argv)); break;
  case 893: flag=_wrap_reverse(resc,resv,argc,(mxArray**)(argv)); break;
  case 894: flag=_wrap_substitute(resc,resv,argc,(mxArray**)(argv)); break;
  case 895: flag=_wrap_substitute_inplace(resc,resv,argc,(mxArray**)(argv)); break;
  case 896: flag=_wrap_extract(resc,resv,argc,(mxArray**)(argv)); break;
  case 897: flag=_wrap_shared(resc,resv,argc,(mxArray**)(argv)); break;
  case 898: flag=_wrap_blockcat(resc,resv,argc,(mxArray**)(argv)); break;
  case 899: flag=_wrap_matrix_expand(resc,resv,argc,(mxArray**)(argv)); break;
  case 900: flag=_wrap_graph_substitute(resc,resv,argc,(mxArray**)(argv)); break;
  case 901: flag=_wrap_bspline(resc,resv,argc,(mxArray**)(argv)); break;
  case 902: flag=_wrap_convexify(resc,resv,argc,(mxArray**)(argv)); break;
  case 903: flag=_wrap_stop_diff(resc,resv,argc,(mxArray**)(argv)); break;
  case 904: flag=_wrap_no_hess(resc,resv,argc,(mxArray**)(argv)); break;
  case 905: flag=_wrap_no_grad(resc,resv,argc,(mxArray**)(argv)); break;
  case 906: flag=_wrap_Importer_type_name(resc,resv,argc,(mxArray**)(argv)); break;
  case 907: flag=_wrap_Importer_test_cast(resc,resv,argc,(mxArray**)(argv)); break;
  case 908: flag=_wrap_Importer_has_plugin(resc,resv,argc,(mxArray**)(argv)); break;
  case 909: flag=_wrap_Importer_load_plugin(resc,resv,argc,(mxArray**)(argv)); break;
  case 910: flag=_wrap_Importer_doc(resc,resv,argc,(mxArray**)(argv)); break;
  case 911: flag=_wrap_Importer_plugin_name(resc,resv,argc,(mxArray**)(argv)); break;
  case 912: flag=_wrap_Importer_has_function(resc,resv,argc,(mxArray**)(argv)); break;
  case 913: flag=_wrap_Importer_has_meta(resc,resv,argc,(mxArray**)(argv)); break;
  case 914: flag=_wrap_Importer_get_meta(resc,resv,argc,(mxArray**)(argv)); break;
  case 915: flag=_wrap_Importer_inlined(resc,resv,argc,(mxArray**)(argv)); break;
  case 916: flag=_wrap_Importer_body(resc,resv,argc,(mxArray**)(argv)); break;
  case 917: flag=_wrap_Importer_library(resc,resv,argc,(mxArray**)(argv)); break;
  case 918: flag=_wrap_Importer_serialize(resc,resv,argc,(mxArray**)(argv)); break;
  case 919: flag=_wrap_Importer_deserialize(resc,resv,argc,(mxArray**)(argv)); break;
  case 920: flag=_wrap_new_Importer(resc,resv,argc,(mxArray**)(argv)); break;
  case 921: flag=_wrap_delete_Importer(resc,resv,argc,(mxArray**)(argv)); break;
  case 922: flag=_wrap_Callback_type_name(resc,resv,argc,(mxArray**)(argv)); break;
  case 923: flag=_wrap_new_Callback(resc,resv,argc,(mxArray**)(argv)); break;
  case 924: flag=_wrap_delete_Callback(resc,resv,argc,(mxArray**)(argv)); break;
  case 925: flag=_wrap_Callback_construct(resc,resv,argc,(mxArray**)(argv)); break;
  case 926: flag=_wrap_Callback_init(resc,resv,argc,(mxArray**)(argv)); break;
  case 927: flag=_wrap_Callback_finalize(resc,resv,argc,(mxArray**)(argv)); break;
  case 928: flag=_wrap_Callback_eval(resc,resv,argc,(mxArray**)(argv)); break;
  case 929: flag=_wrap_Callback_eval_buffer(resc,resv,argc,(mxArray**)(argv)); break;
  case 930: flag=_wrap_Callback_has_eval_buffer(resc,resv,argc,(mxArray**)(argv)); break;
  case 931: flag=_wrap_Callback_get_n_in(resc,resv,argc,(mxArray**)(argv)); break;
  case 932: flag=_wrap_Callback_get_n_out(resc,resv,argc,(mxArray**)(argv)); break;
  case 933: flag=_wrap_Callback_get_sparsity_in(resc,resv,argc,(mxArray**)(argv)); break;
  case 934: flag=_wrap_Callback_get_sparsity_out(resc,resv,argc,(mxArray**)(argv)); break;
  case 935: flag=_wrap_Callback_get_name_in(resc,resv,argc,(mxArray**)(argv)); break;
  case 936: flag=_wrap_Callback_get_name_out(resc,resv,argc,(mxArray**)(argv)); break;
  case 937: flag=_wrap_Callback_uses_output(resc,resv,argc,(mxArray**)(argv)); break;
  case 938: flag=_wrap_Callback_has_jacobian(resc,resv,argc,(mxArray**)(argv)); break;
  case 939: flag=_wrap_Callback_get_jacobian(resc,resv,argc,(mxArray**)(argv)); break;
  case 940: flag=_wrap_Callback_has_forward(resc,resv,argc,(mxArray**)(argv)); break;
  case 941: flag=_wrap_Callback_get_forward(resc,resv,argc,(mxArray**)(argv)); break;
  case 942: flag=_wrap_Callback_has_reverse(resc,resv,argc,(mxArray**)(argv)); break;
  case 943: flag=_wrap_Callback_get_reverse(resc,resv,argc,(mxArray**)(argv)); break;
  case 944: flag=_wrap_Callback_has_jac_sparsity(resc,resv,argc,(mxArray**)(argv)); break;
  case 945: flag=_wrap_Callback_get_jac_sparsity(resc,resv,argc,(mxArray**)(argv)); break;
  case 946: flag=_wrap_GlobalOptions_setSimplificationOnTheFly(resc,resv,argc,(mxArray**)(argv)); break;
  case 947: flag=_wrap_GlobalOptions_getSimplificationOnTheFly(resc,resv,argc,(mxArray**)(argv)); break;
  case 948: flag=_wrap_GlobalOptions_setHierarchicalSparsity(resc,resv,argc,(mxArray**)(argv)); break;
  case 949: flag=_wrap_GlobalOptions_getHierarchicalSparsity(resc,resv,argc,(mxArray**)(argv)); break;
  case 950: flag=_wrap_GlobalOptions_setCasadiPath(resc,resv,argc,(mxArray**)(argv)); break;
  case 951: flag=_wrap_GlobalOptions_getCasadiPath(resc,resv,argc,(mxArray**)(argv)); break;
  case 952: flag=_wrap_GlobalOptions_setCasadiIncludePath(resc,resv,argc,(mxArray**)(argv)); break;
  case 953: flag=_wrap_GlobalOptions_getCasadiIncludePath(resc,resv,argc,(mxArray**)(argv)); break;
  case 954: flag=_wrap_GlobalOptions_setMaxNumDir(resc,resv,argc,(mxArray**)(argv)); break;
  case 955: flag=_wrap_GlobalOptions_getMaxNumDir(resc,resv,argc,(mxArray**)(argv)); break;
  case 956: flag=_wrap_new_GlobalOptions(resc,resv,argc,(mxArray**)(argv)); break;
  case 957: flag=_wrap_delete_GlobalOptions(resc,resv,argc,(mxArray**)(argv)); break;
  case 958: flag=_wrap_CasadiMeta_version(resc,resv,argc,(mxArray**)(argv)); break;
  case 959: flag=_wrap_CasadiMeta_git_revision(resc,resv,argc,(mxArray**)(argv)); break;
  case 960: flag=_wrap_CasadiMeta_git_describe(resc,resv,argc,(mxArray**)(argv)); break;
  case 961: flag=_wrap_CasadiMeta_feature_list(resc,resv,argc,(mxArray**)(argv)); break;
  case 962: flag=_wrap_CasadiMeta_build_type(resc,resv,argc,(mxArray**)(argv)); break;
  case 963: flag=_wrap_CasadiMeta_compiler_id(resc,resv,argc,(mxArray**)(argv)); break;
  case 964: flag=_wrap_CasadiMeta_compiler(resc,resv,argc,(mxArray**)(argv)); break;
  case 965: flag=_wrap_CasadiMeta_compiler_flags(resc,resv,argc,(mxArray**)(argv)); break;
  case 966: flag=_wrap_CasadiMeta_modules(resc,resv,argc,(mxArray**)(argv)); break;
  case 967: flag=_wrap_CasadiMeta_plugins(resc,resv,argc,(mxArray**)(argv)); break;
  case 968: flag=_wrap_CasadiMeta_install_prefix(resc,resv,argc,(mxArray**)(argv)); break;
  case 969: flag=_wrap_new_CasadiMeta(resc,resv,argc,(mxArray**)(argv)); break;
  case 970: flag=_wrap_delete_CasadiMeta(resc,resv,argc,(mxArray**)(argv)); break;
  case 971: flag=_wrap_collocation_points(resc,resv,argc,(mxArray**)(argv)); break;
  case 972: flag=_wrap_collocation_interpolators(resc,resv,argc,(mxArray**)(argv)); break;
  case 973: flag=_wrap_collocation_coeff(resc,resv,argc,(mxArray**)(argv)); break;
  case 974: flag=_wrap_simpleRK(resc,resv,argc,(mxArray**)(argv)); break;
  case 975: flag=_wrap_simpleIRK(resc,resv,argc,(mxArray**)(argv)); break;
  case 976: flag=_wrap_simpleIntegrator(resc,resv,argc,(mxArray**)(argv)); break;
  case 977: flag=_wrap_dae_reduce_index(resc,resv,argc,(mxArray**)(argv)); break;
  case 978: flag=_wrap_dae_map_semi_expl(resc,resv,argc,(mxArray**)(argv)); break;
  case 979: flag=_wrap_dae_init_gen(resc,resv,argc,(mxArray**)(argv)); break;
  case 980: flag=_wrap_detect_simple_bounds(resc,resv,argc,(mxArray**)(argv)); break;
  case 981: flag=_wrap_external_transform(resc,resv,argc,(mxArray**)(argv)); break;
  case 982: flag=_wrap_NlpBuilder_x_get(resc,resv,argc,(mxArray**)(argv)); break;
  case 983: flag=_wrap_NlpBuilder_f_get(resc,resv,argc,(mxArray**)(argv)); break;
  case 984: flag=_wrap_NlpBuilder_g_get(resc,resv,argc,(mxArray**)(argv)); break;
  case 985: flag=_wrap_NlpBuilder_x_lb_get(resc,resv,argc,(mxArray**)(argv)); break;
  case 986: flag=_wrap_NlpBuilder_x_ub_get(resc,resv,argc,(mxArray**)(argv)); break;
  case 987: flag=_wrap_NlpBuilder_g_lb_get(resc,resv,argc,(mxArray**)(argv)); break;
  case 988: flag=_wrap_NlpBuilder_g_ub_get(resc,resv,argc,(mxArray**)(argv)); break;
  case 989: flag=_wrap_NlpBuilder_x_init_get(resc,resv,argc,(mxArray**)(argv)); break;
  case 990: flag=_wrap_NlpBuilder_lambda_init_get(resc,resv,argc,(mxArray**)(argv)); break;
  case 991: flag=_wrap_NlpBuilder_discrete_get(resc,resv,argc,(mxArray**)(argv)); break;
  case 992: flag=_wrap_NlpBuilder_import_nl(resc,resv,argc,(mxArray**)(argv)); break;
  case 993: flag=_wrap_NlpBuilder_type_name(resc,resv,argc,(mxArray**)(argv)); break;
  case 994: flag=_wrap_NlpBuilder_disp(resc,resv,argc,(mxArray**)(argv)); break;
  case 995: flag=_wrap_NlpBuilder_str(resc,resv,argc,(mxArray**)(argv)); break;
  case 996: flag=_wrap_new_NlpBuilder(resc,resv,argc,(mxArray**)(argv)); break;
  case 997: flag=_wrap_delete_NlpBuilder(resc,resv,argc,(mxArray**)(argv)); break;
  case 998: flag=_wrap_DaeBuilder_type_name(resc,resv,argc,(mxArray**)(argv)); break;
  case 999: flag=_wrap_DaeBuilder_name(resc,resv,argc,(mxArray**)(argv)); break;
  case 1000: flag=_wrap_DaeBuilder_t(resc,resv,argc,(mxArray**)(argv)); break;
  case 1001: flag=_wrap_DaeBuilder_x(resc,resv,argc,(mxArray**)(argv)); break;
  case 1002: flag=_wrap_DaeBuilder_ode(resc,resv,argc,(mxArray**)(argv)); break;
  case 1003: flag=_wrap_DaeBuilder_z(resc,resv,argc,(mxArray**)(argv)); break;
  case 1004: flag=_wrap_DaeBuilder_alg(resc,resv,argc,(mxArray**)(argv)); break;
  case 1005: flag=_wrap_DaeBuilder_q(resc,resv,argc,(mxArray**)(argv)); break;
  case 1006: flag=_wrap_DaeBuilder_quad(resc,resv,argc,(mxArray**)(argv)); break;
  case 1007: flag=_wrap_DaeBuilder_y(resc,resv,argc,(mxArray**)(argv)); break;
  case 1008: flag=_wrap_DaeBuilder_ydef(resc,resv,argc,(mxArray**)(argv)); break;
  case 1009: flag=_wrap_DaeBuilder_u(resc,resv,argc,(mxArray**)(argv)); break;
  case 1010: flag=_wrap_DaeBuilder_p(resc,resv,argc,(mxArray**)(argv)); break;
  case 1011: flag=_wrap_DaeBuilder_c(resc,resv,argc,(mxArray**)(argv)); break;
  case 1012: flag=_wrap_DaeBuilder_cdef(resc,resv,argc,(mxArray**)(argv)); break;
  case 1013: flag=_wrap_DaeBuilder_d(resc,resv,argc,(mxArray**)(argv)); break;
  case 1014: flag=_wrap_DaeBuilder_ddef(resc,resv,argc,(mxArray**)(argv)); break;
  case 1015: flag=_wrap_DaeBuilder_w(resc,resv,argc,(mxArray**)(argv)); break;
  case 1016: flag=_wrap_DaeBuilder_wdef(resc,resv,argc,(mxArray**)(argv)); break;
  case 1017: flag=_wrap_DaeBuilder_aux(resc,resv,argc,(mxArray**)(argv)); break;
  case 1018: flag=_wrap_DaeBuilder_init_lhs(resc,resv,argc,(mxArray**)(argv)); break;
  case 1019: flag=_wrap_DaeBuilder_init_rhs(resc,resv,argc,(mxArray**)(argv)); break;
  case 1020: flag=_wrap_DaeBuilder_when_cond(resc,resv,argc,(mxArray**)(argv)); break;
  case 1021: flag=_wrap_DaeBuilder_when_lhs(resc,resv,argc,(mxArray**)(argv)); break;
  case 1022: flag=_wrap_DaeBuilder_when_rhs(resc,resv,argc,(mxArray**)(argv)); break;
  case 1023: flag=_wrap_DaeBuilder_outputs(resc,resv,argc,(mxArray**)(argv)); break;
  case 1024: flag=_wrap_DaeBuilder_derivatives(resc,resv,argc,(mxArray**)(argv)); break;
  case 1025: flag=_wrap_DaeBuilder_initial_unknowns(resc,resv,argc,(mxArray**)(argv)); break;
  case 1026: flag=_wrap_DaeBuilder_has_t(resc,resv,argc,(mxArray**)(argv)); break;
  case 1027: flag=_wrap_DaeBuilder_nx(resc,resv,argc,(mxArray**)(argv)); break;
  case 1028: flag=_wrap_DaeBuilder_nz(resc,resv,argc,(mxArray**)(argv)); break;
  case 1029: flag=_wrap_DaeBuilder_nq(resc,resv,argc,(mxArray**)(argv)); break;
  case 1030: flag=_wrap_DaeBuilder_ny(resc,resv,argc,(mxArray**)(argv)); break;
  case 1031: flag=_wrap_DaeBuilder_nu(resc,resv,argc,(mxArray**)(argv)); break;
  case 1032: flag=_wrap_DaeBuilder_np(resc,resv,argc,(mxArray**)(argv)); break;
  case 1033: flag=_wrap_DaeBuilder_nc(resc,resv,argc,(mxArray**)(argv)); break;
  case 1034: flag=_wrap_DaeBuilder_nd(resc,resv,argc,(mxArray**)(argv)); break;
  case 1035: flag=_wrap_DaeBuilder_nw(resc,resv,argc,(mxArray**)(argv)); break;
  case 1036: flag=_wrap_DaeBuilder_add_t(resc,resv,argc,(mxArray**)(argv)); break;
  case 1037: flag=_wrap_DaeBuilder_add_p(resc,resv,argc,(mxArray**)(argv)); break;
  case 1038: flag=_wrap_DaeBuilder_add_u(resc,resv,argc,(mxArray**)(argv)); break;
  case 1039: flag=_wrap_DaeBuilder_add_x(resc,resv,argc,(mxArray**)(argv)); break;
  case 1040: flag=_wrap_DaeBuilder_add_z(resc,resv,argc,(mxArray**)(argv)); break;
  case 1041: flag=_wrap_DaeBuilder_add_q(resc,resv,argc,(mxArray**)(argv)); break;
  case 1042: flag=_wrap_DaeBuilder_add_c(resc,resv,argc,(mxArray**)(argv)); break;
  case 1043: flag=_wrap_DaeBuilder_add_d(resc,resv,argc,(mxArray**)(argv)); break;
  case 1044: flag=_wrap_DaeBuilder_add_w(resc,resv,argc,(mxArray**)(argv)); break;
  case 1045: flag=_wrap_DaeBuilder_add_y(resc,resv,argc,(mxArray**)(argv)); break;
  case 1046: flag=_wrap_DaeBuilder_set_ode(resc,resv,argc,(mxArray**)(argv)); break;
  case 1047: flag=_wrap_DaeBuilder_set_alg(resc,resv,argc,(mxArray**)(argv)); break;
  case 1048: flag=_wrap_DaeBuilder_add_aux(resc,resv,argc,(mxArray**)(argv)); break;
  case 1049: flag=_wrap_DaeBuilder_add_init(resc,resv,argc,(mxArray**)(argv)); break;
  case 1050: flag=_wrap_DaeBuilder_add_when(resc,resv,argc,(mxArray**)(argv)); break;
  case 1051: flag=_wrap_DaeBuilder_sanity_check(resc,resv,argc,(mxArray**)(argv)); break;
  case 1052: flag=_wrap_DaeBuilder_clear_all(resc,resv,argc,(mxArray**)(argv)); break;
  case 1053: flag=_wrap_DaeBuilder_set_all(resc,resv,argc,(mxArray**)(argv)); break;
  case 1054: flag=_wrap_DaeBuilder_register_t(resc,resv,argc,(mxArray**)(argv)); break;
  case 1055: flag=_wrap_DaeBuilder_register_p(resc,resv,argc,(mxArray**)(argv)); break;
  case 1056: flag=_wrap_DaeBuilder_register_u(resc,resv,argc,(mxArray**)(argv)); break;
  case 1057: flag=_wrap_DaeBuilder_register_x(resc,resv,argc,(mxArray**)(argv)); break;
  case 1058: flag=_wrap_DaeBuilder_register_z(resc,resv,argc,(mxArray**)(argv)); break;
  case 1059: flag=_wrap_DaeBuilder_register_q(resc,resv,argc,(mxArray**)(argv)); break;
  case 1060: flag=_wrap_DaeBuilder_register_c(resc,resv,argc,(mxArray**)(argv)); break;
  case 1061: flag=_wrap_DaeBuilder_register_d(resc,resv,argc,(mxArray**)(argv)); break;
  case 1062: flag=_wrap_DaeBuilder_register_w(resc,resv,argc,(mxArray**)(argv)); break;
  case 1063: flag=_wrap_DaeBuilder_register_y(resc,resv,argc,(mxArray**)(argv)); break;
  case 1064: flag=_wrap_DaeBuilder_set_u(resc,resv,argc,(mxArray**)(argv)); break;
  case 1065: flag=_wrap_DaeBuilder_set_x(resc,resv,argc,(mxArray**)(argv)); break;
  case 1066: flag=_wrap_DaeBuilder_set_z(resc,resv,argc,(mxArray**)(argv)); break;
  case 1067: flag=_wrap_DaeBuilder_set_q(resc,resv,argc,(mxArray**)(argv)); break;
  case 1068: flag=_wrap_DaeBuilder_set_y(resc,resv,argc,(mxArray**)(argv)); break;
  case 1069: flag=_wrap_DaeBuilder_clear_in(resc,resv,argc,(mxArray**)(argv)); break;
  case 1070: flag=_wrap_DaeBuilder_eliminate_w(resc,resv,argc,(mxArray**)(argv)); break;
  case 1071: flag=_wrap_DaeBuilder_lift(resc,resv,argc,(mxArray**)(argv)); break;
  case 1072: flag=_wrap_DaeBuilder_eliminate_quad(resc,resv,argc,(mxArray**)(argv)); break;
  case 1073: flag=_wrap_DaeBuilder_sort_d(resc,resv,argc,(mxArray**)(argv)); break;
  case 1074: flag=_wrap_DaeBuilder_sort_w(resc,resv,argc,(mxArray**)(argv)); break;
  case 1075: flag=_wrap_DaeBuilder_sort_z(resc,resv,argc,(mxArray**)(argv)); break;
  case 1076: flag=_wrap_DaeBuilder_prune(resc,resv,argc,(mxArray**)(argv)); break;
  case 1077: flag=_wrap_DaeBuilder_tear(resc,resv,argc,(mxArray**)(argv)); break;
  case 1078: flag=_wrap_DaeBuilder_add_fun(resc,resv,argc,(mxArray**)(argv)); break;
  case 1079: flag=_wrap_DaeBuilder_has_fun(resc,resv,argc,(mxArray**)(argv)); break;
  case 1080: flag=_wrap_DaeBuilder_fun(resc,resv,argc,(mxArray**)(argv)); break;
  case 1081: flag=_wrap_DaeBuilder_gather_fun(resc,resv,argc,(mxArray**)(argv)); break;
  case 1082: flag=_wrap_DaeBuilder_parse_fmi(resc,resv,argc,(mxArray**)(argv)); break;
  case 1083: flag=_wrap_DaeBuilder_provides_directional_derivative(resc,resv,argc,(mxArray**)(argv)); break;
  case 1084: flag=_wrap_DaeBuilder_load_fmi_description(resc,resv,argc,(mxArray**)(argv)); break;
  case 1085: flag=_wrap_DaeBuilder_export_fmu(resc,resv,argc,(mxArray**)(argv)); break;
  case 1086: flag=_wrap_DaeBuilder_add_lc(resc,resv,argc,(mxArray**)(argv)); break;
  case 1087: flag=_wrap_DaeBuilder_create(resc,resv,argc,(mxArray**)(argv)); break;
  case 1088: flag=_wrap_DaeBuilder_dependent_fun(resc,resv,argc,(mxArray**)(argv)); break;
  case 1089: flag=_wrap_DaeBuilder_var(resc,resv,argc,(mxArray**)(argv)); break;
  case 1090: flag=_wrap_DaeBuilder_paren(resc,resv,argc,(mxArray**)(argv)); break;
  case 1091: flag=_wrap_DaeBuilder_der(resc,resv,argc,(mxArray**)(argv)); break;
  case 1092: flag=_wrap_DaeBuilder_beq(resc,resv,argc,(mxArray**)(argv)); break;
  case 1093: flag=_wrap_DaeBuilder_set_beq(resc,resv,argc,(mxArray**)(argv)); break;
  case 1094: flag=_wrap_DaeBuilder_value_reference(resc,resv,argc,(mxArray**)(argv)); break;
  case 1095: flag=_wrap_DaeBuilder_set_value_reference(resc,resv,argc,(mxArray**)(argv)); break;
  case 1096: flag=_wrap_DaeBuilder_description(resc,resv,argc,(mxArray**)(argv)); break;
  case 1097: flag=_wrap_DaeBuilder_set_description(resc,resv,argc,(mxArray**)(argv)); break;
  case 1098: flag=_wrap_DaeBuilder_type(resc,resv,argc,(mxArray**)(argv)); break;
  case 1099: flag=_wrap_DaeBuilder_set_type(resc,resv,argc,(mxArray**)(argv)); break;
  case 1100: flag=_wrap_DaeBuilder_causality(resc,resv,argc,(mxArray**)(argv)); break;
  case 1101: flag=_wrap_DaeBuilder_set_causality(resc,resv,argc,(mxArray**)(argv)); break;
  case 1102: flag=_wrap_DaeBuilder_variability(resc,resv,argc,(mxArray**)(argv)); break;
  case 1103: flag=_wrap_DaeBuilder_set_variability(resc,resv,argc,(mxArray**)(argv)); break;
  case 1104: flag=_wrap_DaeBuilder_initial(resc,resv,argc,(mxArray**)(argv)); break;
  case 1105: flag=_wrap_DaeBuilder_set_initial(resc,resv,argc,(mxArray**)(argv)); break;
  case 1106: flag=_wrap_DaeBuilder_unit(resc,resv,argc,(mxArray**)(argv)); break;
  case 1107: flag=_wrap_DaeBuilder_set_unit(resc,resv,argc,(mxArray**)(argv)); break;
  case 1108: flag=_wrap_DaeBuilder_display_unit(resc,resv,argc,(mxArray**)(argv)); break;
  case 1109: flag=_wrap_DaeBuilder_set_display_unit(resc,resv,argc,(mxArray**)(argv)); break;
  case 1110: flag=_wrap_DaeBuilder_numel(resc,resv,argc,(mxArray**)(argv)); break;
  case 1111: flag=_wrap_DaeBuilder_dimension(resc,resv,argc,(mxArray**)(argv)); break;
  case 1112: flag=_wrap_DaeBuilder_attribute(resc,resv,argc,(mxArray**)(argv)); break;
  case 1113: flag=_wrap_DaeBuilder_set_attribute(resc,resv,argc,(mxArray**)(argv)); break;
  case 1114: flag=_wrap_DaeBuilder_min(resc,resv,argc,(mxArray**)(argv)); break;
  case 1115: flag=_wrap_DaeBuilder_set_min(resc,resv,argc,(mxArray**)(argv)); break;
  case 1116: flag=_wrap_DaeBuilder_max(resc,resv,argc,(mxArray**)(argv)); break;
  case 1117: flag=_wrap_DaeBuilder_set_max(resc,resv,argc,(mxArray**)(argv)); break;
  case 1118: flag=_wrap_DaeBuilder_nominal(resc,resv,argc,(mxArray**)(argv)); break;
  case 1119: flag=_wrap_DaeBuilder_set_nominal(resc,resv,argc,(mxArray**)(argv)); break;
  case 1120: flag=_wrap_DaeBuilder_start(resc,resv,argc,(mxArray**)(argv)); break;
  case 1121: flag=_wrap_DaeBuilder_set_start(resc,resv,argc,(mxArray**)(argv)); break;
  case 1122: flag=_wrap_DaeBuilder_set(resc,resv,argc,(mxArray**)(argv)); break;
  case 1123: flag=_wrap_DaeBuilder_get(resc,resv,argc,(mxArray**)(argv)); break;
  case 1124: flag=_wrap_DaeBuilder_add_variable(resc,resv,argc,(mxArray**)(argv)); break;
  case 1125: flag=_wrap_DaeBuilder_add_variable_new(resc,resv,argc,(mxArray**)(argv)); break;
  case 1126: flag=_wrap_DaeBuilder_has_variable(resc,resv,argc,(mxArray**)(argv)); break;
  case 1127: flag=_wrap_DaeBuilder_all_variables(resc,resv,argc,(mxArray**)(argv)); break;
  case 1128: flag=_wrap_DaeBuilder_oracle(resc,resv,argc,(mxArray**)(argv)); break;
  case 1129: flag=_wrap_DaeBuilder_jac_sparsity(resc,resv,argc,(mxArray**)(argv)); break;
  case 1130: flag=_wrap_new_DaeBuilder(resc,resv,argc,(mxArray**)(argv)); break;
  case 1131: flag=_wrap_delete_DaeBuilder(resc,resv,argc,(mxArray**)(argv)); break;
  case 1132: flag=_wrap_XmlFile_type_name(resc,resv,argc,(mxArray**)(argv)); break;
  case 1133: flag=_wrap_delete_XmlFile(resc,resv,argc,(mxArray**)(argv)); break;
  case 1134: flag=_wrap_XmlFile_load_plugin(resc,resv,argc,(mxArray**)(argv)); break;
  case 1135: flag=_wrap_XmlFile_doc(resc,resv,argc,(mxArray**)(argv)); break;
  case 1136: flag=_wrap_new_XmlFile(resc,resv,argc,(mxArray**)(argv)); break;
  case 1137: flag=_wrap_delete_SerializerBase(resc,resv,argc,(mxArray**)(argv)); break;
  case 1138: flag=_wrap_SerializerBase_pack(resc,resv,argc,(mxArray**)(argv)); break;
  case 1139: flag=_wrap_SerializerBase_type_to_string(resc,resv,argc,(mxArray**)(argv)); break;
  case 1140: flag=_wrap_SerializerBase_connect(resc,resv,argc,(mxArray**)(argv)); break;
  case 1141: flag=_wrap_SerializerBase_reset(resc,resv,argc,(mxArray**)(argv)); break;
  case 1142: flag=_wrap_delete_DeserializerBase(resc,resv,argc,(mxArray**)(argv)); break;
  case 1143: flag=_wrap_DeserializerBase_internal_pop_type(resc,resv,argc,(mxArray**)(argv)); break;
  case 1144: flag=_wrap_DeserializerBase_blind_unpack_sparsity(resc,resv,argc,(mxArray**)(argv)); break;
  case 1145: flag=_wrap_DeserializerBase_blind_unpack_mx(resc,resv,argc,(mxArray**)(argv)); break;
  case 1146: flag=_wrap_DeserializerBase_blind_unpack_dm(resc,resv,argc,(mxArray**)(argv)); break;
  case 1147: flag=_wrap_DeserializerBase_blind_unpack_sx(resc,resv,argc,(mxArray**)(argv)); break;
  case 1148: flag=_wrap_DeserializerBase_blind_unpack_linsol(resc,resv,argc,(mxArray**)(argv)); break;
  case 1149: flag=_wrap_DeserializerBase_blind_unpack_function(resc,resv,argc,(mxArray**)(argv)); break;
  case 1150: flag=_wrap_DeserializerBase_blind_unpack_generictype(resc,resv,argc,(mxArray**)(argv)); break;
  case 1151: flag=_wrap_DeserializerBase_blind_unpack_int(resc,resv,argc,(mxArray**)(argv)); break;
  case 1152: flag=_wrap_DeserializerBase_blind_unpack_double(resc,resv,argc,(mxArray**)(argv)); break;
  case 1153: flag=_wrap_DeserializerBase_blind_unpack_string(resc,resv,argc,(mxArray**)(argv)); break;
  case 1154: flag=_wrap_DeserializerBase_blind_unpack_sparsity_vector(resc,resv,argc,(mxArray**)(argv)); break;
  case 1155: flag=_wrap_DeserializerBase_blind_unpack_mx_vector(resc,resv,argc,(mxArray**)(argv)); break;
  case 1156: flag=_wrap_DeserializerBase_blind_unpack_dm_vector(resc,resv,argc,(mxArray**)(argv)); break;
  case 1157: flag=_wrap_DeserializerBase_blind_unpack_sx_vector(resc,resv,argc,(mxArray**)(argv)); break;
  case 1158: flag=_wrap_DeserializerBase_blind_unpack_linsol_vector(resc,resv,argc,(mxArray**)(argv)); break;
  case 1159: flag=_wrap_DeserializerBase_blind_unpack_function_vector(resc,resv,argc,(mxArray**)(argv)); break;
  case 1160: flag=_wrap_DeserializerBase_blind_unpack_generictype_vector(resc,resv,argc,(mxArray**)(argv)); break;
  case 1161: flag=_wrap_DeserializerBase_blind_unpack_int_vector(resc,resv,argc,(mxArray**)(argv)); break;
  case 1162: flag=_wrap_DeserializerBase_blind_unpack_double_vector(resc,resv,argc,(mxArray**)(argv)); break;
  case 1163: flag=_wrap_DeserializerBase_blind_unpack_string_vector(resc,resv,argc,(mxArray**)(argv)); break;
  case 1164: flag=_wrap_DeserializerBase_unpack_sparsity(resc,resv,argc,(mxArray**)(argv)); break;
  case 1165: flag=_wrap_DeserializerBase_unpack_mx(resc,resv,argc,(mxArray**)(argv)); break;
  case 1166: flag=_wrap_DeserializerBase_unpack_dm(resc,resv,argc,(mxArray**)(argv)); break;
  case 1167: flag=_wrap_DeserializerBase_unpack_sx(resc,resv,argc,(mxArray**)(argv)); break;
  case 1168: flag=_wrap_DeserializerBase_unpack_linsol(resc,resv,argc,(mxArray**)(argv)); break;
  case 1169: flag=_wrap_DeserializerBase_unpack_function(resc,resv,argc,(mxArray**)(argv)); break;
  case 1170: flag=_wrap_DeserializerBase_unpack_generictype(resc,resv,argc,(mxArray**)(argv)); break;
  case 1171: flag=_wrap_DeserializerBase_unpack_int(resc,resv,argc,(mxArray**)(argv)); break;
  case 1172: flag=_wrap_DeserializerBase_unpack_double(resc,resv,argc,(mxArray**)(argv)); break;
  case 1173: flag=_wrap_DeserializerBase_unpack_string(resc,resv,argc,(mxArray**)(argv)); break;
  case 1174: flag=_wrap_DeserializerBase_unpack_sparsity_vector(resc,resv,argc,(mxArray**)(argv)); break;
  case 1175: flag=_wrap_DeserializerBase_unpack_mx_vector(resc,resv,argc,(mxArray**)(argv)); break;
  case 1176: flag=_wrap_DeserializerBase_unpack_dm_vector(resc,resv,argc,(mxArray**)(argv)); break;
  case 1177: flag=_wrap_DeserializerBase_unpack_sx_vector(resc,resv,argc,(mxArray**)(argv)); break;
  case 1178: flag=_wrap_DeserializerBase_unpack_linsol_vector(resc,resv,argc,(mxArray**)(argv)); break;
  case 1179: flag=_wrap_DeserializerBase_unpack_function_vector(resc,resv,argc,(mxArray**)(argv)); break;
  case 1180: flag=_wrap_DeserializerBase_unpack_generictype_vector(resc,resv,argc,(mxArray**)(argv)); break;
  case 1181: flag=_wrap_DeserializerBase_unpack_int_vector(resc,resv,argc,(mxArray**)(argv)); break;
  case 1182: flag=_wrap_DeserializerBase_unpack_double_vector(resc,resv,argc,(mxArray**)(argv)); break;
  case 1183: flag=_wrap_DeserializerBase_unpack_string_vector(resc,resv,argc,(mxArray**)(argv)); break;
  case 1184: flag=_wrap_DeserializerBase_connect(resc,resv,argc,(mxArray**)(argv)); break;
  case 1185: flag=_wrap_DeserializerBase_reset(resc,resv,argc,(mxArray**)(argv)); break;
  case 1186: flag=_wrap_new_StringSerializer(resc,resv,argc,(mxArray**)(argv)); break;
  case 1187: flag=_wrap_delete_StringSerializer(resc,resv,argc,(mxArray**)(argv)); break;
  case 1188: flag=_wrap_StringSerializer_encode(resc,resv,argc,(mxArray**)(argv)); break;
  case 1189: flag=_wrap_new_FileSerializer(resc,resv,argc,(mxArray**)(argv)); break;
  case 1190: flag=_wrap_delete_FileSerializer(resc,resv,argc,(mxArray**)(argv)); break;
  case 1191: flag=_wrap_new_StringDeserializer(resc,resv,argc,(mxArray**)(argv)); break;
  case 1192: flag=_wrap_delete_StringDeserializer(resc,resv,argc,(mxArray**)(argv)); break;
  case 1193: flag=_wrap_StringDeserializer_decode(resc,resv,argc,(mxArray**)(argv)); break;
  case 1194: flag=_wrap_new_FileDeserializer(resc,resv,argc,(mxArray**)(argv)); break;
  case 1195: flag=_wrap_delete_FileDeserializer(resc,resv,argc,(mxArray**)(argv)); break;
  case 1196: flag=_wrap_Opti_internal_variable(resc,resv,argc,(mxArray**)(argv)); break;
  case 1197: flag=_wrap_Opti_internal_parameter(resc,resv,argc,(mxArray**)(argv)); break;
  case 1198: flag=_wrap_Opti_minimize(resc,resv,argc,(mxArray**)(argv)); break;
  case 1199: flag=_wrap_Opti_internal_subject_to(resc,resv,argc,(mxArray**)(argv)); break;
  case 1200: flag=_wrap_Opti_solver(resc,resv,argc,(mxArray**)(argv)); break;
  case 1201: flag=_wrap_Opti_set_initial(resc,resv,argc,(mxArray**)(argv)); break;
  case 1202: flag=_wrap_Opti_set_value(resc,resv,argc,(mxArray**)(argv)); break;
  case 1203: flag=_wrap_Opti_solve(resc,resv,argc,(mxArray**)(argv)); break;
  case 1204: flag=_wrap_Opti_solve_limited(resc,resv,argc,(mxArray**)(argv)); break;
  case 1205: flag=_wrap_Opti_value(resc,resv,argc,(mxArray**)(argv)); break;
  case 1206: flag=_wrap_Opti_stats(resc,resv,argc,(mxArray**)(argv)); break;
  case 1207: flag=_wrap_Opti_return_status(resc,resv,argc,(mxArray**)(argv)); break;
  case 1208: flag=_wrap_Opti_initial(resc,resv,argc,(mxArray**)(argv)); break;
  case 1209: flag=_wrap_Opti_value_variables(resc,resv,argc,(mxArray**)(argv)); break;
  case 1210: flag=_wrap_Opti_value_parameters(resc,resv,argc,(mxArray**)(argv)); break;
  case 1211: flag=_wrap_Opti_dual(resc,resv,argc,(mxArray**)(argv)); break;
  case 1212: flag=_wrap_Opti_nx(resc,resv,argc,(mxArray**)(argv)); break;
  case 1213: flag=_wrap_Opti_np(resc,resv,argc,(mxArray**)(argv)); break;
  case 1214: flag=_wrap_Opti_ng(resc,resv,argc,(mxArray**)(argv)); break;
  case 1215: flag=_wrap_Opti_x(resc,resv,argc,(mxArray**)(argv)); break;
  case 1216: flag=_wrap_Opti_p(resc,resv,argc,(mxArray**)(argv)); break;
  case 1217: flag=_wrap_Opti_g(resc,resv,argc,(mxArray**)(argv)); break;
  case 1218: flag=_wrap_Opti_f(resc,resv,argc,(mxArray**)(argv)); break;
  case 1219: flag=_wrap_Opti_lbg(resc,resv,argc,(mxArray**)(argv)); break;
  case 1220: flag=_wrap_Opti_ubg(resc,resv,argc,(mxArray**)(argv)); break;
  case 1221: flag=_wrap_Opti_lam_g(resc,resv,argc,(mxArray**)(argv)); break;
  case 1222: flag=_wrap_Opti_to_function(resc,resv,argc,(mxArray**)(argv)); break;
  case 1223: flag=_wrap_Opti_debug(resc,resv,argc,(mxArray**)(argv)); break;
  case 1224: flag=_wrap_Opti_advanced(resc,resv,argc,(mxArray**)(argv)); break;
  case 1225: flag=_wrap_Opti_copy(resc,resv,argc,(mxArray**)(argv)); break;
  case 1226: flag=_wrap_Opti_update_user_dict(resc,resv,argc,(mxArray**)(argv)); break;
  case 1227: flag=_wrap_Opti_user_dict(resc,resv,argc,(mxArray**)(argv)); break;
  case 1228: flag=_wrap_Opti_type_name(resc,resv,argc,(mxArray**)(argv)); break;
  case 1229: flag=_wrap_Opti_disp(resc,resv,argc,(mxArray**)(argv)); break;
  case 1230: flag=_wrap_Opti_str(resc,resv,argc,(mxArray**)(argv)); break;
  case 1231: flag=_wrap_Opti_callback_class(resc,resv,argc,(mxArray**)(argv)); break;
  case 1232: flag=_wrap_new_Opti(resc,resv,argc,(mxArray**)(argv)); break;
  case 1233: flag=_wrap_delete_Opti(resc,resv,argc,(mxArray**)(argv)); break;
  case 1234: flag=_wrap_IndexAbstraction_start_get(resc,resv,argc,(mxArray**)(argv)); break;
  case 1235: flag=_wrap_IndexAbstraction_stop_get(resc,resv,argc,(mxArray**)(argv)); break;
  case 1236: flag=_wrap_new_IndexAbstraction(resc,resv,argc,(mxArray**)(argv)); break;
  case 1237: flag=_wrap_delete_IndexAbstraction(resc,resv,argc,(mxArray**)(argv)); break;
  case 1238: flag=_wrap_MetaCon_original_get(resc,resv,argc,(mxArray**)(argv)); break;
  case 1239: flag=_wrap_MetaCon_canon_get(resc,resv,argc,(mxArray**)(argv)); break;
  case 1240: flag=_wrap_MetaCon_type_get(resc,resv,argc,(mxArray**)(argv)); break;
  case 1241: flag=_wrap_MetaCon_lb_get(resc,resv,argc,(mxArray**)(argv)); break;
  case 1242: flag=_wrap_MetaCon_ub_get(resc,resv,argc,(mxArray**)(argv)); break;
  case 1243: flag=_wrap_MetaCon_n_get(resc,resv,argc,(mxArray**)(argv)); break;
  case 1244: flag=_wrap_MetaCon_flipped_get(resc,resv,argc,(mxArray**)(argv)); break;
  case 1245: flag=_wrap_MetaCon_dual_canon_get(resc,resv,argc,(mxArray**)(argv)); break;
  case 1246: flag=_wrap_MetaCon_dual_get(resc,resv,argc,(mxArray**)(argv)); break;
  case 1247: flag=_wrap_MetaCon_extra_get(resc,resv,argc,(mxArray**)(argv)); break;
  case 1248: flag=_wrap_new_MetaCon(resc,resv,argc,(mxArray**)(argv)); break;
  case 1249: flag=_wrap_delete_MetaCon(resc,resv,argc,(mxArray**)(argv)); break;
  case 1250: flag=_wrap_MetaVar_attribute_get(resc,resv,argc,(mxArray**)(argv)); break;
  case 1251: flag=_wrap_MetaVar_n_get(resc,resv,argc,(mxArray**)(argv)); break;
  case 1252: flag=_wrap_MetaVar_m_get(resc,resv,argc,(mxArray**)(argv)); break;
  case 1253: flag=_wrap_MetaVar_type_get(resc,resv,argc,(mxArray**)(argv)); break;
  case 1254: flag=_wrap_MetaVar_count_get(resc,resv,argc,(mxArray**)(argv)); break;
  case 1255: flag=_wrap_MetaVar_i_get(resc,resv,argc,(mxArray**)(argv)); break;
  case 1256: flag=_wrap_MetaVar_active_i_get(resc,resv,argc,(mxArray**)(argv)); break;
  case 1257: flag=_wrap_MetaVar_extra_get(resc,resv,argc,(mxArray**)(argv)); break;
  case 1258: flag=_wrap_new_MetaVar(resc,resv,argc,(mxArray**)(argv)); break;
  case 1259: flag=_wrap_delete_MetaVar(resc,resv,argc,(mxArray**)(argv)); break;
  case 1260: flag=_wrap_new_OptiCallback(resc,resv,argc,(mxArray**)(argv)); break;
  case 1261: flag=_wrap_OptiCallback_call(resc,resv,argc,(mxArray**)(argv)); break;
  case 1262: flag=_wrap_delete_OptiCallback(resc,resv,argc,(mxArray**)(argv)); break;
  case 1263: flag=_wrap_delete_OptiAdvanced(resc,resv,argc,(mxArray**)(argv)); break;
  case 1264: flag=_wrap_OptiAdvanced_solver(resc,resv,argc,(mxArray**)(argv)); break;
  case 1265: flag=_wrap_OptiAdvanced_is_parametric(resc,resv,argc,(mxArray**)(argv)); break;
  case 1266: flag=_wrap_OptiAdvanced_symvar(resc,resv,argc,(mxArray**)(argv)); break;
  case 1267: flag=_wrap_OptiAdvanced_canon_expr(resc,resv,argc,(mxArray**)(argv)); break;
  case 1268: flag=_wrap_OptiAdvanced_get_meta(resc,resv,argc,(mxArray**)(argv)); break;
  case 1269: flag=_wrap_OptiAdvanced_get_meta_con(resc,resv,argc,(mxArray**)(argv)); break;
  case 1270: flag=_wrap_OptiAdvanced_set_meta(resc,resv,argc,(mxArray**)(argv)); break;
  case 1271: flag=_wrap_OptiAdvanced_set_meta_con(resc,resv,argc,(mxArray**)(argv)); break;
  case 1272: flag=_wrap_OptiAdvanced_assert_active_symbol(resc,resv,argc,(mxArray**)(argv)); break;
  case 1273: flag=_wrap_OptiAdvanced_active_symvar(resc,resv,argc,(mxArray**)(argv)); break;
  case 1274: flag=_wrap_OptiAdvanced_active_values(resc,resv,argc,(mxArray**)(argv)); break;
  case 1275: flag=_wrap_OptiAdvanced_x_lookup(resc,resv,argc,(mxArray**)(argv)); break;
  case 1276: flag=_wrap_OptiAdvanced_g_lookup(resc,resv,argc,(mxArray**)(argv)); break;
  case 1277: flag=_wrap_OptiAdvanced_x_describe(resc,resv,argc,(mxArray**)(argv)); break;
  case 1278: flag=_wrap_OptiAdvanced_g_describe(resc,resv,argc,(mxArray**)(argv)); break;
  case 1279: flag=_wrap_OptiAdvanced_describe(resc,resv,argc,(mxArray**)(argv)); break;
  case 1280: flag=_wrap_OptiAdvanced_show_infeasibilities(resc,resv,argc,(mxArray**)(argv)); break;
  case 1281: flag=_wrap_OptiAdvanced_solve_prepare(resc,resv,argc,(mxArray**)(argv)); break;
  case 1282: flag=_wrap_OptiAdvanced_solve_actual(resc,resv,argc,(mxArray**)(argv)); break;
  case 1283: flag=_wrap_OptiAdvanced_arg(resc,resv,argc,(mxArray**)(argv)); break;
  case 1284: flag=_wrap_OptiAdvanced_res(resc,resv,argc,(mxArray**)(argv)); break;
  case 1285: flag=_wrap_OptiAdvanced_constraints(resc,resv,argc,(mxArray**)(argv)); break;
  case 1286: flag=_wrap_OptiAdvanced_objective(resc,resv,argc,(mxArray**)(argv)); break;
  case 1287: flag=_wrap_OptiAdvanced_baked_copy(resc,resv,argc,(mxArray**)(argv)); break;
  case 1288: flag=_wrap_OptiAdvanced_assert_empty(resc,resv,argc,(mxArray**)(argv)); break;
  case 1289: flag=_wrap_OptiAdvanced_bake(resc,resv,argc,(mxArray**)(argv)); break;
  case 1290: flag=_wrap_OptiAdvanced_problem_dirty__get(resc,resv,argc,(mxArray**)(argv)); break;
  case 1291: flag=_wrap_OptiAdvanced_mark_problem_dirty(resc,resv,argc,(mxArray**)(argv)); break;
  case 1292: flag=_wrap_OptiAdvanced_problem_dirty(resc,resv,argc,(mxArray**)(argv)); break;
  case 1293: flag=_wrap_OptiAdvanced_solver_dirty__get(resc,resv,argc,(mxArray**)(argv)); break;
  case 1294: flag=_wrap_OptiAdvanced_mark_solver_dirty(resc,resv,argc,(mxArray**)(argv)); break;
  case 1295: flag=_wrap_OptiAdvanced_solver_dirty(resc,resv,argc,(mxArray**)(argv)); break;
  case 1296: flag=_wrap_OptiAdvanced_solved__get(resc,resv,argc,(mxArray**)(argv)); break;
  case 1297: flag=_wrap_OptiAdvanced_mark_solved(resc,resv,argc,(mxArray**)(argv)); break;
  case 1298: flag=_wrap_OptiAdvanced_solved(resc,resv,argc,(mxArray**)(argv)); break;
  case 1299: flag=_wrap_OptiAdvanced_assert_solved(resc,resv,argc,(mxArray**)(argv)); break;
  case 1300: flag=_wrap_OptiAdvanced_assert_baked(resc,resv,argc,(mxArray**)(argv)); break;
  case 1301: flag=_wrap_OptiAdvanced_instance_number(resc,resv,argc,(mxArray**)(argv)); break;
  case 1302: flag=_wrap_new_OptiAdvanced(resc,resv,argc,(mxArray**)(argv)); break;
  case 1303: flag=_wrap_OptiSol_type_name(resc,resv,argc,(mxArray**)(argv)); break;
  case 1304: flag=_wrap_OptiSol_disp(resc,resv,argc,(mxArray**)(argv)); break;
  case 1305: flag=_wrap_OptiSol_str(resc,resv,argc,(mxArray**)(argv)); break;
  case 1306: flag=_wrap_OptiSol_value(resc,resv,argc,(mxArray**)(argv)); break;
  case 1307: flag=_wrap_OptiSol_value_variables(resc,resv,argc,(mxArray**)(argv)); break;
  case 1308: flag=_wrap_OptiSol_value_parameters(resc,resv,argc,(mxArray**)(argv)); break;
  case 1309: flag=_wrap_OptiSol_stats(resc,resv,argc,(mxArray**)(argv)); break;
  case 1310: flag=_wrap_OptiSol_opti(resc,resv,argc,(mxArray**)(argv)); break;
  case 1311: flag=_wrap_new_OptiSol(resc,resv,argc,(mxArray**)(argv)); break;
  case 1312: flag=_wrap_delete_OptiSol(resc,resv,argc,(mxArray**)(argv)); break;
  default: flag=1, SWIG_Error(SWIG_RuntimeError, "No function id %d.", fcn_id);
  }
  if (flag) {
    SWIG_Matlab_ErrorId(SWIG_ErrorType(SWIG_lasterror_code), SWIG_lasterror_msg);
  }
}
