/* ----------------------------------------------------------------------------
 * 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.
 * ----------------------------------------------------------------------------- */

#define SWIGMATLAB
#define SWIG_name_d      "helics"
#define SWIG_name        helics

#define SWIG_op_prefix        "op_"
#define SWIG_pkg_name        "helics"
#define SwigVar_mxArray mxArray*


#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[65536];
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 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) {
    mexErrMsgIdAndTxt("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)) {
  mexErrMsgIdAndTxt("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)) {
    mexErrMsgIdAndTxt("SWIG:NewPointerObj","Cannot allocate pointer");
  }

  /* Create a SwigRef instance */
  mxArray* pm = 0;
  int ex = SWIG_Matlab_CallInterp(1, &pm, 0, 0, "SwigRef");
  if (ex) mexErrMsgIdAndTxt("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) mexErrMsgIdAndTxt("SWIG:NewPointerObj", "mxCreateNumericMatrix failed");

  mxArray *rhs[2] = {pm, pm_ptr};
  mexCallMATLAB(0, 0, 2, rhs, "SwigSet");
  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)) {
  mexErrMsgIdAndTxt("SWIG:NewPackedOb","Not implemented");
  return 0;
}

SWIGRUNTIME int SWIG_Matlab_isOwned(mxArray* pm) {
/* Get index, represented as a uint64_T scalar */
  mxArray *pm_ptr;
  mexCallMATLAB(1, &pm_ptr, 1, &pm, "SwigGet");
  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) {
/* Get index, represented as a uint64_T scalar */
  mxArray *pm_ptr;
  mexCallMATLAB(1, &pm_ptr, 1, &pm, "SwigGet");
  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) {
  /* Get index, represented as a uint64_T scalar */
  mxArray *pm_ptr;
  mexCallMATLAB(1, &pm_ptr, 1, &pm, "SwigGet");
  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 */
      mexErrMsgIdAndTxt("SWIG:ConvertPointerObj","SWIG error in converting pointer for type %s. Bad typemap?",type->name);
      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) mexErrMsgIdAndTxt("SWIG:GetModule", "Cannot call SwigMem");
    /* On first call, mem is an empty matrix */
    if (mxGetNumberOfElements(mem)!= 0) {
      if (!mxIsStruct(mem)) {
        mexErrMsgIdAndTxt("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) mexErrMsgIdAndTxt("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) mexErrMsgIdAndTxt("SWIG:SetModule","mxCreateStructMatrix failed");
    mxArray *module = mxCreateNumericMatrix(1, 1, mxUINT64_CLASS, mxREAL);
    if(!module) mexErrMsgIdAndTxt("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)) {
      mexErrMsgIdAndTxt("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) mexErrMsgIdAndTxt("SWIG:SetModule", "Error adding field to SwigMem");
    mxArray *module = mxCreateNumericMatrix(1, 1, mxUINT64_CLASS, mxREAL);
    if(!module) mexErrMsgIdAndTxt("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) {
    mexErrMsgIdAndTxt("SWIG:SetModule", "Could not set variable in SwigMem.\n");
  }
  saved_swig_module = pointer;
}

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

#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 



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

#define SWIGTYPE_p_char swig_types[0]
#define SWIGTYPE_p_double swig_types[1]
#define SWIGTYPE_p_helics_core_type swig_types[2]
#define SWIGTYPE_p_helics_data_type swig_types[3]
#define SWIGTYPE_p_helics_error swig_types[4]
#define SWIGTYPE_p_helics_error_types swig_types[5]
#define SWIGTYPE_p_helics_federate_flags swig_types[6]
#define SWIGTYPE_p_helics_federate_state swig_types[7]
#define SWIGTYPE_p_helics_filter_type swig_types[8]
#define SWIGTYPE_p_helics_handle_options swig_types[9]
#define SWIGTYPE_p_helics_iteration_request swig_types[10]
#define SWIGTYPE_p_helics_iteration_result swig_types[11]
#define SWIGTYPE_p_helics_log_levels swig_types[12]
#define SWIGTYPE_p_helics_message swig_types[13]
#define SWIGTYPE_p_helics_multi_input_mode swig_types[14]
#define SWIGTYPE_p_helics_properties swig_types[15]
#define SWIGTYPE_p_int swig_types[16]
#define SWIGTYPE_p_int16_t swig_types[17]
#define SWIGTYPE_p_int32_t swig_types[18]
#define SWIGTYPE_p_p_char swig_types[19]
#define SWIGTYPE_p_void swig_types[20]
static swig_type_info *swig_types[22];
static swig_module_info swig_module = {swig_types, 21, 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 "api-data.h"
/* throw a helics error */
static void throwHelicsMatlabError(helics_error *err) {
  switch (err->error_code)
  {
  case helics_ok:
    return;
  case helics_error_registration_failure:
    mexErrMsgIdAndTxt( "helics:registration_failure", err->message);
    break;
  case   helics_error_connection_failure:
  mexErrMsgIdAndTxt( "helics:connection_failure", err->message);
    break;
  case   helics_error_invalid_object:
  mexErrMsgIdAndTxt( "helics:invalid_object", err->message);
    break;
  case   helics_error_invalid_argument:
  mexErrMsgIdAndTxt( "helics:invalid_argument", err->message);
    break;
  case   helics_error_discard:
  mexErrMsgIdAndTxt( "helics:discard", err->message);
    break;
  case helics_error_system_failure:
    mexErrMsgIdAndTxt( "helics:system_failure", err->message);
    break;
  case   helics_error_invalid_state_transition:
  mexErrMsgIdAndTxt( "helics:invalid_state_transition", err->message);
    break;
  case   helics_error_invalid_function_call:
  mexErrMsgIdAndTxt( "helics:invalid_function_call", err->message);
    break;
  case   helics_error_execution_failure:
  mexErrMsgIdAndTxt( "helics:execution_failure", err->message);
    break;
  case   helics_error_insufficient_space:
    mexErrMsgIdAndTxt( "helics:insufficient_space", err->message);
    break;
  case   helics_error_other:
  case   helics_error_external_type:
  default:
  mexErrMsgIdAndTxt( "helics:error", err->message);
    break;
  }
}



#include "ValueFederate.h"
#include "MessageFederate.h"
#include "MessageFilters.h"


  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);
}


  SWIGINTERNINLINE mxArray* SWIG_From_double    (double value)
    {    
      return mxCreateDoubleScalar(value);
    }


  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;
    }


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 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) mexErrMsgIdAndTxt("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));
}


  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 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;
    }


#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_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_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;
}


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;
}


SWIGINTERNINLINE mxArray*
SWIG_From_char  (char c) 
{ 
  return SWIG_FromCharPtrAndSize(&c,1);
}

SWIGINTERN int _wrap_helics_time_zero_get(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  resv[0] = SWIG_From_double(static_cast< double >(helics_time_zero));
  return 0;
}


SWIGINTERN int _wrap_helics_time_epsilon_get(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  resv[0] = SWIG_From_double(static_cast< double >(helics_time_epsilon));
  return 0;
}


SWIGINTERN int _wrap_helics_time_invalid_get(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  resv[0] = SWIG_From_double(static_cast< double >(helics_time_invalid));
  return 0;
}


SWIGINTERN int _wrap_helics_time_maxtime_get(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  resv[0] = SWIG_From_double(static_cast< double >(helics_time_maxtime));
  return 0;
}


SWIGINTERN int _wrap_helics_true_get(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  resv[0] = SWIG_From_int(static_cast< int >(helics_true));
  return 0;
}


SWIGINTERN int _wrap_helics_false_get(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  resv[0] = SWIG_From_int(static_cast< int >(helics_false));
  return 0;
}


int _wrap_helics_message_time_set(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_message *arg1 = (helics_message *) 0 ;
  helics_time arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  double val2 ;
  int ecode2 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("helics_message_time_set",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_helics_message, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helics_message_time_set" "', argument " "1"" of type '" "helics_message *""'"); 
  }
  arg1 = reinterpret_cast< helics_message * >(argp1);
  ecode2 = SWIG_AsVal_double(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "helics_message_time_set" "', argument " "2"" of type '" "helics_time""'");
  } 
  arg2 = static_cast< helics_time >(val2);
  if (arg1) (arg1)->time = arg2;
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helics_message_time_get(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_message *arg1 = (helics_message *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  helics_time result;
  
  if (!SWIG_check_num_args("helics_message_time_get",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_helics_message, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helics_message_time_get" "', argument " "1"" of type '" "helics_message *""'"); 
  }
  arg1 = reinterpret_cast< helics_message * >(argp1);
  result = (helics_time) ((arg1)->time);
  _out = SWIG_From_double(static_cast< double >(result));
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helics_message_data_set(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_message *arg1 = (helics_message *) 0 ;
  char *arg2 = (char *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("helics_message_data_set",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_helics_message, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helics_message_data_set" "', argument " "1"" of type '" "helics_message *""'"); 
  }
  arg1 = reinterpret_cast< helics_message * >(argp1);
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helics_message_data_set" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  if (arg2) {
    size_t size = strlen(reinterpret_cast< const char * >(reinterpret_cast< const char * >(arg2))) + 1;
    arg1->data = (char const *)reinterpret_cast< char* >(memcpy((new char[size]), arg2, sizeof(char)*(size)));
  } else {
    arg1->data = 0;
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  return 1;
}


int _wrap_helics_message_data_get(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_message *arg1 = (helics_message *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  char *result = 0 ;
  
  if (!SWIG_check_num_args("helics_message_data_get",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_helics_message, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helics_message_data_get" "', argument " "1"" of type '" "helics_message *""'"); 
  }
  arg1 = reinterpret_cast< helics_message * >(argp1);
  result = (char *) ((arg1)->data);
  _out = SWIG_FromCharPtr((const char *)result);
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helics_message_length_set(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_message *arg1 = (helics_message *) 0 ;
  int64_t arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  long long val2 ;
  int ecode2 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("helics_message_length_set",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_helics_message, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helics_message_length_set" "', argument " "1"" of type '" "helics_message *""'"); 
  }
  arg1 = reinterpret_cast< helics_message * >(argp1);
  ecode2 = SWIG_AsVal_long_SS_long(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "helics_message_length_set" "', argument " "2"" of type '" "int64_t""'");
  } 
  arg2 = static_cast< int64_t >(val2);
  if (arg1) (arg1)->length = arg2;
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helics_message_length_get(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_message *arg1 = (helics_message *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  int64_t result;
  
  if (!SWIG_check_num_args("helics_message_length_get",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_helics_message, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helics_message_length_get" "', argument " "1"" of type '" "helics_message *""'"); 
  }
  arg1 = reinterpret_cast< helics_message * >(argp1);
  result =  ((arg1)->length);
  _out = SWIG_From_long_SS_long(static_cast< long long >(result));
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helics_message_messageID_set(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_message *arg1 = (helics_message *) 0 ;
  int32_t arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("helics_message_messageID_set",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_helics_message, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helics_message_messageID_set" "', argument " "1"" of type '" "helics_message *""'"); 
  }
  arg1 = reinterpret_cast< helics_message * >(argp1);
  {
    res2 = SWIG_ConvertPtr(argv[1], &argp2, SWIGTYPE_p_int32_t,  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helics_message_messageID_set" "', argument " "2"" of type '" "int32_t""'"); 
    }  
    if (!argp2) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "helics_message_messageID_set" "', argument " "2"" of type '" "int32_t""'");
    } else {
      arg2 = *(reinterpret_cast< int32_t * >(argp2));
    }
  }
  if (arg1) (arg1)->messageID = arg2;
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helics_message_messageID_get(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_message *arg1 = (helics_message *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  int32_t result;
  
  if (!SWIG_check_num_args("helics_message_messageID_get",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_helics_message, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helics_message_messageID_get" "', argument " "1"" of type '" "helics_message *""'"); 
  }
  arg1 = reinterpret_cast< helics_message * >(argp1);
  result =  ((arg1)->messageID);
  _out = SWIG_NewPointerObj((new int32_t(static_cast< const int32_t& >(result))), SWIGTYPE_p_int32_t, SWIG_POINTER_OWN |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helics_message_flags_set(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_message *arg1 = (helics_message *) 0 ;
  int16_t arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("helics_message_flags_set",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_helics_message, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helics_message_flags_set" "', argument " "1"" of type '" "helics_message *""'"); 
  }
  arg1 = reinterpret_cast< helics_message * >(argp1);
  {
    res2 = SWIG_ConvertPtr(argv[1], &argp2, SWIGTYPE_p_int16_t,  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helics_message_flags_set" "', argument " "2"" of type '" "int16_t""'"); 
    }  
    if (!argp2) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "helics_message_flags_set" "', argument " "2"" of type '" "int16_t""'");
    } else {
      arg2 = *(reinterpret_cast< int16_t * >(argp2));
    }
  }
  if (arg1) (arg1)->flags = arg2;
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helics_message_flags_get(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_message *arg1 = (helics_message *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  int16_t result;
  
  if (!SWIG_check_num_args("helics_message_flags_get",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_helics_message, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helics_message_flags_get" "', argument " "1"" of type '" "helics_message *""'"); 
  }
  arg1 = reinterpret_cast< helics_message * >(argp1);
  result =  ((arg1)->flags);
  _out = SWIG_NewPointerObj((new int16_t(static_cast< const int16_t& >(result))), SWIGTYPE_p_int16_t, SWIG_POINTER_OWN |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helics_message_original_source_set(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_message *arg1 = (helics_message *) 0 ;
  char *arg2 = (char *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("helics_message_original_source_set",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_helics_message, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helics_message_original_source_set" "', argument " "1"" of type '" "helics_message *""'"); 
  }
  arg1 = reinterpret_cast< helics_message * >(argp1);
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helics_message_original_source_set" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  if (arg2) {
    size_t size = strlen(reinterpret_cast< const char * >(reinterpret_cast< const char * >(arg2))) + 1;
    arg1->original_source = (char const *)reinterpret_cast< char* >(memcpy((new char[size]), arg2, sizeof(char)*(size)));
  } else {
    arg1->original_source = 0;
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  return 1;
}


int _wrap_helics_message_original_source_get(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_message *arg1 = (helics_message *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  char *result = 0 ;
  
  if (!SWIG_check_num_args("helics_message_original_source_get",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_helics_message, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helics_message_original_source_get" "', argument " "1"" of type '" "helics_message *""'"); 
  }
  arg1 = reinterpret_cast< helics_message * >(argp1);
  result = (char *) ((arg1)->original_source);
  _out = SWIG_FromCharPtr((const char *)result);
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helics_message_source_set(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_message *arg1 = (helics_message *) 0 ;
  char *arg2 = (char *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("helics_message_source_set",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_helics_message, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helics_message_source_set" "', argument " "1"" of type '" "helics_message *""'"); 
  }
  arg1 = reinterpret_cast< helics_message * >(argp1);
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helics_message_source_set" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  if (arg2) {
    size_t size = strlen(reinterpret_cast< const char * >(reinterpret_cast< const char * >(arg2))) + 1;
    arg1->source = (char const *)reinterpret_cast< char* >(memcpy((new char[size]), arg2, sizeof(char)*(size)));
  } else {
    arg1->source = 0;
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  return 1;
}


int _wrap_helics_message_source_get(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_message *arg1 = (helics_message *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  char *result = 0 ;
  
  if (!SWIG_check_num_args("helics_message_source_get",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_helics_message, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helics_message_source_get" "', argument " "1"" of type '" "helics_message *""'"); 
  }
  arg1 = reinterpret_cast< helics_message * >(argp1);
  result = (char *) ((arg1)->source);
  _out = SWIG_FromCharPtr((const char *)result);
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helics_message_dest_set(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_message *arg1 = (helics_message *) 0 ;
  char *arg2 = (char *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("helics_message_dest_set",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_helics_message, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helics_message_dest_set" "', argument " "1"" of type '" "helics_message *""'"); 
  }
  arg1 = reinterpret_cast< helics_message * >(argp1);
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helics_message_dest_set" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  if (arg2) {
    size_t size = strlen(reinterpret_cast< const char * >(reinterpret_cast< const char * >(arg2))) + 1;
    arg1->dest = (char const *)reinterpret_cast< char* >(memcpy((new char[size]), arg2, sizeof(char)*(size)));
  } else {
    arg1->dest = 0;
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  return 1;
}


int _wrap_helics_message_dest_get(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_message *arg1 = (helics_message *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  char *result = 0 ;
  
  if (!SWIG_check_num_args("helics_message_dest_get",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_helics_message, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helics_message_dest_get" "', argument " "1"" of type '" "helics_message *""'"); 
  }
  arg1 = reinterpret_cast< helics_message * >(argp1);
  result = (char *) ((arg1)->dest);
  _out = SWIG_FromCharPtr((const char *)result);
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helics_message_original_dest_set(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_message *arg1 = (helics_message *) 0 ;
  char *arg2 = (char *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("helics_message_original_dest_set",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_helics_message, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helics_message_original_dest_set" "', argument " "1"" of type '" "helics_message *""'"); 
  }
  arg1 = reinterpret_cast< helics_message * >(argp1);
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helics_message_original_dest_set" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  if (arg2) {
    size_t size = strlen(reinterpret_cast< const char * >(reinterpret_cast< const char * >(arg2))) + 1;
    arg1->original_dest = (char const *)reinterpret_cast< char* >(memcpy((new char[size]), arg2, sizeof(char)*(size)));
  } else {
    arg1->original_dest = 0;
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  return 1;
}


int _wrap_helics_message_original_dest_get(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_message *arg1 = (helics_message *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  char *result = 0 ;
  
  if (!SWIG_check_num_args("helics_message_original_dest_get",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_helics_message, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helics_message_original_dest_get" "', argument " "1"" of type '" "helics_message *""'"); 
  }
  arg1 = reinterpret_cast< helics_message * >(argp1);
  result = (char *) ((arg1)->original_dest);
  _out = SWIG_FromCharPtr((const char *)result);
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_new_helics_message(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  helics_message *result = 0 ;
  
  if (!SWIG_check_num_args("new_helics_message",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  result = (helics_message *)new helics_message();
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_helics_message, 1 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_delete_helics_message(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_message *arg1 = (helics_message *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  mxArray * _out;
  
  int is_owned;
  if (!SWIG_check_num_args("delete_helics_message",argc,1,1,0)) {
    SWIG_fail;
  }
  is_owned = SWIG_Matlab_isOwned(argv[0]);
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_helics_message, SWIG_POINTER_DISOWN |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_helics_message" "', argument " "1"" of type '" "helics_message *""'"); 
  }
  arg1 = reinterpret_cast< helics_message * >(argp1);
  if (is_owned) {
    delete arg1;
  }
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsGetVersion(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  char *result = 0 ;
  
  if (!SWIG_check_num_args("helicsGetVersion",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  result = (char *)helicsGetVersion();
  _out = SWIG_FromCharPtr((const char *)result);
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsGetBuildFlags(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  char *result = 0 ;
  
  if (!SWIG_check_num_args("helicsGetBuildFlags",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  result = (char *)helicsGetBuildFlags();
  _out = SWIG_FromCharPtr((const char *)result);
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsGetCompilerVersion(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  char *result = 0 ;
  
  if (!SWIG_check_num_args("helicsGetCompilerVersion",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  result = (char *)helicsGetCompilerVersion();
  _out = SWIG_FromCharPtr((const char *)result);
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsIsCoreTypeAvailable(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  char *arg1 = (char *) 0 ;
  int res1 ;
  char *buf1 = 0 ;
  int alloc1 = 0 ;
  mxArray * _out;
  helics_bool result;
  
  if (!SWIG_check_num_args("helicsIsCoreTypeAvailable",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsIsCoreTypeAvailable" "', argument " "1"" of type '" "char const *""'");
  }
  arg1 = reinterpret_cast< char * >(buf1);
  result = (helics_bool)helicsIsCoreTypeAvailable((char const *)arg1);
  _out = SWIG_From_int(static_cast< int >(result));
  if (_out) --resc, *resv++ = _out;
  if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
  return 0;
fail:
  if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
  return 1;
}


int _wrap_helicsCreateCore(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  char *arg1 = (char *) 0 ;
  char *arg2 = (char *) 0 ;
  char *arg3 = (char *) 0 ;
  helics_error *arg4 = (helics_error *) 0 ;
  int res1 ;
  char *buf1 = 0 ;
  int alloc1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  int res3 ;
  char *buf3 = 0 ;
  int alloc3 = 0 ;
  helics_error etemp4 ;
  mxArray * _out;
  helics_core result;
  
  {
    etemp4=helicsErrorInitialize();
    arg4=&etemp4;
  }
  if (!SWIG_check_num_args("helicsCreateCore",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsCreateCore" "', argument " "1"" of type '" "char const *""'");
  }
  arg1 = reinterpret_cast< char * >(buf1);
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsCreateCore" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "helicsCreateCore" "', argument " "3"" of type '" "char const *""'");
  }
  arg3 = reinterpret_cast< char * >(buf3);
  result = (helics_core)helicsCreateCore((char const *)arg1,(char const *)arg2,(char const *)arg3,arg4);
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
  if (_out) --resc, *resv++ = _out;
  if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 0;
fail:
  if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 1;
}


int _wrap_helicsCreateCoreFromArgs(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  char *arg1 = (char *) 0 ;
  char *arg2 = (char *) 0 ;
  int arg3 ;
  char **arg4 = (char **) 0 ;
  helics_error *arg5 = (helics_error *) 0 ;
  int res1 ;
  char *buf1 = 0 ;
  int alloc1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  helics_error etemp5 ;
  mxArray * _out;
  helics_core result;
  
  {
    etemp5=helicsErrorInitialize();
    arg5=&etemp5;
  }
  if (!SWIG_check_num_args("helicsCreateCoreFromArgs",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsCreateCoreFromArgs" "', argument " "1"" of type '" "char const *""'");
  }
  arg1 = reinterpret_cast< char * >(buf1);
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsCreateCoreFromArgs" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  {
    /* Check if is a list */
    if (mxIsCell(argv[2])) {
      int ii;
      int allocation2=0;
      char *buffer_cell=NULL;
      int cellSize=static_cast<int>(mxGetNumberOfElements(argv[2]));
      arg4 = (char **) malloc((cellSize+1)*sizeof(char *));
      for (ii=0;ii<cellSize;++ii)
      {
        mxArray *cellElement=mxGetCell(argv[2], ii);
        int resCode = SWIG_AsCharPtrAndSize(cellElement, &buffer_cell, NULL, &allocation2);
        if (!SWIG_IsOK(resCode)) {
          SWIG_exception_fail(SWIG_ArgError(resCode), "cell elements must be a string");
        }
        arg4[ii+1]=buffer_cell;
      }
      
    }
    else if (mxIsChar(argv[2]))
    {
      int retval=0;
      char *buffer=NULL;
      int allocation=0;
      arg3=2;
      arg4 = (char **) malloc(2*sizeof(char *));
      retval = SWIG_AsCharPtrAndSize(argv[2], &buffer, NULL, &allocation);
      if (!SWIG_IsOK(retval)) {
        SWIG_exception_fail(SWIG_ArgError(retval), "conversion to string failed");
      }
      arg4[0]=buffer;
      arg4[1]=buffer;
    }
    else
    {
      SWIG_exception_fail(SWIG_ArgError(3), "argument must be a cell array or string");
      return NULL;
    }
  }
  result = (helics_core)helicsCreateCoreFromArgs((char const *)arg1,(char const *)arg2,arg3,(char const *const *)arg4,arg5);
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
  if (_out) --resc, *resv++ = _out;
  if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    free((char **) arg4);
  }
  {
    if (arg5->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg5);
    }
  }
  return 0;
fail:
  if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    free((char **) arg4);
  }
  {
    if (arg5->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg5);
    }
  }
  return 1;
}


int _wrap_helicsCoreClone(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_core arg1 = (helics_core) 0 ;
  helics_error *arg2 = (helics_error *) 0 ;
  int res1 ;
  helics_error etemp2 ;
  mxArray * _out;
  helics_core result;
  
  {
    etemp2=helicsErrorInitialize();
    arg2=&etemp2;
  }
  if (!SWIG_check_num_args("helicsCoreClone",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsCoreClone" "', argument " "1"" of type '" "helics_core""'"); 
  }
  result = (helics_core)helicsCoreClone(arg1,arg2);
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
  if (_out) --resc, *resv++ = _out;
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 0;
fail:
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 1;
}


int _wrap_helicsCoreIsValid(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_core arg1 = (helics_core) 0 ;
  int res1 ;
  mxArray * _out;
  helics_bool result;
  
  if (!SWIG_check_num_args("helicsCoreIsValid",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsCoreIsValid" "', argument " "1"" of type '" "helics_core""'"); 
  }
  result = (helics_bool)helicsCoreIsValid(arg1);
  _out = SWIG_From_int(static_cast< int >(result));
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsCreateBroker(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  char *arg1 = (char *) 0 ;
  char *arg2 = (char *) 0 ;
  char *arg3 = (char *) 0 ;
  helics_error *arg4 = (helics_error *) 0 ;
  int res1 ;
  char *buf1 = 0 ;
  int alloc1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  int res3 ;
  char *buf3 = 0 ;
  int alloc3 = 0 ;
  helics_error etemp4 ;
  mxArray * _out;
  helics_broker result;
  
  {
    etemp4=helicsErrorInitialize();
    arg4=&etemp4;
  }
  if (!SWIG_check_num_args("helicsCreateBroker",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsCreateBroker" "', argument " "1"" of type '" "char const *""'");
  }
  arg1 = reinterpret_cast< char * >(buf1);
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsCreateBroker" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "helicsCreateBroker" "', argument " "3"" of type '" "char const *""'");
  }
  arg3 = reinterpret_cast< char * >(buf3);
  result = (helics_broker)helicsCreateBroker((char const *)arg1,(char const *)arg2,(char const *)arg3,arg4);
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
  if (_out) --resc, *resv++ = _out;
  if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 0;
fail:
  if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 1;
}


int _wrap_helicsCreateBrokerFromArgs(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  char *arg1 = (char *) 0 ;
  char *arg2 = (char *) 0 ;
  int arg3 ;
  char **arg4 = (char **) 0 ;
  helics_error *arg5 = (helics_error *) 0 ;
  int res1 ;
  char *buf1 = 0 ;
  int alloc1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  helics_error etemp5 ;
  mxArray * _out;
  helics_broker result;
  
  {
    etemp5=helicsErrorInitialize();
    arg5=&etemp5;
  }
  if (!SWIG_check_num_args("helicsCreateBrokerFromArgs",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsCreateBrokerFromArgs" "', argument " "1"" of type '" "char const *""'");
  }
  arg1 = reinterpret_cast< char * >(buf1);
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsCreateBrokerFromArgs" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  {
    /* Check if is a list */
    if (mxIsCell(argv[2])) {
      int ii;
      int allocation2=0;
      char *buffer_cell=NULL;
      int cellSize=static_cast<int>(mxGetNumberOfElements(argv[2]));
      arg4 = (char **) malloc((cellSize+1)*sizeof(char *));
      for (ii=0;ii<cellSize;++ii)
      {
        mxArray *cellElement=mxGetCell(argv[2], ii);
        int resCode = SWIG_AsCharPtrAndSize(cellElement, &buffer_cell, NULL, &allocation2);
        if (!SWIG_IsOK(resCode)) {
          SWIG_exception_fail(SWIG_ArgError(resCode), "cell elements must be a string");
        }
        arg4[ii+1]=buffer_cell;
      }
      
    }
    else if (mxIsChar(argv[2]))
    {
      int retval=0;
      char *buffer=NULL;
      int allocation=0;
      arg3=2;
      arg4 = (char **) malloc(2*sizeof(char *));
      retval = SWIG_AsCharPtrAndSize(argv[2], &buffer, NULL, &allocation);
      if (!SWIG_IsOK(retval)) {
        SWIG_exception_fail(SWIG_ArgError(retval), "conversion to string failed");
      }
      arg4[0]=buffer;
      arg4[1]=buffer;
    }
    else
    {
      SWIG_exception_fail(SWIG_ArgError(3), "argument must be a cell array or string");
      return NULL;
    }
  }
  result = (helics_broker)helicsCreateBrokerFromArgs((char const *)arg1,(char const *)arg2,arg3,(char const *const *)arg4,arg5);
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
  if (_out) --resc, *resv++ = _out;
  if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    free((char **) arg4);
  }
  {
    if (arg5->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg5);
    }
  }
  return 0;
fail:
  if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    free((char **) arg4);
  }
  {
    if (arg5->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg5);
    }
  }
  return 1;
}


int _wrap_helicsBrokerClone(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_broker arg1 = (helics_broker) 0 ;
  helics_error *arg2 = (helics_error *) 0 ;
  int res1 ;
  helics_error etemp2 ;
  mxArray * _out;
  helics_broker result;
  
  {
    etemp2=helicsErrorInitialize();
    arg2=&etemp2;
  }
  if (!SWIG_check_num_args("helicsBrokerClone",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsBrokerClone" "', argument " "1"" of type '" "helics_broker""'"); 
  }
  result = (helics_broker)helicsBrokerClone(arg1,arg2);
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
  if (_out) --resc, *resv++ = _out;
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 0;
fail:
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 1;
}


int _wrap_helicsBrokerIsValid(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_broker arg1 = (helics_broker) 0 ;
  int res1 ;
  mxArray * _out;
  helics_bool result;
  
  if (!SWIG_check_num_args("helicsBrokerIsValid",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsBrokerIsValid" "', argument " "1"" of type '" "helics_broker""'"); 
  }
  result = (helics_bool)helicsBrokerIsValid(arg1);
  _out = SWIG_From_int(static_cast< int >(result));
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsBrokerIsConnected(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_broker arg1 = (helics_broker) 0 ;
  int res1 ;
  mxArray * _out;
  helics_bool result;
  
  if (!SWIG_check_num_args("helicsBrokerIsConnected",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsBrokerIsConnected" "', argument " "1"" of type '" "helics_broker""'"); 
  }
  result = (helics_bool)helicsBrokerIsConnected(arg1);
  _out = SWIG_From_int(static_cast< int >(result));
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsBrokerDataLink(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_broker arg1 = (helics_broker) 0 ;
  char *arg2 = (char *) 0 ;
  char *arg3 = (char *) 0 ;
  helics_error *arg4 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  int res3 ;
  char *buf3 = 0 ;
  int alloc3 = 0 ;
  helics_error etemp4 ;
  mxArray * _out;
  
  {
    etemp4=helicsErrorInitialize();
    arg4=&etemp4;
  }
  if (!SWIG_check_num_args("helicsBrokerDataLink",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsBrokerDataLink" "', argument " "1"" of type '" "helics_broker""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsBrokerDataLink" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "helicsBrokerDataLink" "', argument " "3"" of type '" "char const *""'");
  }
  arg3 = reinterpret_cast< char * >(buf3);
  helicsBrokerDataLink(arg1,(char const *)arg2,(char const *)arg3,arg4);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 1;
}


int _wrap_helicsBrokerAddSourceFilterToEndpoint(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_broker arg1 = (helics_broker) 0 ;
  char *arg2 = (char *) 0 ;
  char *arg3 = (char *) 0 ;
  helics_error *arg4 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  int res3 ;
  char *buf3 = 0 ;
  int alloc3 = 0 ;
  helics_error etemp4 ;
  mxArray * _out;
  
  {
    etemp4=helicsErrorInitialize();
    arg4=&etemp4;
  }
  if (!SWIG_check_num_args("helicsBrokerAddSourceFilterToEndpoint",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsBrokerAddSourceFilterToEndpoint" "', argument " "1"" of type '" "helics_broker""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsBrokerAddSourceFilterToEndpoint" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "helicsBrokerAddSourceFilterToEndpoint" "', argument " "3"" of type '" "char const *""'");
  }
  arg3 = reinterpret_cast< char * >(buf3);
  helicsBrokerAddSourceFilterToEndpoint(arg1,(char const *)arg2,(char const *)arg3,arg4);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 1;
}


int _wrap_helicsBrokerAddDestinationFilterToEndpoint(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_broker arg1 = (helics_broker) 0 ;
  char *arg2 = (char *) 0 ;
  char *arg3 = (char *) 0 ;
  helics_error *arg4 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  int res3 ;
  char *buf3 = 0 ;
  int alloc3 = 0 ;
  helics_error etemp4 ;
  mxArray * _out;
  
  {
    etemp4=helicsErrorInitialize();
    arg4=&etemp4;
  }
  if (!SWIG_check_num_args("helicsBrokerAddDestinationFilterToEndpoint",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsBrokerAddDestinationFilterToEndpoint" "', argument " "1"" of type '" "helics_broker""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsBrokerAddDestinationFilterToEndpoint" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "helicsBrokerAddDestinationFilterToEndpoint" "', argument " "3"" of type '" "char const *""'");
  }
  arg3 = reinterpret_cast< char * >(buf3);
  helicsBrokerAddDestinationFilterToEndpoint(arg1,(char const *)arg2,(char const *)arg3,arg4);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 1;
}


int _wrap_helicsBrokerMakeConnections(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_broker arg1 = (helics_broker) 0 ;
  char *arg2 = (char *) 0 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsBrokerMakeConnections",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsBrokerMakeConnections" "', argument " "1"" of type '" "helics_broker""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsBrokerMakeConnections" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  helicsBrokerMakeConnections(arg1,(char const *)arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsCoreWaitForDisconnect(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_core arg1 = (helics_core) 0 ;
  int arg2 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int val2 ;
  int ecode2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  helics_bool result;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsCoreWaitForDisconnect",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsCoreWaitForDisconnect" "', argument " "1"" of type '" "helics_core""'"); 
  }
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "helicsCoreWaitForDisconnect" "', argument " "2"" of type '" "int""'");
  } 
  arg2 = static_cast< int >(val2);
  result = (helics_bool)helicsCoreWaitForDisconnect(arg1,arg2,arg3);
  _out = SWIG_From_int(static_cast< int >(result));
  if (_out) --resc, *resv++ = _out;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsBrokerWaitForDisconnect(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_broker arg1 = (helics_broker) 0 ;
  int arg2 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int val2 ;
  int ecode2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  helics_bool result;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsBrokerWaitForDisconnect",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsBrokerWaitForDisconnect" "', argument " "1"" of type '" "helics_broker""'"); 
  }
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "helicsBrokerWaitForDisconnect" "', argument " "2"" of type '" "int""'");
  } 
  arg2 = static_cast< int >(val2);
  result = (helics_bool)helicsBrokerWaitForDisconnect(arg1,arg2,arg3);
  _out = SWIG_From_int(static_cast< int >(result));
  if (_out) --resc, *resv++ = _out;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsCoreIsConnected(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_core arg1 = (helics_core) 0 ;
  int res1 ;
  mxArray * _out;
  helics_bool result;
  
  if (!SWIG_check_num_args("helicsCoreIsConnected",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsCoreIsConnected" "', argument " "1"" of type '" "helics_core""'"); 
  }
  result = (helics_bool)helicsCoreIsConnected(arg1);
  _out = SWIG_From_int(static_cast< int >(result));
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsCoreDataLink(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_core arg1 = (helics_core) 0 ;
  char *arg2 = (char *) 0 ;
  char *arg3 = (char *) 0 ;
  helics_error *arg4 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  int res3 ;
  char *buf3 = 0 ;
  int alloc3 = 0 ;
  helics_error etemp4 ;
  mxArray * _out;
  
  {
    etemp4=helicsErrorInitialize();
    arg4=&etemp4;
  }
  if (!SWIG_check_num_args("helicsCoreDataLink",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsCoreDataLink" "', argument " "1"" of type '" "helics_core""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsCoreDataLink" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "helicsCoreDataLink" "', argument " "3"" of type '" "char const *""'");
  }
  arg3 = reinterpret_cast< char * >(buf3);
  helicsCoreDataLink(arg1,(char const *)arg2,(char const *)arg3,arg4);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 1;
}


int _wrap_helicsCoreAddSourceFilterToEndpoint(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_core arg1 = (helics_core) 0 ;
  char *arg2 = (char *) 0 ;
  char *arg3 = (char *) 0 ;
  helics_error *arg4 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  int res3 ;
  char *buf3 = 0 ;
  int alloc3 = 0 ;
  helics_error etemp4 ;
  mxArray * _out;
  
  {
    etemp4=helicsErrorInitialize();
    arg4=&etemp4;
  }
  if (!SWIG_check_num_args("helicsCoreAddSourceFilterToEndpoint",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsCoreAddSourceFilterToEndpoint" "', argument " "1"" of type '" "helics_core""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsCoreAddSourceFilterToEndpoint" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "helicsCoreAddSourceFilterToEndpoint" "', argument " "3"" of type '" "char const *""'");
  }
  arg3 = reinterpret_cast< char * >(buf3);
  helicsCoreAddSourceFilterToEndpoint(arg1,(char const *)arg2,(char const *)arg3,arg4);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 1;
}


int _wrap_helicsCoreAddDestinationFilterToEndpoint(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_core arg1 = (helics_core) 0 ;
  char *arg2 = (char *) 0 ;
  char *arg3 = (char *) 0 ;
  helics_error *arg4 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  int res3 ;
  char *buf3 = 0 ;
  int alloc3 = 0 ;
  helics_error etemp4 ;
  mxArray * _out;
  
  {
    etemp4=helicsErrorInitialize();
    arg4=&etemp4;
  }
  if (!SWIG_check_num_args("helicsCoreAddDestinationFilterToEndpoint",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsCoreAddDestinationFilterToEndpoint" "', argument " "1"" of type '" "helics_core""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsCoreAddDestinationFilterToEndpoint" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "helicsCoreAddDestinationFilterToEndpoint" "', argument " "3"" of type '" "char const *""'");
  }
  arg3 = reinterpret_cast< char * >(buf3);
  helicsCoreAddDestinationFilterToEndpoint(arg1,(char const *)arg2,(char const *)arg3,arg4);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 1;
}


int _wrap_helicsCoreMakeConnections(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_core arg1 = (helics_core) 0 ;
  char *arg2 = (char *) 0 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsCoreMakeConnections",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsCoreMakeConnections" "', argument " "1"" of type '" "helics_core""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsCoreMakeConnections" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  helicsCoreMakeConnections(arg1,(char const *)arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsBrokerGetIdentifier(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_broker arg1 = (helics_broker) 0 ;
  int res1 ;
  mxArray * _out;
  char *result = 0 ;
  
  if (!SWIG_check_num_args("helicsBrokerGetIdentifier",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsBrokerGetIdentifier" "', argument " "1"" of type '" "helics_broker""'"); 
  }
  result = (char *)helicsBrokerGetIdentifier(arg1);
  _out = SWIG_FromCharPtr((const char *)result);
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsCoreGetIdentifier(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_core arg1 = (helics_core) 0 ;
  int res1 ;
  mxArray * _out;
  char *result = 0 ;
  
  if (!SWIG_check_num_args("helicsCoreGetIdentifier",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsCoreGetIdentifier" "', argument " "1"" of type '" "helics_core""'"); 
  }
  result = (char *)helicsCoreGetIdentifier(arg1);
  _out = SWIG_FromCharPtr((const char *)result);
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsBrokerGetAddress(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_broker arg1 = (helics_broker) 0 ;
  int res1 ;
  mxArray * _out;
  char *result = 0 ;
  
  if (!SWIG_check_num_args("helicsBrokerGetAddress",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsBrokerGetAddress" "', argument " "1"" of type '" "helics_broker""'"); 
  }
  result = (char *)helicsBrokerGetAddress(arg1);
  _out = SWIG_FromCharPtr((const char *)result);
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsCoreGetAddress(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_core arg1 = (helics_core) 0 ;
  int res1 ;
  mxArray * _out;
  char *result = 0 ;
  
  if (!SWIG_check_num_args("helicsCoreGetAddress",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsCoreGetAddress" "', argument " "1"" of type '" "helics_core""'"); 
  }
  result = (char *)helicsCoreGetAddress(arg1);
  _out = SWIG_FromCharPtr((const char *)result);
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsCoreSetReadyToInit(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_core arg1 = (helics_core) 0 ;
  helics_error *arg2 = (helics_error *) 0 ;
  int res1 ;
  helics_error etemp2 ;
  mxArray * _out;
  
  {
    etemp2=helicsErrorInitialize();
    arg2=&etemp2;
  }
  if (!SWIG_check_num_args("helicsCoreSetReadyToInit",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsCoreSetReadyToInit" "', argument " "1"" of type '" "helics_core""'"); 
  }
  helicsCoreSetReadyToInit(arg1,arg2);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 0;
fail:
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 1;
}


int _wrap_helicsCoreConnect(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_core arg1 = (helics_core) 0 ;
  helics_error *arg2 = (helics_error *) 0 ;
  int res1 ;
  helics_error etemp2 ;
  mxArray * _out;
  helics_bool result;
  
  {
    etemp2=helicsErrorInitialize();
    arg2=&etemp2;
  }
  if (!SWIG_check_num_args("helicsCoreConnect",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsCoreConnect" "', argument " "1"" of type '" "helics_core""'"); 
  }
  result = (helics_bool)helicsCoreConnect(arg1,arg2);
  _out = SWIG_From_int(static_cast< int >(result));
  if (_out) --resc, *resv++ = _out;
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 0;
fail:
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 1;
}


int _wrap_helicsCoreDisconnect(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_core arg1 = (helics_core) 0 ;
  helics_error *arg2 = (helics_error *) 0 ;
  int res1 ;
  helics_error etemp2 ;
  mxArray * _out;
  
  {
    etemp2=helicsErrorInitialize();
    arg2=&etemp2;
  }
  if (!SWIG_check_num_args("helicsCoreDisconnect",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsCoreDisconnect" "', argument " "1"" of type '" "helics_core""'"); 
  }
  helicsCoreDisconnect(arg1,arg2);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 0;
fail:
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 1;
}


int _wrap_helicsGetFederateByName(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  char *arg1 = (char *) 0 ;
  helics_error *arg2 = (helics_error *) 0 ;
  int res1 ;
  char *buf1 = 0 ;
  int alloc1 = 0 ;
  helics_error etemp2 ;
  mxArray * _out;
  helics_federate result;
  
  {
    etemp2=helicsErrorInitialize();
    arg2=&etemp2;
  }
  if (!SWIG_check_num_args("helicsGetFederateByName",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsGetFederateByName" "', argument " "1"" of type '" "char const *""'");
  }
  arg1 = reinterpret_cast< char * >(buf1);
  result = (helics_federate)helicsGetFederateByName((char const *)arg1,arg2);
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
  if (_out) --resc, *resv++ = _out;
  if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 0;
fail:
  if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 1;
}


int _wrap_helicsBrokerDisconnect(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_broker arg1 = (helics_broker) 0 ;
  helics_error *arg2 = (helics_error *) 0 ;
  int res1 ;
  helics_error etemp2 ;
  mxArray * _out;
  
  {
    etemp2=helicsErrorInitialize();
    arg2=&etemp2;
  }
  if (!SWIG_check_num_args("helicsBrokerDisconnect",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsBrokerDisconnect" "', argument " "1"" of type '" "helics_broker""'"); 
  }
  helicsBrokerDisconnect(arg1,arg2);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 0;
fail:
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 1;
}


int _wrap_helicsFederateDestroy(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  int res1 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("helicsFederateDestroy",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateDestroy" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  helicsFederateDestroy(arg1);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsBrokerDestroy(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_broker arg1 = (helics_broker) 0 ;
  int res1 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("helicsBrokerDestroy",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsBrokerDestroy" "', argument " "1"" of type '" "helics_broker""'"); 
  }
  helicsBrokerDestroy(arg1);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsCoreDestroy(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_core arg1 = (helics_core) 0 ;
  int res1 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("helicsCoreDestroy",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsCoreDestroy" "', argument " "1"" of type '" "helics_core""'"); 
  }
  helicsCoreDestroy(arg1);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsCoreFree(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_core arg1 = (helics_core) 0 ;
  int res1 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("helicsCoreFree",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsCoreFree" "', argument " "1"" of type '" "helics_core""'"); 
  }
  helicsCoreFree(arg1);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsBrokerFree(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_broker arg1 = (helics_broker) 0 ;
  int res1 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("helicsBrokerFree",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsBrokerFree" "', argument " "1"" of type '" "helics_broker""'"); 
  }
  helicsBrokerFree(arg1);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsCreateValueFederate(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  char *arg1 = (char *) 0 ;
  helics_federate_info arg2 = (helics_federate_info) 0 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  char *buf1 = 0 ;
  int alloc1 = 0 ;
  int res2 ;
  helics_error etemp3 ;
  mxArray * _out;
  helics_federate result;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsCreateValueFederate",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsCreateValueFederate" "', argument " "1"" of type '" "char const *""'");
  }
  arg1 = reinterpret_cast< char * >(buf1);
  res2 = SWIG_ConvertPtr(argv[1],SWIG_as_voidptrptr(&arg2), 0, 0);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsCreateValueFederate" "', argument " "2"" of type '" "helics_federate_info""'"); 
  }
  result = (helics_federate)helicsCreateValueFederate((char const *)arg1,arg2,arg3);
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
  if (_out) --resc, *resv++ = _out;
  if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsCreateValueFederateFromConfig(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  char *arg1 = (char *) 0 ;
  helics_error *arg2 = (helics_error *) 0 ;
  int res1 ;
  char *buf1 = 0 ;
  int alloc1 = 0 ;
  helics_error etemp2 ;
  mxArray * _out;
  helics_federate result;
  
  {
    etemp2=helicsErrorInitialize();
    arg2=&etemp2;
  }
  if (!SWIG_check_num_args("helicsCreateValueFederateFromConfig",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsCreateValueFederateFromConfig" "', argument " "1"" of type '" "char const *""'");
  }
  arg1 = reinterpret_cast< char * >(buf1);
  result = (helics_federate)helicsCreateValueFederateFromConfig((char const *)arg1,arg2);
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
  if (_out) --resc, *resv++ = _out;
  if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 0;
fail:
  if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 1;
}


int _wrap_helicsCreateMessageFederate(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  char *arg1 = (char *) 0 ;
  helics_federate_info arg2 = (helics_federate_info) 0 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  char *buf1 = 0 ;
  int alloc1 = 0 ;
  int res2 ;
  helics_error etemp3 ;
  mxArray * _out;
  helics_federate result;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsCreateMessageFederate",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsCreateMessageFederate" "', argument " "1"" of type '" "char const *""'");
  }
  arg1 = reinterpret_cast< char * >(buf1);
  res2 = SWIG_ConvertPtr(argv[1],SWIG_as_voidptrptr(&arg2), 0, 0);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsCreateMessageFederate" "', argument " "2"" of type '" "helics_federate_info""'"); 
  }
  result = (helics_federate)helicsCreateMessageFederate((char const *)arg1,arg2,arg3);
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
  if (_out) --resc, *resv++ = _out;
  if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsCreateMessageFederateFromConfig(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  char *arg1 = (char *) 0 ;
  helics_error *arg2 = (helics_error *) 0 ;
  int res1 ;
  char *buf1 = 0 ;
  int alloc1 = 0 ;
  helics_error etemp2 ;
  mxArray * _out;
  helics_federate result;
  
  {
    etemp2=helicsErrorInitialize();
    arg2=&etemp2;
  }
  if (!SWIG_check_num_args("helicsCreateMessageFederateFromConfig",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsCreateMessageFederateFromConfig" "', argument " "1"" of type '" "char const *""'");
  }
  arg1 = reinterpret_cast< char * >(buf1);
  result = (helics_federate)helicsCreateMessageFederateFromConfig((char const *)arg1,arg2);
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
  if (_out) --resc, *resv++ = _out;
  if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 0;
fail:
  if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 1;
}


int _wrap_helicsCreateCombinationFederate(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  char *arg1 = (char *) 0 ;
  helics_federate_info arg2 = (helics_federate_info) 0 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  char *buf1 = 0 ;
  int alloc1 = 0 ;
  int res2 ;
  helics_error etemp3 ;
  mxArray * _out;
  helics_federate result;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsCreateCombinationFederate",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsCreateCombinationFederate" "', argument " "1"" of type '" "char const *""'");
  }
  arg1 = reinterpret_cast< char * >(buf1);
  res2 = SWIG_ConvertPtr(argv[1],SWIG_as_voidptrptr(&arg2), 0, 0);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsCreateCombinationFederate" "', argument " "2"" of type '" "helics_federate_info""'"); 
  }
  result = (helics_federate)helicsCreateCombinationFederate((char const *)arg1,arg2,arg3);
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
  if (_out) --resc, *resv++ = _out;
  if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsCreateCombinationFederateFromConfig(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  char *arg1 = (char *) 0 ;
  helics_error *arg2 = (helics_error *) 0 ;
  int res1 ;
  char *buf1 = 0 ;
  int alloc1 = 0 ;
  helics_error etemp2 ;
  mxArray * _out;
  helics_federate result;
  
  {
    etemp2=helicsErrorInitialize();
    arg2=&etemp2;
  }
  if (!SWIG_check_num_args("helicsCreateCombinationFederateFromConfig",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsCreateCombinationFederateFromConfig" "', argument " "1"" of type '" "char const *""'");
  }
  arg1 = reinterpret_cast< char * >(buf1);
  result = (helics_federate)helicsCreateCombinationFederateFromConfig((char const *)arg1,arg2);
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
  if (_out) --resc, *resv++ = _out;
  if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 0;
fail:
  if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 1;
}


int _wrap_helicsFederateClone(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  helics_error *arg2 = (helics_error *) 0 ;
  int res1 ;
  helics_error etemp2 ;
  mxArray * _out;
  helics_federate result;
  
  {
    etemp2=helicsErrorInitialize();
    arg2=&etemp2;
  }
  if (!SWIG_check_num_args("helicsFederateClone",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateClone" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  result = (helics_federate)helicsFederateClone(arg1,arg2);
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
  if (_out) --resc, *resv++ = _out;
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 0;
fail:
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 1;
}


int _wrap_helicsCreateFederateInfo(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  helics_federate_info result;
  
  if (!SWIG_check_num_args("helicsCreateFederateInfo",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  result = (helics_federate_info)helicsCreateFederateInfo();
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsFederateInfoClone(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate_info arg1 = (helics_federate_info) 0 ;
  helics_error *arg2 = (helics_error *) 0 ;
  int res1 ;
  helics_error etemp2 ;
  mxArray * _out;
  helics_federate_info result;
  
  {
    etemp2=helicsErrorInitialize();
    arg2=&etemp2;
  }
  if (!SWIG_check_num_args("helicsFederateInfoClone",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateInfoClone" "', argument " "1"" of type '" "helics_federate_info""'"); 
  }
  result = (helics_federate_info)helicsFederateInfoClone(arg1,arg2);
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
  if (_out) --resc, *resv++ = _out;
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 0;
fail:
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 1;
}


int _wrap_helicsFederateInfoLoadFromArgs(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate_info arg1 = (helics_federate_info) 0 ;
  int arg2 ;
  char **arg3 = (char **) 0 ;
  helics_error *arg4 = (helics_error *) 0 ;
  int res1 ;
  helics_error etemp4 ;
  mxArray * _out;
  
  {
    etemp4=helicsErrorInitialize();
    arg4=&etemp4;
  }
  if (!SWIG_check_num_args("helicsFederateInfoLoadFromArgs",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateInfoLoadFromArgs" "', argument " "1"" of type '" "helics_federate_info""'"); 
  }
  {
    /* Check if is a list */
    if (mxIsCell(argv[1])) {
      int ii;
      int allocation2=0;
      char *buffer_cell=NULL;
      int cellSize=static_cast<int>(mxGetNumberOfElements(argv[1]));
      arg3 = (char **) malloc((cellSize+1)*sizeof(char *));
      for (ii=0;ii<cellSize;++ii)
      {
        mxArray *cellElement=mxGetCell(argv[1], ii);
        int resCode = SWIG_AsCharPtrAndSize(cellElement, &buffer_cell, NULL, &allocation2);
        if (!SWIG_IsOK(resCode)) {
          SWIG_exception_fail(SWIG_ArgError(resCode), "cell elements must be a string");
        }
        arg3[ii+1]=buffer_cell;
      }
      
    }
    else if (mxIsChar(argv[1]))
    {
      int retval=0;
      char *buffer=NULL;
      int allocation=0;
      arg2=2;
      arg3 = (char **) malloc(2*sizeof(char *));
      retval = SWIG_AsCharPtrAndSize(argv[1], &buffer, NULL, &allocation);
      if (!SWIG_IsOK(retval)) {
        SWIG_exception_fail(SWIG_ArgError(retval), "conversion to string failed");
      }
      arg3[0]=buffer;
      arg3[1]=buffer;
    }
    else
    {
      SWIG_exception_fail(SWIG_ArgError(3), "argument must be a cell array or string");
      return NULL;
    }
  }
  helicsFederateInfoLoadFromArgs(arg1,arg2,(char const *const *)arg3,arg4);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  {
    free((char **) arg3);
  }
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 0;
fail:
  {
    free((char **) arg3);
  }
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 1;
}


int _wrap_helicsFederateInfoFree(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate_info arg1 = (helics_federate_info) 0 ;
  int res1 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("helicsFederateInfoFree",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateInfoFree" "', argument " "1"" of type '" "helics_federate_info""'"); 
  }
  helicsFederateInfoFree(arg1);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsFederateIsValid(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  int res1 ;
  mxArray * _out;
  helics_bool result;
  
  if (!SWIG_check_num_args("helicsFederateIsValid",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateIsValid" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  result = (helics_bool)helicsFederateIsValid(arg1);
  _out = SWIG_From_int(static_cast< int >(result));
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsFederateInfoSetCoreName(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate_info arg1 = (helics_federate_info) 0 ;
  char *arg2 = (char *) 0 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsFederateInfoSetCoreName",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateInfoSetCoreName" "', argument " "1"" of type '" "helics_federate_info""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsFederateInfoSetCoreName" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  helicsFederateInfoSetCoreName(arg1,(char const *)arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsFederateInfoSetCoreInitString(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate_info arg1 = (helics_federate_info) 0 ;
  char *arg2 = (char *) 0 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsFederateInfoSetCoreInitString",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateInfoSetCoreInitString" "', argument " "1"" of type '" "helics_federate_info""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsFederateInfoSetCoreInitString" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  helicsFederateInfoSetCoreInitString(arg1,(char const *)arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsFederateInfoSetBrokerInitString(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate_info arg1 = (helics_federate_info) 0 ;
  char *arg2 = (char *) 0 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsFederateInfoSetBrokerInitString",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateInfoSetBrokerInitString" "', argument " "1"" of type '" "helics_federate_info""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsFederateInfoSetBrokerInitString" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  helicsFederateInfoSetBrokerInitString(arg1,(char const *)arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsFederateInfoSetCoreType(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate_info arg1 = (helics_federate_info) 0 ;
  int arg2 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int val2 ;
  int ecode2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsFederateInfoSetCoreType",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateInfoSetCoreType" "', argument " "1"" of type '" "helics_federate_info""'"); 
  }
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "helicsFederateInfoSetCoreType" "', argument " "2"" of type '" "int""'");
  } 
  arg2 = static_cast< int >(val2);
  helicsFederateInfoSetCoreType(arg1,arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsFederateInfoSetCoreTypeFromString(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate_info arg1 = (helics_federate_info) 0 ;
  char *arg2 = (char *) 0 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsFederateInfoSetCoreTypeFromString",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateInfoSetCoreTypeFromString" "', argument " "1"" of type '" "helics_federate_info""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsFederateInfoSetCoreTypeFromString" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  helicsFederateInfoSetCoreTypeFromString(arg1,(char const *)arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsFederateInfoSetBroker(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate_info arg1 = (helics_federate_info) 0 ;
  char *arg2 = (char *) 0 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsFederateInfoSetBroker",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateInfoSetBroker" "', argument " "1"" of type '" "helics_federate_info""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsFederateInfoSetBroker" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  helicsFederateInfoSetBroker(arg1,(char const *)arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsFederateInfoSetBrokerKey(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate_info arg1 = (helics_federate_info) 0 ;
  char *arg2 = (char *) 0 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsFederateInfoSetBrokerKey",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateInfoSetBrokerKey" "', argument " "1"" of type '" "helics_federate_info""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsFederateInfoSetBrokerKey" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  helicsFederateInfoSetBrokerKey(arg1,(char const *)arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsFederateInfoSetBrokerPort(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate_info arg1 = (helics_federate_info) 0 ;
  int arg2 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int val2 ;
  int ecode2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsFederateInfoSetBrokerPort",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateInfoSetBrokerPort" "', argument " "1"" of type '" "helics_federate_info""'"); 
  }
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "helicsFederateInfoSetBrokerPort" "', argument " "2"" of type '" "int""'");
  } 
  arg2 = static_cast< int >(val2);
  helicsFederateInfoSetBrokerPort(arg1,arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsFederateInfoSetLocalPort(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate_info arg1 = (helics_federate_info) 0 ;
  char *arg2 = (char *) 0 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsFederateInfoSetLocalPort",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateInfoSetLocalPort" "', argument " "1"" of type '" "helics_federate_info""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsFederateInfoSetLocalPort" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  helicsFederateInfoSetLocalPort(arg1,(char const *)arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsGetPropertyIndex(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  char *arg1 = (char *) 0 ;
  int res1 ;
  char *buf1 = 0 ;
  int alloc1 = 0 ;
  mxArray * _out;
  int result;
  
  if (!SWIG_check_num_args("helicsGetPropertyIndex",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsGetPropertyIndex" "', argument " "1"" of type '" "char const *""'");
  }
  arg1 = reinterpret_cast< char * >(buf1);
  result = (int)helicsGetPropertyIndex((char const *)arg1);
  _out = SWIG_From_int(static_cast< int >(result));
  if (_out) --resc, *resv++ = _out;
  if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
  return 0;
fail:
  if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
  return 1;
}


int _wrap_helicsGetFlagIndex(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  char *arg1 = (char *) 0 ;
  int res1 ;
  char *buf1 = 0 ;
  int alloc1 = 0 ;
  mxArray * _out;
  int result;
  
  if (!SWIG_check_num_args("helicsGetFlagIndex",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsGetFlagIndex" "', argument " "1"" of type '" "char const *""'");
  }
  arg1 = reinterpret_cast< char * >(buf1);
  result = (int)helicsGetFlagIndex((char const *)arg1);
  _out = SWIG_From_int(static_cast< int >(result));
  if (_out) --resc, *resv++ = _out;
  if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
  return 0;
fail:
  if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
  return 1;
}


int _wrap_helicsGetOptionIndex(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  char *arg1 = (char *) 0 ;
  int res1 ;
  char *buf1 = 0 ;
  int alloc1 = 0 ;
  mxArray * _out;
  int result;
  
  if (!SWIG_check_num_args("helicsGetOptionIndex",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsGetOptionIndex" "', argument " "1"" of type '" "char const *""'");
  }
  arg1 = reinterpret_cast< char * >(buf1);
  result = (int)helicsGetOptionIndex((char const *)arg1);
  _out = SWIG_From_int(static_cast< int >(result));
  if (_out) --resc, *resv++ = _out;
  if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
  return 0;
fail:
  if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
  return 1;
}


int _wrap_helicsGetOptionValue(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  char *arg1 = (char *) 0 ;
  int res1 ;
  char *buf1 = 0 ;
  int alloc1 = 0 ;
  mxArray * _out;
  int result;
  
  if (!SWIG_check_num_args("helicsGetOptionValue",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsGetOptionValue" "', argument " "1"" of type '" "char const *""'");
  }
  arg1 = reinterpret_cast< char * >(buf1);
  result = (int)helicsGetOptionValue((char const *)arg1);
  _out = SWIG_From_int(static_cast< int >(result));
  if (_out) --resc, *resv++ = _out;
  if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
  return 0;
fail:
  if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
  return 1;
}


int _wrap_helicsFederateInfoSetFlagOption(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate_info arg1 = (helics_federate_info) 0 ;
  int arg2 ;
  helics_bool arg3 ;
  helics_error *arg4 = (helics_error *) 0 ;
  int res1 ;
  int val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  helics_error etemp4 ;
  mxArray * _out;
  
  {
    etemp4=helicsErrorInitialize();
    arg4=&etemp4;
  }
  if (!SWIG_check_num_args("helicsFederateInfoSetFlagOption",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateInfoSetFlagOption" "', argument " "1"" of type '" "helics_federate_info""'"); 
  }
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "helicsFederateInfoSetFlagOption" "', argument " "2"" of type '" "int""'");
  } 
  arg2 = static_cast< int >(val2);
  ecode3 = SWIG_AsVal_int(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "helicsFederateInfoSetFlagOption" "', argument " "3"" of type '" "helics_bool""'");
  } 
  arg3 = static_cast< helics_bool >(val3);
  helicsFederateInfoSetFlagOption(arg1,arg2,arg3,arg4);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 0;
fail:
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 1;
}


int _wrap_helicsFederateInfoSetSeparator(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate_info arg1 = (helics_federate_info) 0 ;
  char arg2 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  char val2 ;
  int ecode2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsFederateInfoSetSeparator",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateInfoSetSeparator" "', argument " "1"" of type '" "helics_federate_info""'"); 
  }
  ecode2 = SWIG_AsVal_char(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "helicsFederateInfoSetSeparator" "', argument " "2"" of type '" "char""'");
  } 
  arg2 = static_cast< char >(val2);
  helicsFederateInfoSetSeparator(arg1,arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsFederateInfoSetTimeProperty(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate_info arg1 = (helics_federate_info) 0 ;
  int arg2 ;
  helics_time arg3 ;
  helics_error *arg4 = (helics_error *) 0 ;
  int res1 ;
  int val2 ;
  int ecode2 = 0 ;
  double val3 ;
  int ecode3 = 0 ;
  helics_error etemp4 ;
  mxArray * _out;
  
  {
    etemp4=helicsErrorInitialize();
    arg4=&etemp4;
  }
  if (!SWIG_check_num_args("helicsFederateInfoSetTimeProperty",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateInfoSetTimeProperty" "', argument " "1"" of type '" "helics_federate_info""'"); 
  }
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "helicsFederateInfoSetTimeProperty" "', argument " "2"" of type '" "int""'");
  } 
  arg2 = static_cast< int >(val2);
  ecode3 = SWIG_AsVal_double(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "helicsFederateInfoSetTimeProperty" "', argument " "3"" of type '" "helics_time""'");
  } 
  arg3 = static_cast< helics_time >(val3);
  helicsFederateInfoSetTimeProperty(arg1,arg2,arg3,arg4);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 0;
fail:
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 1;
}


int _wrap_helicsFederateInfoSetIntegerProperty(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate_info arg1 = (helics_federate_info) 0 ;
  int arg2 ;
  int arg3 ;
  helics_error *arg4 = (helics_error *) 0 ;
  int res1 ;
  int val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  helics_error etemp4 ;
  mxArray * _out;
  
  {
    etemp4=helicsErrorInitialize();
    arg4=&etemp4;
  }
  if (!SWIG_check_num_args("helicsFederateInfoSetIntegerProperty",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateInfoSetIntegerProperty" "', argument " "1"" of type '" "helics_federate_info""'"); 
  }
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "helicsFederateInfoSetIntegerProperty" "', argument " "2"" of type '" "int""'");
  } 
  arg2 = static_cast< int >(val2);
  ecode3 = SWIG_AsVal_int(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "helicsFederateInfoSetIntegerProperty" "', argument " "3"" of type '" "int""'");
  } 
  arg3 = static_cast< int >(val3);
  helicsFederateInfoSetIntegerProperty(arg1,arg2,arg3,arg4);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 0;
fail:
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 1;
}


int _wrap_helicsFederateRegisterInterfaces(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  char *arg2 = (char *) 0 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsFederateRegisterInterfaces",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateRegisterInterfaces" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsFederateRegisterInterfaces" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  helicsFederateRegisterInterfaces(arg1,(char const *)arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsFederateGlobalError(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  int arg2 ;
  char *arg3 = (char *) 0 ;
  int res1 ;
  int val2 ;
  int ecode2 = 0 ;
  int res3 ;
  char *buf3 = 0 ;
  int alloc3 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("helicsFederateGlobalError",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateGlobalError" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "helicsFederateGlobalError" "', argument " "2"" of type '" "int""'");
  } 
  arg2 = static_cast< int >(val2);
  res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "helicsFederateGlobalError" "', argument " "3"" of type '" "char const *""'");
  }
  arg3 = reinterpret_cast< char * >(buf3);
  helicsFederateGlobalError(arg1,arg2,(char const *)arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  return 0;
fail:
  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  return 1;
}


int _wrap_helicsFederateLocalError(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  int arg2 ;
  char *arg3 = (char *) 0 ;
  int res1 ;
  int val2 ;
  int ecode2 = 0 ;
  int res3 ;
  char *buf3 = 0 ;
  int alloc3 = 0 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("helicsFederateLocalError",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateLocalError" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "helicsFederateLocalError" "', argument " "2"" of type '" "int""'");
  } 
  arg2 = static_cast< int >(val2);
  res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "helicsFederateLocalError" "', argument " "3"" of type '" "char const *""'");
  }
  arg3 = reinterpret_cast< char * >(buf3);
  helicsFederateLocalError(arg1,arg2,(char const *)arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  return 0;
fail:
  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  return 1;
}


int _wrap_helicsFederateFinalize(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  helics_error *arg2 = (helics_error *) 0 ;
  int res1 ;
  helics_error etemp2 ;
  mxArray * _out;
  
  {
    etemp2=helicsErrorInitialize();
    arg2=&etemp2;
  }
  if (!SWIG_check_num_args("helicsFederateFinalize",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateFinalize" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  helicsFederateFinalize(arg1,arg2);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 0;
fail:
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 1;
}


int _wrap_helicsFederateFinalizeAsync(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  helics_error *arg2 = (helics_error *) 0 ;
  int res1 ;
  helics_error etemp2 ;
  mxArray * _out;
  
  {
    etemp2=helicsErrorInitialize();
    arg2=&etemp2;
  }
  if (!SWIG_check_num_args("helicsFederateFinalizeAsync",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateFinalizeAsync" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  helicsFederateFinalizeAsync(arg1,arg2);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 0;
fail:
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 1;
}


int _wrap_helicsFederateFinalizeComplete(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  helics_error *arg2 = (helics_error *) 0 ;
  int res1 ;
  helics_error etemp2 ;
  mxArray * _out;
  
  {
    etemp2=helicsErrorInitialize();
    arg2=&etemp2;
  }
  if (!SWIG_check_num_args("helicsFederateFinalizeComplete",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateFinalizeComplete" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  helicsFederateFinalizeComplete(arg1,arg2);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 0;
fail:
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 1;
}


int _wrap_helicsFederateFree(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  int res1 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("helicsFederateFree",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateFree" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  helicsFederateFree(arg1);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsCloseLibrary(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  
  if (!SWIG_check_num_args("helicsCloseLibrary",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  helicsCloseLibrary();
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsFederateEnterInitializingMode(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  helics_error *arg2 = (helics_error *) 0 ;
  int res1 ;
  helics_error etemp2 ;
  mxArray * _out;
  
  {
    etemp2=helicsErrorInitialize();
    arg2=&etemp2;
  }
  if (!SWIG_check_num_args("helicsFederateEnterInitializingMode",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateEnterInitializingMode" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  helicsFederateEnterInitializingMode(arg1,arg2);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 0;
fail:
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 1;
}


int _wrap_helicsFederateEnterInitializingModeAsync(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  helics_error *arg2 = (helics_error *) 0 ;
  int res1 ;
  helics_error etemp2 ;
  mxArray * _out;
  
  {
    etemp2=helicsErrorInitialize();
    arg2=&etemp2;
  }
  if (!SWIG_check_num_args("helicsFederateEnterInitializingModeAsync",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateEnterInitializingModeAsync" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  helicsFederateEnterInitializingModeAsync(arg1,arg2);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 0;
fail:
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 1;
}


int _wrap_helicsFederateIsAsyncOperationCompleted(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  helics_error *arg2 = (helics_error *) 0 ;
  int res1 ;
  helics_error etemp2 ;
  mxArray * _out;
  helics_bool result;
  
  {
    etemp2=helicsErrorInitialize();
    arg2=&etemp2;
  }
  if (!SWIG_check_num_args("helicsFederateIsAsyncOperationCompleted",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateIsAsyncOperationCompleted" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  result = (helics_bool)helicsFederateIsAsyncOperationCompleted(arg1,arg2);
  _out = SWIG_From_int(static_cast< int >(result));
  if (_out) --resc, *resv++ = _out;
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 0;
fail:
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 1;
}


int _wrap_helicsFederateEnterInitializingModeComplete(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  helics_error *arg2 = (helics_error *) 0 ;
  int res1 ;
  helics_error etemp2 ;
  mxArray * _out;
  
  {
    etemp2=helicsErrorInitialize();
    arg2=&etemp2;
  }
  if (!SWIG_check_num_args("helicsFederateEnterInitializingModeComplete",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateEnterInitializingModeComplete" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  helicsFederateEnterInitializingModeComplete(arg1,arg2);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 0;
fail:
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 1;
}


int _wrap_helicsFederateEnterExecutingMode(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  helics_error *arg2 = (helics_error *) 0 ;
  int res1 ;
  helics_error etemp2 ;
  mxArray * _out;
  
  {
    etemp2=helicsErrorInitialize();
    arg2=&etemp2;
  }
  if (!SWIG_check_num_args("helicsFederateEnterExecutingMode",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateEnterExecutingMode" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  helicsFederateEnterExecutingMode(arg1,arg2);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 0;
fail:
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 1;
}


int _wrap_helicsFederateEnterExecutingModeAsync(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  helics_error *arg2 = (helics_error *) 0 ;
  int res1 ;
  helics_error etemp2 ;
  mxArray * _out;
  
  {
    etemp2=helicsErrorInitialize();
    arg2=&etemp2;
  }
  if (!SWIG_check_num_args("helicsFederateEnterExecutingModeAsync",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateEnterExecutingModeAsync" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  helicsFederateEnterExecutingModeAsync(arg1,arg2);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 0;
fail:
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 1;
}


int _wrap_helicsFederateEnterExecutingModeComplete(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  helics_error *arg2 = (helics_error *) 0 ;
  int res1 ;
  helics_error etemp2 ;
  mxArray * _out;
  
  {
    etemp2=helicsErrorInitialize();
    arg2=&etemp2;
  }
  if (!SWIG_check_num_args("helicsFederateEnterExecutingModeComplete",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateEnterExecutingModeComplete" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  helicsFederateEnterExecutingModeComplete(arg1,arg2);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 0;
fail:
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 1;
}


int _wrap_helicsFederateEnterExecutingModeIterative(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  helics_iteration_request arg2 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int val2 ;
  int ecode2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  helics_iteration_result result;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsFederateEnterExecutingModeIterative",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateEnterExecutingModeIterative" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "helicsFederateEnterExecutingModeIterative" "', argument " "2"" of type '" "helics_iteration_request""'");
  } 
  arg2 = static_cast< helics_iteration_request >(val2);
  result = (helics_iteration_result)helicsFederateEnterExecutingModeIterative(arg1,arg2,arg3);
  _out = SWIG_From_int(static_cast< int >(result));
  if (_out) --resc, *resv++ = _out;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsFederateEnterExecutingModeIterativeAsync(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  helics_iteration_request arg2 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int val2 ;
  int ecode2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsFederateEnterExecutingModeIterativeAsync",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateEnterExecutingModeIterativeAsync" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "helicsFederateEnterExecutingModeIterativeAsync" "', argument " "2"" of type '" "helics_iteration_request""'");
  } 
  arg2 = static_cast< helics_iteration_request >(val2);
  helicsFederateEnterExecutingModeIterativeAsync(arg1,arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsFederateEnterExecutingModeIterativeComplete(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  helics_error *arg2 = (helics_error *) 0 ;
  int res1 ;
  helics_error etemp2 ;
  mxArray * _out;
  helics_iteration_result result;
  
  {
    etemp2=helicsErrorInitialize();
    arg2=&etemp2;
  }
  if (!SWIG_check_num_args("helicsFederateEnterExecutingModeIterativeComplete",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateEnterExecutingModeIterativeComplete" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  result = (helics_iteration_result)helicsFederateEnterExecutingModeIterativeComplete(arg1,arg2);
  _out = SWIG_From_int(static_cast< int >(result));
  if (_out) --resc, *resv++ = _out;
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 0;
fail:
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 1;
}


int _wrap_helicsFederateGetState(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  helics_error *arg2 = (helics_error *) 0 ;
  int res1 ;
  helics_error etemp2 ;
  mxArray * _out;
  helics_federate_state result;
  
  {
    etemp2=helicsErrorInitialize();
    arg2=&etemp2;
  }
  if (!SWIG_check_num_args("helicsFederateGetState",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateGetState" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  result = (helics_federate_state)helicsFederateGetState(arg1,arg2);
  _out = SWIG_From_int(static_cast< int >(result));
  if (_out) --resc, *resv++ = _out;
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 0;
fail:
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 1;
}


int _wrap_helicsFederateGetCoreObject(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  helics_error *arg2 = (helics_error *) 0 ;
  int res1 ;
  helics_error etemp2 ;
  mxArray * _out;
  helics_core result;
  
  {
    etemp2=helicsErrorInitialize();
    arg2=&etemp2;
  }
  if (!SWIG_check_num_args("helicsFederateGetCoreObject",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateGetCoreObject" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  result = (helics_core)helicsFederateGetCoreObject(arg1,arg2);
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
  if (_out) --resc, *resv++ = _out;
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 0;
fail:
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 1;
}


int _wrap_helicsFederateRequestTime(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  helics_time arg2 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  double val2 ;
  int ecode2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  helics_time result;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsFederateRequestTime",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateRequestTime" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  ecode2 = SWIG_AsVal_double(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "helicsFederateRequestTime" "', argument " "2"" of type '" "helics_time""'");
  } 
  arg2 = static_cast< helics_time >(val2);
  result = (helics_time)helicsFederateRequestTime(arg1,arg2,arg3);
  _out = SWIG_From_double(static_cast< double >(result));
  if (_out) --resc, *resv++ = _out;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsFederateRequestTimeAdvance(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  helics_time arg2 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  double val2 ;
  int ecode2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  helics_time result;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsFederateRequestTimeAdvance",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateRequestTimeAdvance" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  ecode2 = SWIG_AsVal_double(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "helicsFederateRequestTimeAdvance" "', argument " "2"" of type '" "helics_time""'");
  } 
  arg2 = static_cast< helics_time >(val2);
  result = (helics_time)helicsFederateRequestTimeAdvance(arg1,arg2,arg3);
  _out = SWIG_From_double(static_cast< double >(result));
  if (_out) --resc, *resv++ = _out;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsFederateRequestNextStep(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  helics_error *arg2 = (helics_error *) 0 ;
  int res1 ;
  helics_error etemp2 ;
  mxArray * _out;
  helics_time result;
  
  {
    etemp2=helicsErrorInitialize();
    arg2=&etemp2;
  }
  if (!SWIG_check_num_args("helicsFederateRequestNextStep",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateRequestNextStep" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  result = (helics_time)helicsFederateRequestNextStep(arg1,arg2);
  _out = SWIG_From_double(static_cast< double >(result));
  if (_out) --resc, *resv++ = _out;
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 0;
fail:
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 1;
}


int _wrap_helicsFederateRequestTimeIterative(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  helics_time arg2 ;
  helics_iteration_request arg3 ;
  helics_iteration_result *arg4 = (helics_iteration_result *) 0 ;
  helics_error *arg5 = (helics_error *) 0 ;
  int res1 ;
  double val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  helics_iteration_result temp4 ;
  int res4 = SWIG_TMPOBJ ;
  helics_error etemp5 ;
  mxArray * _out;
  helics_time result;
  
  arg4 = &temp4;
  {
    etemp5=helicsErrorInitialize();
    arg5=&etemp5;
  }
  if (!SWIG_check_num_args("helicsFederateRequestTimeIterative",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateRequestTimeIterative" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  ecode2 = SWIG_AsVal_double(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "helicsFederateRequestTimeIterative" "', argument " "2"" of type '" "helics_time""'");
  } 
  arg2 = static_cast< helics_time >(val2);
  ecode3 = SWIG_AsVal_int(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "helicsFederateRequestTimeIterative" "', argument " "3"" of type '" "helics_iteration_request""'");
  } 
  arg3 = static_cast< helics_iteration_request >(val3);
  result = (helics_time)helicsFederateRequestTimeIterative(arg1,arg2,arg3,arg4,arg5);
  _out = SWIG_From_double(static_cast< double >(result));
  if (_out) --resc, *resv++ = _out;
  if (SWIG_IsTmpObj(res4)) {
    if (--resc>=0) *resv++ = SWIG_From_int((*arg4));
  } else {
    int new_flags = SWIG_IsNewObj(res4) ? (SWIG_POINTER_OWN |  0 ) :  0 ;
    if (--resc>=0) *resv++ = SWIG_NewPointerObj((void*)(arg4), SWIGTYPE_p_helics_iteration_result, new_flags);
  }
  {
    if (arg5->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg5);
    }
  }
  return 0;
fail:
  {
    if (arg5->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg5);
    }
  }
  return 1;
}


int _wrap_helicsFederateRequestTimeAsync(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  helics_time arg2 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  double val2 ;
  int ecode2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsFederateRequestTimeAsync",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateRequestTimeAsync" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  ecode2 = SWIG_AsVal_double(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "helicsFederateRequestTimeAsync" "', argument " "2"" of type '" "helics_time""'");
  } 
  arg2 = static_cast< helics_time >(val2);
  helicsFederateRequestTimeAsync(arg1,arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsFederateRequestTimeComplete(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  helics_error *arg2 = (helics_error *) 0 ;
  int res1 ;
  helics_error etemp2 ;
  mxArray * _out;
  helics_time result;
  
  {
    etemp2=helicsErrorInitialize();
    arg2=&etemp2;
  }
  if (!SWIG_check_num_args("helicsFederateRequestTimeComplete",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateRequestTimeComplete" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  result = (helics_time)helicsFederateRequestTimeComplete(arg1,arg2);
  _out = SWIG_From_double(static_cast< double >(result));
  if (_out) --resc, *resv++ = _out;
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 0;
fail:
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 1;
}


int _wrap_helicsFederateRequestTimeIterativeAsync(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  helics_time arg2 ;
  helics_iteration_request arg3 ;
  helics_error *arg4 = (helics_error *) 0 ;
  int res1 ;
  double val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  helics_error etemp4 ;
  mxArray * _out;
  
  {
    etemp4=helicsErrorInitialize();
    arg4=&etemp4;
  }
  if (!SWIG_check_num_args("helicsFederateRequestTimeIterativeAsync",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateRequestTimeIterativeAsync" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  ecode2 = SWIG_AsVal_double(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "helicsFederateRequestTimeIterativeAsync" "', argument " "2"" of type '" "helics_time""'");
  } 
  arg2 = static_cast< helics_time >(val2);
  ecode3 = SWIG_AsVal_int(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "helicsFederateRequestTimeIterativeAsync" "', argument " "3"" of type '" "helics_iteration_request""'");
  } 
  arg3 = static_cast< helics_iteration_request >(val3);
  helicsFederateRequestTimeIterativeAsync(arg1,arg2,arg3,arg4);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 0;
fail:
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 1;
}


int _wrap_helicsFederateRequestTimeIterativeComplete(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  helics_iteration_result *arg2 = (helics_iteration_result *) 0 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  helics_iteration_result temp2 ;
  int res2 = SWIG_TMPOBJ ;
  helics_error etemp3 ;
  mxArray * _out;
  helics_time result;
  
  arg2 = &temp2;
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsFederateRequestTimeIterativeComplete",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateRequestTimeIterativeComplete" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  result = (helics_time)helicsFederateRequestTimeIterativeComplete(arg1,arg2,arg3);
  _out = SWIG_From_double(static_cast< double >(result));
  if (_out) --resc, *resv++ = _out;
  if (SWIG_IsTmpObj(res2)) {
    if (--resc>=0) *resv++ = SWIG_From_int((*arg2));
  } else {
    int new_flags = SWIG_IsNewObj(res2) ? (SWIG_POINTER_OWN |  0 ) :  0 ;
    if (--resc>=0) *resv++ = SWIG_NewPointerObj((void*)(arg2), SWIGTYPE_p_helics_iteration_result, new_flags);
  }
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsFederateGetName(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  int res1 ;
  mxArray * _out;
  char *result = 0 ;
  
  if (!SWIG_check_num_args("helicsFederateGetName",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateGetName" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  result = (char *)helicsFederateGetName(arg1);
  _out = SWIG_FromCharPtr((const char *)result);
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsFederateSetTimeProperty(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  int arg2 ;
  helics_time arg3 ;
  helics_error *arg4 = (helics_error *) 0 ;
  int res1 ;
  int val2 ;
  int ecode2 = 0 ;
  double val3 ;
  int ecode3 = 0 ;
  helics_error etemp4 ;
  mxArray * _out;
  
  {
    etemp4=helicsErrorInitialize();
    arg4=&etemp4;
  }
  if (!SWIG_check_num_args("helicsFederateSetTimeProperty",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateSetTimeProperty" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "helicsFederateSetTimeProperty" "', argument " "2"" of type '" "int""'");
  } 
  arg2 = static_cast< int >(val2);
  ecode3 = SWIG_AsVal_double(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "helicsFederateSetTimeProperty" "', argument " "3"" of type '" "helics_time""'");
  } 
  arg3 = static_cast< helics_time >(val3);
  helicsFederateSetTimeProperty(arg1,arg2,arg3,arg4);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 0;
fail:
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 1;
}


int _wrap_helicsFederateSetFlagOption(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  int arg2 ;
  helics_bool arg3 ;
  helics_error *arg4 = (helics_error *) 0 ;
  int res1 ;
  int val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  helics_error etemp4 ;
  mxArray * _out;
  
  {
    etemp4=helicsErrorInitialize();
    arg4=&etemp4;
  }
  if (!SWIG_check_num_args("helicsFederateSetFlagOption",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateSetFlagOption" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "helicsFederateSetFlagOption" "', argument " "2"" of type '" "int""'");
  } 
  arg2 = static_cast< int >(val2);
  ecode3 = SWIG_AsVal_int(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "helicsFederateSetFlagOption" "', argument " "3"" of type '" "helics_bool""'");
  } 
  arg3 = static_cast< helics_bool >(val3);
  helicsFederateSetFlagOption(arg1,arg2,arg3,arg4);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 0;
fail:
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 1;
}


int _wrap_helicsFederateSetSeparator(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  char arg2 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  char val2 ;
  int ecode2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsFederateSetSeparator",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateSetSeparator" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  ecode2 = SWIG_AsVal_char(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "helicsFederateSetSeparator" "', argument " "2"" of type '" "char""'");
  } 
  arg2 = static_cast< char >(val2);
  helicsFederateSetSeparator(arg1,arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsFederateSetIntegerProperty(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  int arg2 ;
  int arg3 ;
  helics_error *arg4 = (helics_error *) 0 ;
  int res1 ;
  int val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  helics_error etemp4 ;
  mxArray * _out;
  
  {
    etemp4=helicsErrorInitialize();
    arg4=&etemp4;
  }
  if (!SWIG_check_num_args("helicsFederateSetIntegerProperty",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateSetIntegerProperty" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "helicsFederateSetIntegerProperty" "', argument " "2"" of type '" "int""'");
  } 
  arg2 = static_cast< int >(val2);
  ecode3 = SWIG_AsVal_int(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "helicsFederateSetIntegerProperty" "', argument " "3"" of type '" "int""'");
  } 
  arg3 = static_cast< int >(val3);
  helicsFederateSetIntegerProperty(arg1,arg2,arg3,arg4);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 0;
fail:
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 1;
}


int _wrap_helicsFederateGetTimeProperty(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  int arg2 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int val2 ;
  int ecode2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  helics_time result;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsFederateGetTimeProperty",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateGetTimeProperty" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "helicsFederateGetTimeProperty" "', argument " "2"" of type '" "int""'");
  } 
  arg2 = static_cast< int >(val2);
  result = (helics_time)helicsFederateGetTimeProperty(arg1,arg2,arg3);
  _out = SWIG_From_double(static_cast< double >(result));
  if (_out) --resc, *resv++ = _out;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsFederateGetFlagOption(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  int arg2 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int val2 ;
  int ecode2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  helics_bool result;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsFederateGetFlagOption",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateGetFlagOption" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "helicsFederateGetFlagOption" "', argument " "2"" of type '" "int""'");
  } 
  arg2 = static_cast< int >(val2);
  result = (helics_bool)helicsFederateGetFlagOption(arg1,arg2,arg3);
  _out = SWIG_From_int(static_cast< int >(result));
  if (_out) --resc, *resv++ = _out;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsFederateGetIntegerProperty(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  int arg2 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int val2 ;
  int ecode2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  int result;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsFederateGetIntegerProperty",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateGetIntegerProperty" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "helicsFederateGetIntegerProperty" "', argument " "2"" of type '" "int""'");
  } 
  arg2 = static_cast< int >(val2);
  result = (int)helicsFederateGetIntegerProperty(arg1,arg2,arg3);
  _out = SWIG_From_int(static_cast< int >(result));
  if (_out) --resc, *resv++ = _out;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsFederateGetCurrentTime(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  helics_error *arg2 = (helics_error *) 0 ;
  int res1 ;
  helics_error etemp2 ;
  mxArray * _out;
  helics_time result;
  
  {
    etemp2=helicsErrorInitialize();
    arg2=&etemp2;
  }
  if (!SWIG_check_num_args("helicsFederateGetCurrentTime",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateGetCurrentTime" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  result = (helics_time)helicsFederateGetCurrentTime(arg1,arg2);
  _out = SWIG_From_double(static_cast< double >(result));
  if (_out) --resc, *resv++ = _out;
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 0;
fail:
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 1;
}


int _wrap_helicsFederateSetGlobal(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  char *arg2 = (char *) 0 ;
  char *arg3 = (char *) 0 ;
  helics_error *arg4 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  int res3 ;
  char *buf3 = 0 ;
  int alloc3 = 0 ;
  helics_error etemp4 ;
  mxArray * _out;
  
  {
    etemp4=helicsErrorInitialize();
    arg4=&etemp4;
  }
  if (!SWIG_check_num_args("helicsFederateSetGlobal",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateSetGlobal" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsFederateSetGlobal" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "helicsFederateSetGlobal" "', argument " "3"" of type '" "char const *""'");
  }
  arg3 = reinterpret_cast< char * >(buf3);
  helicsFederateSetGlobal(arg1,(char const *)arg2,(char const *)arg3,arg4);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 1;
}


int _wrap_helicsFederateAddDependency(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  char *arg2 = (char *) 0 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsFederateAddDependency",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateAddDependency" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsFederateAddDependency" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  helicsFederateAddDependency(arg1,(char const *)arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsFederateSetLogFile(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  char *arg2 = (char *) 0 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsFederateSetLogFile",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateSetLogFile" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsFederateSetLogFile" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  helicsFederateSetLogFile(arg1,(char const *)arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsFederateLogErrorMessage(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  char *arg2 = (char *) 0 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsFederateLogErrorMessage",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateLogErrorMessage" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsFederateLogErrorMessage" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  helicsFederateLogErrorMessage(arg1,(char const *)arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsFederateLogWarningMessage(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  char *arg2 = (char *) 0 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsFederateLogWarningMessage",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateLogWarningMessage" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsFederateLogWarningMessage" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  helicsFederateLogWarningMessage(arg1,(char const *)arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsFederateLogInfoMessage(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  char *arg2 = (char *) 0 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsFederateLogInfoMessage",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateLogInfoMessage" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsFederateLogInfoMessage" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  helicsFederateLogInfoMessage(arg1,(char const *)arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsFederateLogDebugMessage(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  char *arg2 = (char *) 0 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsFederateLogDebugMessage",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateLogDebugMessage" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsFederateLogDebugMessage" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  helicsFederateLogDebugMessage(arg1,(char const *)arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsFederateLogLevelMessage(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  int arg2 ;
  char *arg3 = (char *) 0 ;
  helics_error *arg4 = (helics_error *) 0 ;
  int res1 ;
  int val2 ;
  int ecode2 = 0 ;
  int res3 ;
  char *buf3 = 0 ;
  int alloc3 = 0 ;
  helics_error etemp4 ;
  mxArray * _out;
  
  {
    etemp4=helicsErrorInitialize();
    arg4=&etemp4;
  }
  if (!SWIG_check_num_args("helicsFederateLogLevelMessage",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateLogLevelMessage" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "helicsFederateLogLevelMessage" "', argument " "2"" of type '" "int""'");
  } 
  arg2 = static_cast< int >(val2);
  res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "helicsFederateLogLevelMessage" "', argument " "3"" of type '" "char const *""'");
  }
  arg3 = reinterpret_cast< char * >(buf3);
  helicsFederateLogLevelMessage(arg1,arg2,(char const *)arg3,arg4);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 0;
fail:
  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 1;
}


int _wrap_helicsCoreSetGlobal(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_core arg1 = (helics_core) 0 ;
  char *arg2 = (char *) 0 ;
  char *arg3 = (char *) 0 ;
  helics_error *arg4 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  int res3 ;
  char *buf3 = 0 ;
  int alloc3 = 0 ;
  helics_error etemp4 ;
  mxArray * _out;
  
  {
    etemp4=helicsErrorInitialize();
    arg4=&etemp4;
  }
  if (!SWIG_check_num_args("helicsCoreSetGlobal",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsCoreSetGlobal" "', argument " "1"" of type '" "helics_core""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsCoreSetGlobal" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "helicsCoreSetGlobal" "', argument " "3"" of type '" "char const *""'");
  }
  arg3 = reinterpret_cast< char * >(buf3);
  helicsCoreSetGlobal(arg1,(char const *)arg2,(char const *)arg3,arg4);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 1;
}


int _wrap_helicsBrokerSetGlobal(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_broker arg1 = (helics_broker) 0 ;
  char *arg2 = (char *) 0 ;
  char *arg3 = (char *) 0 ;
  helics_error *arg4 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  int res3 ;
  char *buf3 = 0 ;
  int alloc3 = 0 ;
  helics_error etemp4 ;
  mxArray * _out;
  
  {
    etemp4=helicsErrorInitialize();
    arg4=&etemp4;
  }
  if (!SWIG_check_num_args("helicsBrokerSetGlobal",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsBrokerSetGlobal" "', argument " "1"" of type '" "helics_broker""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsBrokerSetGlobal" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "helicsBrokerSetGlobal" "', argument " "3"" of type '" "char const *""'");
  }
  arg3 = reinterpret_cast< char * >(buf3);
  helicsBrokerSetGlobal(arg1,(char const *)arg2,(char const *)arg3,arg4);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 1;
}


int _wrap_helicsCoreSetLogFile(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_core arg1 = (helics_core) 0 ;
  char *arg2 = (char *) 0 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsCoreSetLogFile",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsCoreSetLogFile" "', argument " "1"" of type '" "helics_core""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsCoreSetLogFile" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  helicsCoreSetLogFile(arg1,(char const *)arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsBrokerSetLogFile(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_broker arg1 = (helics_broker) 0 ;
  char *arg2 = (char *) 0 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsBrokerSetLogFile",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsBrokerSetLogFile" "', argument " "1"" of type '" "helics_broker""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsBrokerSetLogFile" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  helicsBrokerSetLogFile(arg1,(char const *)arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsCreateQuery(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  char *arg1 = (char *) 0 ;
  char *arg2 = (char *) 0 ;
  int res1 ;
  char *buf1 = 0 ;
  int alloc1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  mxArray * _out;
  helics_query result;
  
  if (!SWIG_check_num_args("helicsCreateQuery",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsCreateQuery" "', argument " "1"" of type '" "char const *""'");
  }
  arg1 = reinterpret_cast< char * >(buf1);
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsCreateQuery" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  result = (helics_query)helicsCreateQuery((char const *)arg1,(char const *)arg2);
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
  if (_out) --resc, *resv++ = _out;
  if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  return 0;
fail:
  if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  return 1;
}


int _wrap_helicsQueryExecute(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_query arg1 = (helics_query) 0 ;
  helics_federate arg2 = (helics_federate) 0 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  helics_error etemp3 ;
  mxArray * _out;
  char *result = 0 ;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsQueryExecute",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsQueryExecute" "', argument " "1"" of type '" "helics_query""'"); 
  }
  res2 = SWIG_ConvertPtr(argv[1],SWIG_as_voidptrptr(&arg2), 0, 0);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsQueryExecute" "', argument " "2"" of type '" "helics_federate""'"); 
  }
  result = (char *)helicsQueryExecute(arg1,arg2,arg3);
  _out = SWIG_FromCharPtr((const char *)result);
  if (_out) --resc, *resv++ = _out;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsQueryCoreExecute(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_query arg1 = (helics_query) 0 ;
  helics_core arg2 = (helics_core) 0 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  helics_error etemp3 ;
  mxArray * _out;
  char *result = 0 ;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsQueryCoreExecute",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsQueryCoreExecute" "', argument " "1"" of type '" "helics_query""'"); 
  }
  res2 = SWIG_ConvertPtr(argv[1],SWIG_as_voidptrptr(&arg2), 0, 0);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsQueryCoreExecute" "', argument " "2"" of type '" "helics_core""'"); 
  }
  result = (char *)helicsQueryCoreExecute(arg1,arg2,arg3);
  _out = SWIG_FromCharPtr((const char *)result);
  if (_out) --resc, *resv++ = _out;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsQueryBrokerExecute(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_query arg1 = (helics_query) 0 ;
  helics_broker arg2 = (helics_broker) 0 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  helics_error etemp3 ;
  mxArray * _out;
  char *result = 0 ;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsQueryBrokerExecute",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsQueryBrokerExecute" "', argument " "1"" of type '" "helics_query""'"); 
  }
  res2 = SWIG_ConvertPtr(argv[1],SWIG_as_voidptrptr(&arg2), 0, 0);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsQueryBrokerExecute" "', argument " "2"" of type '" "helics_broker""'"); 
  }
  result = (char *)helicsQueryBrokerExecute(arg1,arg2,arg3);
  _out = SWIG_FromCharPtr((const char *)result);
  if (_out) --resc, *resv++ = _out;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsQueryExecuteAsync(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_query arg1 = (helics_query) 0 ;
  helics_federate arg2 = (helics_federate) 0 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsQueryExecuteAsync",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsQueryExecuteAsync" "', argument " "1"" of type '" "helics_query""'"); 
  }
  res2 = SWIG_ConvertPtr(argv[1],SWIG_as_voidptrptr(&arg2), 0, 0);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsQueryExecuteAsync" "', argument " "2"" of type '" "helics_federate""'"); 
  }
  helicsQueryExecuteAsync(arg1,arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsQueryExecuteComplete(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_query arg1 = (helics_query) 0 ;
  helics_error *arg2 = (helics_error *) 0 ;
  int res1 ;
  helics_error etemp2 ;
  mxArray * _out;
  char *result = 0 ;
  
  {
    etemp2=helicsErrorInitialize();
    arg2=&etemp2;
  }
  if (!SWIG_check_num_args("helicsQueryExecuteComplete",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsQueryExecuteComplete" "', argument " "1"" of type '" "helics_query""'"); 
  }
  result = (char *)helicsQueryExecuteComplete(arg1,arg2);
  _out = SWIG_FromCharPtr((const char *)result);
  if (_out) --resc, *resv++ = _out;
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 0;
fail:
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 1;
}


int _wrap_helicsQueryIsCompleted(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_query arg1 = (helics_query) 0 ;
  int res1 ;
  mxArray * _out;
  helics_bool result;
  
  if (!SWIG_check_num_args("helicsQueryIsCompleted",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsQueryIsCompleted" "', argument " "1"" of type '" "helics_query""'"); 
  }
  result = (helics_bool)helicsQueryIsCompleted(arg1);
  _out = SWIG_From_int(static_cast< int >(result));
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsQuerySetTarget(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_query arg1 = (helics_query) 0 ;
  char *arg2 = (char *) 0 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsQuerySetTarget",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsQuerySetTarget" "', argument " "1"" of type '" "helics_query""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsQuerySetTarget" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  helicsQuerySetTarget(arg1,(char const *)arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsQuerySetQueryString(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_query arg1 = (helics_query) 0 ;
  char *arg2 = (char *) 0 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsQuerySetQueryString",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsQuerySetQueryString" "', argument " "1"" of type '" "helics_query""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsQuerySetQueryString" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  helicsQuerySetQueryString(arg1,(char const *)arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsQueryFree(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_query arg1 = (helics_query) 0 ;
  int res1 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("helicsQueryFree",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsQueryFree" "', argument " "1"" of type '" "helics_query""'"); 
  }
  helicsQueryFree(arg1);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsCleanupLibrary(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  mxArray * _out;
  
  if (!SWIG_check_num_args("helicsCleanupLibrary",argc,0,0,0)) {
    SWIG_fail;
  }
  (void)argv;
  helicsCleanupLibrary();
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsFederateRegisterSubscription(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  char *arg2 = (char *) 0 ;
  char *arg3 = (char *) 0 ;
  helics_error *arg4 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  int res3 ;
  char *buf3 = 0 ;
  int alloc3 = 0 ;
  helics_error etemp4 ;
  mxArray * _out;
  helics_input result;
  
  {
    etemp4=helicsErrorInitialize();
    arg4=&etemp4;
  }
  if (!SWIG_check_num_args("helicsFederateRegisterSubscription",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateRegisterSubscription" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsFederateRegisterSubscription" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "helicsFederateRegisterSubscription" "', argument " "3"" of type '" "char const *""'");
  }
  arg3 = reinterpret_cast< char * >(buf3);
  result = (helics_input)helicsFederateRegisterSubscription(arg1,(char const *)arg2,(char const *)arg3,arg4);
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 1;
}


int _wrap_helicsFederateRegisterPublication(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  char *arg2 = (char *) 0 ;
  helics_data_type arg3 ;
  char *arg4 = (char *) 0 ;
  helics_error *arg5 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  int res4 ;
  char *buf4 = 0 ;
  int alloc4 = 0 ;
  helics_error etemp5 ;
  mxArray * _out;
  helics_publication result;
  
  {
    etemp5=helicsErrorInitialize();
    arg5=&etemp5;
  }
  if (!SWIG_check_num_args("helicsFederateRegisterPublication",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateRegisterPublication" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsFederateRegisterPublication" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  ecode3 = SWIG_AsVal_int(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "helicsFederateRegisterPublication" "', argument " "3"" of type '" "helics_data_type""'");
  } 
  arg3 = static_cast< helics_data_type >(val3);
  res4 = SWIG_AsCharPtrAndSize(argv[3], &buf4, NULL, &alloc4);
  if (!SWIG_IsOK(res4)) {
    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "helicsFederateRegisterPublication" "', argument " "4"" of type '" "char const *""'");
  }
  arg4 = reinterpret_cast< char * >(buf4);
  result = (helics_publication)helicsFederateRegisterPublication(arg1,(char const *)arg2,arg3,(char const *)arg4,arg5);
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
  {
    if (arg5->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg5);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
  {
    if (arg5->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg5);
    }
  }
  return 1;
}


int _wrap_helicsFederateRegisterTypePublication(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  char *arg2 = (char *) 0 ;
  char *arg3 = (char *) 0 ;
  char *arg4 = (char *) 0 ;
  helics_error *arg5 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  int res3 ;
  char *buf3 = 0 ;
  int alloc3 = 0 ;
  int res4 ;
  char *buf4 = 0 ;
  int alloc4 = 0 ;
  helics_error etemp5 ;
  mxArray * _out;
  helics_publication result;
  
  {
    etemp5=helicsErrorInitialize();
    arg5=&etemp5;
  }
  if (!SWIG_check_num_args("helicsFederateRegisterTypePublication",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateRegisterTypePublication" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsFederateRegisterTypePublication" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "helicsFederateRegisterTypePublication" "', argument " "3"" of type '" "char const *""'");
  }
  arg3 = reinterpret_cast< char * >(buf3);
  res4 = SWIG_AsCharPtrAndSize(argv[3], &buf4, NULL, &alloc4);
  if (!SWIG_IsOK(res4)) {
    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "helicsFederateRegisterTypePublication" "', argument " "4"" of type '" "char const *""'");
  }
  arg4 = reinterpret_cast< char * >(buf4);
  result = (helics_publication)helicsFederateRegisterTypePublication(arg1,(char const *)arg2,(char const *)arg3,(char const *)arg4,arg5);
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
  {
    if (arg5->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg5);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
  {
    if (arg5->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg5);
    }
  }
  return 1;
}


int _wrap_helicsFederateRegisterGlobalPublication(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  char *arg2 = (char *) 0 ;
  helics_data_type arg3 ;
  char *arg4 = (char *) 0 ;
  helics_error *arg5 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  int res4 ;
  char *buf4 = 0 ;
  int alloc4 = 0 ;
  helics_error etemp5 ;
  mxArray * _out;
  helics_publication result;
  
  {
    etemp5=helicsErrorInitialize();
    arg5=&etemp5;
  }
  if (!SWIG_check_num_args("helicsFederateRegisterGlobalPublication",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateRegisterGlobalPublication" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsFederateRegisterGlobalPublication" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  ecode3 = SWIG_AsVal_int(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "helicsFederateRegisterGlobalPublication" "', argument " "3"" of type '" "helics_data_type""'");
  } 
  arg3 = static_cast< helics_data_type >(val3);
  res4 = SWIG_AsCharPtrAndSize(argv[3], &buf4, NULL, &alloc4);
  if (!SWIG_IsOK(res4)) {
    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "helicsFederateRegisterGlobalPublication" "', argument " "4"" of type '" "char const *""'");
  }
  arg4 = reinterpret_cast< char * >(buf4);
  result = (helics_publication)helicsFederateRegisterGlobalPublication(arg1,(char const *)arg2,arg3,(char const *)arg4,arg5);
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
  {
    if (arg5->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg5);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
  {
    if (arg5->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg5);
    }
  }
  return 1;
}


int _wrap_helicsFederateRegisterGlobalTypePublication(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  char *arg2 = (char *) 0 ;
  char *arg3 = (char *) 0 ;
  char *arg4 = (char *) 0 ;
  helics_error *arg5 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  int res3 ;
  char *buf3 = 0 ;
  int alloc3 = 0 ;
  int res4 ;
  char *buf4 = 0 ;
  int alloc4 = 0 ;
  helics_error etemp5 ;
  mxArray * _out;
  helics_publication result;
  
  {
    etemp5=helicsErrorInitialize();
    arg5=&etemp5;
  }
  if (!SWIG_check_num_args("helicsFederateRegisterGlobalTypePublication",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateRegisterGlobalTypePublication" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsFederateRegisterGlobalTypePublication" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "helicsFederateRegisterGlobalTypePublication" "', argument " "3"" of type '" "char const *""'");
  }
  arg3 = reinterpret_cast< char * >(buf3);
  res4 = SWIG_AsCharPtrAndSize(argv[3], &buf4, NULL, &alloc4);
  if (!SWIG_IsOK(res4)) {
    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "helicsFederateRegisterGlobalTypePublication" "', argument " "4"" of type '" "char const *""'");
  }
  arg4 = reinterpret_cast< char * >(buf4);
  result = (helics_publication)helicsFederateRegisterGlobalTypePublication(arg1,(char const *)arg2,(char const *)arg3,(char const *)arg4,arg5);
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
  {
    if (arg5->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg5);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
  {
    if (arg5->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg5);
    }
  }
  return 1;
}


int _wrap_helicsFederateRegisterInput(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  char *arg2 = (char *) 0 ;
  helics_data_type arg3 ;
  char *arg4 = (char *) 0 ;
  helics_error *arg5 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  int res4 ;
  char *buf4 = 0 ;
  int alloc4 = 0 ;
  helics_error etemp5 ;
  mxArray * _out;
  helics_input result;
  
  {
    etemp5=helicsErrorInitialize();
    arg5=&etemp5;
  }
  if (!SWIG_check_num_args("helicsFederateRegisterInput",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateRegisterInput" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsFederateRegisterInput" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  ecode3 = SWIG_AsVal_int(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "helicsFederateRegisterInput" "', argument " "3"" of type '" "helics_data_type""'");
  } 
  arg3 = static_cast< helics_data_type >(val3);
  res4 = SWIG_AsCharPtrAndSize(argv[3], &buf4, NULL, &alloc4);
  if (!SWIG_IsOK(res4)) {
    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "helicsFederateRegisterInput" "', argument " "4"" of type '" "char const *""'");
  }
  arg4 = reinterpret_cast< char * >(buf4);
  result = (helics_input)helicsFederateRegisterInput(arg1,(char const *)arg2,arg3,(char const *)arg4,arg5);
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
  {
    if (arg5->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg5);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
  {
    if (arg5->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg5);
    }
  }
  return 1;
}


int _wrap_helicsFederateRegisterTypeInput(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  char *arg2 = (char *) 0 ;
  char *arg3 = (char *) 0 ;
  char *arg4 = (char *) 0 ;
  helics_error *arg5 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  int res3 ;
  char *buf3 = 0 ;
  int alloc3 = 0 ;
  int res4 ;
  char *buf4 = 0 ;
  int alloc4 = 0 ;
  helics_error etemp5 ;
  mxArray * _out;
  helics_input result;
  
  {
    etemp5=helicsErrorInitialize();
    arg5=&etemp5;
  }
  if (!SWIG_check_num_args("helicsFederateRegisterTypeInput",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateRegisterTypeInput" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsFederateRegisterTypeInput" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "helicsFederateRegisterTypeInput" "', argument " "3"" of type '" "char const *""'");
  }
  arg3 = reinterpret_cast< char * >(buf3);
  res4 = SWIG_AsCharPtrAndSize(argv[3], &buf4, NULL, &alloc4);
  if (!SWIG_IsOK(res4)) {
    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "helicsFederateRegisterTypeInput" "', argument " "4"" of type '" "char const *""'");
  }
  arg4 = reinterpret_cast< char * >(buf4);
  result = (helics_input)helicsFederateRegisterTypeInput(arg1,(char const *)arg2,(char const *)arg3,(char const *)arg4,arg5);
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
  {
    if (arg5->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg5);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
  {
    if (arg5->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg5);
    }
  }
  return 1;
}


int _wrap_helicsFederateRegisterGlobalInput(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  char *arg2 = (char *) 0 ;
  helics_data_type arg3 ;
  char *arg4 = (char *) 0 ;
  helics_error *arg5 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  int res4 ;
  char *buf4 = 0 ;
  int alloc4 = 0 ;
  helics_error etemp5 ;
  mxArray * _out;
  helics_publication result;
  
  {
    etemp5=helicsErrorInitialize();
    arg5=&etemp5;
  }
  if (!SWIG_check_num_args("helicsFederateRegisterGlobalInput",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateRegisterGlobalInput" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsFederateRegisterGlobalInput" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  ecode3 = SWIG_AsVal_int(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "helicsFederateRegisterGlobalInput" "', argument " "3"" of type '" "helics_data_type""'");
  } 
  arg3 = static_cast< helics_data_type >(val3);
  res4 = SWIG_AsCharPtrAndSize(argv[3], &buf4, NULL, &alloc4);
  if (!SWIG_IsOK(res4)) {
    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "helicsFederateRegisterGlobalInput" "', argument " "4"" of type '" "char const *""'");
  }
  arg4 = reinterpret_cast< char * >(buf4);
  result = (helics_publication)helicsFederateRegisterGlobalInput(arg1,(char const *)arg2,arg3,(char const *)arg4,arg5);
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
  {
    if (arg5->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg5);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
  {
    if (arg5->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg5);
    }
  }
  return 1;
}


int _wrap_helicsFederateRegisterGlobalTypeInput(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  char *arg2 = (char *) 0 ;
  char *arg3 = (char *) 0 ;
  char *arg4 = (char *) 0 ;
  helics_error *arg5 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  int res3 ;
  char *buf3 = 0 ;
  int alloc3 = 0 ;
  int res4 ;
  char *buf4 = 0 ;
  int alloc4 = 0 ;
  helics_error etemp5 ;
  mxArray * _out;
  helics_publication result;
  
  {
    etemp5=helicsErrorInitialize();
    arg5=&etemp5;
  }
  if (!SWIG_check_num_args("helicsFederateRegisterGlobalTypeInput",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateRegisterGlobalTypeInput" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsFederateRegisterGlobalTypeInput" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "helicsFederateRegisterGlobalTypeInput" "', argument " "3"" of type '" "char const *""'");
  }
  arg3 = reinterpret_cast< char * >(buf3);
  res4 = SWIG_AsCharPtrAndSize(argv[3], &buf4, NULL, &alloc4);
  if (!SWIG_IsOK(res4)) {
    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "helicsFederateRegisterGlobalTypeInput" "', argument " "4"" of type '" "char const *""'");
  }
  arg4 = reinterpret_cast< char * >(buf4);
  result = (helics_publication)helicsFederateRegisterGlobalTypeInput(arg1,(char const *)arg2,(char const *)arg3,(char const *)arg4,arg5);
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
  {
    if (arg5->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg5);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
  {
    if (arg5->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg5);
    }
  }
  return 1;
}


int _wrap_helicsFederateGetPublication(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  char *arg2 = (char *) 0 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  helics_publication result;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsFederateGetPublication",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateGetPublication" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsFederateGetPublication" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  result = (helics_publication)helicsFederateGetPublication(arg1,(char const *)arg2,arg3);
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsFederateGetPublicationByIndex(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  int arg2 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int val2 ;
  int ecode2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  helics_publication result;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsFederateGetPublicationByIndex",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateGetPublicationByIndex" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "helicsFederateGetPublicationByIndex" "', argument " "2"" of type '" "int""'");
  } 
  arg2 = static_cast< int >(val2);
  result = (helics_publication)helicsFederateGetPublicationByIndex(arg1,arg2,arg3);
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
  if (_out) --resc, *resv++ = _out;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsFederateGetInput(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  char *arg2 = (char *) 0 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  helics_input result;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsFederateGetInput",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateGetInput" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsFederateGetInput" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  result = (helics_input)helicsFederateGetInput(arg1,(char const *)arg2,arg3);
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsFederateGetInputByIndex(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  int arg2 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int val2 ;
  int ecode2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  helics_input result;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsFederateGetInputByIndex",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateGetInputByIndex" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "helicsFederateGetInputByIndex" "', argument " "2"" of type '" "int""'");
  } 
  arg2 = static_cast< int >(val2);
  result = (helics_input)helicsFederateGetInputByIndex(arg1,arg2,arg3);
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
  if (_out) --resc, *resv++ = _out;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsFederateGetSubscription(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  char *arg2 = (char *) 0 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  helics_input result;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsFederateGetSubscription",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateGetSubscription" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsFederateGetSubscription" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  result = (helics_input)helicsFederateGetSubscription(arg1,(char const *)arg2,arg3);
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsFederateClearUpdates(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  int res1 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("helicsFederateClearUpdates",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateClearUpdates" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  helicsFederateClearUpdates(arg1);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsFederateRegisterFromPublicationJSON(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  char *arg2 = (char *) 0 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsFederateRegisterFromPublicationJSON",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateRegisterFromPublicationJSON" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsFederateRegisterFromPublicationJSON" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  helicsFederateRegisterFromPublicationJSON(arg1,(char const *)arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsFederatePublishJSON(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  char *arg2 = (char *) 0 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsFederatePublishJSON",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederatePublishJSON" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsFederatePublishJSON" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  helicsFederatePublishJSON(arg1,(char const *)arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsPublicationIsValid(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_publication arg1 = (helics_publication) 0 ;
  int res1 ;
  mxArray * _out;
  helics_bool result;
  
  if (!SWIG_check_num_args("helicsPublicationIsValid",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsPublicationIsValid" "', argument " "1"" of type '" "helics_publication""'"); 
  }
  result = (helics_bool)helicsPublicationIsValid(arg1);
  _out = SWIG_From_int(static_cast< int >(result));
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsPublicationPublishRaw(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_publication arg1 = (helics_publication) 0 ;
  void *arg2 = (void *) 0 ;
  int arg3 ;
  helics_error *arg4 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  size_t size2 = 0 ;
  int alloc2 = 0 ;
  helics_error etemp4 ;
  mxArray * _out;
  
  {
    etemp4=helicsErrorInitialize();
    arg4=&etemp4;
  }
  if (!SWIG_check_num_args("helicsPublicationPublishRaw",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsPublicationPublishRaw" "', argument " "1"" of type '" "helics_publication""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, &size2, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsPublicationPublishRaw" "', argument " "2"" of type '" "void const *""'");
  }  
  arg2 = reinterpret_cast< void * >(buf2);
  arg3 = static_cast< int >(size2 - 1);
  helicsPublicationPublishRaw(arg1,(void const *)arg2,arg3,arg4);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 1;
}


int _wrap_helicsPublicationPublishString(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_publication arg1 = (helics_publication) 0 ;
  char *arg2 = (char *) 0 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsPublicationPublishString",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsPublicationPublishString" "', argument " "1"" of type '" "helics_publication""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsPublicationPublishString" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  helicsPublicationPublishString(arg1,(char const *)arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsPublicationPublishInteger(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_publication arg1 = (helics_publication) 0 ;
  int64_t arg2 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  long long val2 ;
  int ecode2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsPublicationPublishInteger",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsPublicationPublishInteger" "', argument " "1"" of type '" "helics_publication""'"); 
  }
  ecode2 = SWIG_AsVal_long_SS_long(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "helicsPublicationPublishInteger" "', argument " "2"" of type '" "int64_t""'");
  } 
  arg2 = static_cast< int64_t >(val2);
  helicsPublicationPublishInteger(arg1,arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsPublicationPublishBoolean(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_publication arg1 = (helics_publication) 0 ;
  helics_bool arg2 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int val2 ;
  int ecode2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsPublicationPublishBoolean",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsPublicationPublishBoolean" "', argument " "1"" of type '" "helics_publication""'"); 
  }
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "helicsPublicationPublishBoolean" "', argument " "2"" of type '" "helics_bool""'");
  } 
  arg2 = static_cast< helics_bool >(val2);
  helicsPublicationPublishBoolean(arg1,arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsPublicationPublishDouble(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_publication arg1 = (helics_publication) 0 ;
  double arg2 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  double val2 ;
  int ecode2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsPublicationPublishDouble",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsPublicationPublishDouble" "', argument " "1"" of type '" "helics_publication""'"); 
  }
  ecode2 = SWIG_AsVal_double(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "helicsPublicationPublishDouble" "', argument " "2"" of type '" "double""'");
  } 
  arg2 = static_cast< double >(val2);
  helicsPublicationPublishDouble(arg1,arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsPublicationPublishTime(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_publication arg1 = (helics_publication) 0 ;
  helics_time arg2 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  double val2 ;
  int ecode2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsPublicationPublishTime",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsPublicationPublishTime" "', argument " "1"" of type '" "helics_publication""'"); 
  }
  ecode2 = SWIG_AsVal_double(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "helicsPublicationPublishTime" "', argument " "2"" of type '" "helics_time""'");
  } 
  arg2 = static_cast< helics_time >(val2);
  helicsPublicationPublishTime(arg1,arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsPublicationPublishChar(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_publication arg1 = (helics_publication) 0 ;
  char arg2 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  char val2 ;
  int ecode2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsPublicationPublishChar",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsPublicationPublishChar" "', argument " "1"" of type '" "helics_publication""'"); 
  }
  ecode2 = SWIG_AsVal_char(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "helicsPublicationPublishChar" "', argument " "2"" of type '" "char""'");
  } 
  arg2 = static_cast< char >(val2);
  helicsPublicationPublishChar(arg1,arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsPublicationPublishComplex(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_publication arg1 = (helics_publication) 0 ;
  double arg2 ;
  double arg3 ;
  helics_error *arg4 = (helics_error *) 0 ;
  int res1 ;
  helics_error etemp4 ;
  mxArray * _out;
  
  {
    etemp4=helicsErrorInitialize();
    arg4=&etemp4;
  }
  if (!SWIG_check_num_args("helicsPublicationPublishComplex",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsPublicationPublishComplex" "', argument " "1"" of type '" "helics_publication""'"); 
  }
  {
    if(mxIsComplex(argv[1]))
    {
      arg2=mxGetPr(argv[1])[0];
      arg3=mxGetPi(argv[1])[0];
    }
    else if (mxIsDouble(argv[1]))
    {
      arg3=0.0;
      arg2=mxGetPr(argv[1])[0];
    }
    else
    {
      arg2=0.0;
      arg3 = 0.0;
    }
  }
  helicsPublicationPublishComplex(arg1,arg2,arg3,arg4);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 0;
fail:
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 1;
}


int _wrap_helicsPublicationPublishVector(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_publication arg1 = (helics_publication) 0 ;
  double *arg2 = (double *) 0 ;
  int arg3 ;
  helics_error *arg4 = (helics_error *) 0 ;
  int res1 ;
  helics_error etemp4 ;
  mxArray * _out;
  
  {
    etemp4=helicsErrorInitialize();
    arg4=&etemp4;
  }
  if (!SWIG_check_num_args("helicsPublicationPublishVector",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsPublicationPublishVector" "', argument " "1"" of type '" "helics_publication""'"); 
  }
  {
    if (!mxIsDouble(argv[1])) {
      SWIG_exception_fail(SWIG_ArgError(3), "argument must be a double array");
      return NULL;
    }
    arg3=static_cast<int>(mxGetNumberOfElements(argv[1]));
    arg2=mxGetPr(argv[1]);
  }
  helicsPublicationPublishVector(arg1,(double const *)arg2,arg3,arg4);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  {
    
  }
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 0;
fail:
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 1;
}


int _wrap_helicsPublicationPublishNamedPoint(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_publication arg1 = (helics_publication) 0 ;
  char *arg2 = (char *) 0 ;
  double arg3 ;
  helics_error *arg4 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  double val3 ;
  int ecode3 = 0 ;
  helics_error etemp4 ;
  mxArray * _out;
  
  {
    etemp4=helicsErrorInitialize();
    arg4=&etemp4;
  }
  if (!SWIG_check_num_args("helicsPublicationPublishNamedPoint",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsPublicationPublishNamedPoint" "', argument " "1"" of type '" "helics_publication""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsPublicationPublishNamedPoint" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  ecode3 = SWIG_AsVal_double(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "helicsPublicationPublishNamedPoint" "', argument " "3"" of type '" "double""'");
  } 
  arg3 = static_cast< double >(val3);
  helicsPublicationPublishNamedPoint(arg1,(char const *)arg2,arg3,arg4);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 1;
}


int _wrap_helicsPublicationAddTarget(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_publication arg1 = (helics_publication) 0 ;
  char *arg2 = (char *) 0 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsPublicationAddTarget",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsPublicationAddTarget" "', argument " "1"" of type '" "helics_publication""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsPublicationAddTarget" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  helicsPublicationAddTarget(arg1,(char const *)arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsInputIsValid(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_input arg1 = (helics_input) 0 ;
  int res1 ;
  mxArray * _out;
  helics_bool result;
  
  if (!SWIG_check_num_args("helicsInputIsValid",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsInputIsValid" "', argument " "1"" of type '" "helics_input""'"); 
  }
  result = (helics_bool)helicsInputIsValid(arg1);
  _out = SWIG_From_int(static_cast< int >(result));
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsInputAddTarget(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_input arg1 = (helics_input) 0 ;
  char *arg2 = (char *) 0 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsInputAddTarget",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsInputAddTarget" "', argument " "1"" of type '" "helics_input""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsInputAddTarget" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  helicsInputAddTarget(arg1,(char const *)arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsInputGetRawValueSize(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_input arg1 = (helics_input) 0 ;
  int res1 ;
  mxArray * _out;
  int result;
  
  if (!SWIG_check_num_args("helicsInputGetRawValueSize",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsInputGetRawValueSize" "', argument " "1"" of type '" "helics_input""'"); 
  }
  result = (int)helicsInputGetRawValueSize(arg1);
  _out = SWIG_From_int(static_cast< int >(result));
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsInputGetRawValue(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_input arg1 = (helics_input) 0 ;
  void *arg2 = (void *) 0 ;
  int arg3 ;
  int *arg4 = (int *) 0 ;
  helics_error *arg5 = (helics_error *) 0 ;
  int res1 ;
  helics_error etemp5 ;
  mxArray * _out;
  
  {
    arg4=&(arg3);
  }
  {
    etemp5=helicsErrorInitialize();
    arg5=&etemp5;
  }
  if (!SWIG_check_num_args("helicsInputGetRawValue",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsInputGetRawValue" "', argument " "1"" of type '" "helics_input""'"); 
  }
  {
    arg3 = helicsInputGetRawValueSize(arg1) + 2;
    arg2 =  malloc(arg3);
  }
  helicsInputGetRawValue(arg1,arg2,arg3,arg4,arg5);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  {
    if (--resc>=0) *resv++ = SWIG_FromCharPtrAndSize((char*)arg2,*arg4);
  }
  {
    if (arg2) free(arg2);
  }
  {
    if (arg5->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg5);
    }
  }
  return 0;
fail:
  {
    if (arg2) free(arg2);
  }
  {
    if (arg5->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg5);
    }
  }
  return 1;
}


int _wrap_helicsInputGetStringSize(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_input arg1 = (helics_input) 0 ;
  int res1 ;
  mxArray * _out;
  int result;
  
  if (!SWIG_check_num_args("helicsInputGetStringSize",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsInputGetStringSize" "', argument " "1"" of type '" "helics_input""'"); 
  }
  result = (int)helicsInputGetStringSize(arg1);
  _out = SWIG_From_int(static_cast< int >(result));
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsInputGetString(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_input arg1 = (helics_input) 0 ;
  char *arg2 = (char *) 0 ;
  int arg3 ;
  int *arg4 = (int *) 0 ;
  helics_error *arg5 = (helics_error *) 0 ;
  int res1 ;
  helics_error etemp5 ;
  mxArray * _out;
  
  {
    arg4=&(arg3);
  }
  {
    etemp5=helicsErrorInitialize();
    arg5=&etemp5;
  }
  if (!SWIG_check_num_args("helicsInputGetString",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsInputGetString" "', argument " "1"" of type '" "helics_input""'"); 
  }
  {
    arg3=helicsInputGetStringSize(arg1)+2;
    arg2 = (char *) malloc(arg3);
  }
  helicsInputGetString(arg1,arg2,arg3,arg4,arg5);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  {
    if (--resc>=0) *resv++ = SWIG_FromCharPtrAndSize(arg2,*arg4-1);
  }
  {
    if (arg2) free(arg2);
  }
  {
    if (arg5->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg5);
    }
  }
  return 0;
fail:
  {
    if (arg2) free(arg2);
  }
  {
    if (arg5->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg5);
    }
  }
  return 1;
}


int _wrap_helicsInputGetInteger(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_input arg1 = (helics_input) 0 ;
  helics_error *arg2 = (helics_error *) 0 ;
  int res1 ;
  helics_error etemp2 ;
  mxArray * _out;
  int64_t result;
  
  {
    etemp2=helicsErrorInitialize();
    arg2=&etemp2;
  }
  if (!SWIG_check_num_args("helicsInputGetInteger",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsInputGetInteger" "', argument " "1"" of type '" "helics_input""'"); 
  }
  result = helicsInputGetInteger(arg1,arg2);
  _out = SWIG_From_long_SS_long(static_cast< long long >(result));
  if (_out) --resc, *resv++ = _out;
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 0;
fail:
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 1;
}


int _wrap_helicsInputGetBoolean(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_input arg1 = (helics_input) 0 ;
  helics_error *arg2 = (helics_error *) 0 ;
  int res1 ;
  helics_error etemp2 ;
  mxArray * _out;
  helics_bool result;
  
  {
    etemp2=helicsErrorInitialize();
    arg2=&etemp2;
  }
  if (!SWIG_check_num_args("helicsInputGetBoolean",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsInputGetBoolean" "', argument " "1"" of type '" "helics_input""'"); 
  }
  result = (helics_bool)helicsInputGetBoolean(arg1,arg2);
  _out = SWIG_From_int(static_cast< int >(result));
  if (_out) --resc, *resv++ = _out;
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 0;
fail:
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 1;
}


int _wrap_helicsInputGetDouble(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_input arg1 = (helics_input) 0 ;
  helics_error *arg2 = (helics_error *) 0 ;
  int res1 ;
  helics_error etemp2 ;
  mxArray * _out;
  double result;
  
  {
    etemp2=helicsErrorInitialize();
    arg2=&etemp2;
  }
  if (!SWIG_check_num_args("helicsInputGetDouble",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsInputGetDouble" "', argument " "1"" of type '" "helics_input""'"); 
  }
  result = (double)helicsInputGetDouble(arg1,arg2);
  _out = SWIG_From_double(static_cast< double >(result));
  if (_out) --resc, *resv++ = _out;
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 0;
fail:
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 1;
}


int _wrap_helicsInputGetTime(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_input arg1 = (helics_input) 0 ;
  helics_error *arg2 = (helics_error *) 0 ;
  int res1 ;
  helics_error etemp2 ;
  mxArray * _out;
  helics_time result;
  
  {
    etemp2=helicsErrorInitialize();
    arg2=&etemp2;
  }
  if (!SWIG_check_num_args("helicsInputGetTime",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsInputGetTime" "', argument " "1"" of type '" "helics_input""'"); 
  }
  result = (helics_time)helicsInputGetTime(arg1,arg2);
  _out = SWIG_From_double(static_cast< double >(result));
  if (_out) --resc, *resv++ = _out;
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 0;
fail:
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 1;
}


int _wrap_helicsInputGetChar(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_input arg1 = (helics_input) 0 ;
  helics_error *arg2 = (helics_error *) 0 ;
  int res1 ;
  helics_error etemp2 ;
  mxArray * _out;
  char result;
  
  {
    etemp2=helicsErrorInitialize();
    arg2=&etemp2;
  }
  if (!SWIG_check_num_args("helicsInputGetChar",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsInputGetChar" "', argument " "1"" of type '" "helics_input""'"); 
  }
  result = (char)helicsInputGetChar(arg1,arg2);
  _out = SWIG_From_char(static_cast< char >(result));
  if (_out) --resc, *resv++ = _out;
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 0;
fail:
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 1;
}


int _wrap_helicsInputGetComplex(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_input arg1 = (helics_input) 0 ;
  double *arg2 = (double *) 0 ;
  double *arg3 = (double *) 0 ;
  helics_error *arg4 = (helics_error *) 0 ;
  int res1 ;
  double vals2[2] ;
  helics_error etemp4 ;
  mxArray * _out;
  
  {
    arg2=&(vals2[0]);
    arg3=&(vals2[1]);
  }
  {
    etemp4=helicsErrorInitialize();
    arg4=&etemp4;
  }
  if (!SWIG_check_num_args("helicsInputGetComplex",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsInputGetComplex" "', argument " "1"" of type '" "helics_input""'"); 
  }
  helicsInputGetComplex(arg1,arg2,arg3,arg4);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  {
    mxArray *out=mxCreateDoubleMatrix(1, 1, mxCOMPLEX);
    double *r=mxGetPr(out);
    double *i=mxGetPi(out);
    *r=*arg2;
    *i=*arg3;
    if (--resc>=0) *resv++ =out;
  }
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 0;
fail:
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 1;
}


int _wrap_helicsInputGetVectorSize(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_input arg1 = (helics_input) 0 ;
  int res1 ;
  mxArray * _out;
  int result;
  
  if (!SWIG_check_num_args("helicsInputGetVectorSize",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsInputGetVectorSize" "', argument " "1"" of type '" "helics_input""'"); 
  }
  result = (int)helicsInputGetVectorSize(arg1);
  _out = SWIG_From_int(static_cast< int >(result));
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsInputGetVector(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_input arg1 = (helics_input) 0 ;
  double *arg2 ;
  int arg3 ;
  int *arg4 = (int *) 0 ;
  helics_error *arg5 = (helics_error *) 0 ;
  int res1 ;
  helics_error etemp5 ;
  mxArray * _out;
  
  {
    arg2=(double *)(NULL);
  }
  {
    arg4=&(arg3);
  }
  {
    etemp5=helicsErrorInitialize();
    arg5=&etemp5;
  }
  if (!SWIG_check_num_args("helicsInputGetVector",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsInputGetVector" "', argument " "1"" of type '" "helics_input""'"); 
  }
  {
    arg3=helicsInputGetVectorSize(arg1);
    arg2 = (double *) mxCalloc(arg3,sizeof(double));
  }
  helicsInputGetVector(arg1,arg2,arg3,arg4,arg5);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  {
    mxArray *mat=mxCreateDoubleMatrix(*arg4,1,mxREAL);
    mxSetPr(mat,arg2);
    if (--resc>=0) *resv++ = mat;
  }
  {
    //if (arg2) free(arg2);
  }
  {
    if (arg5->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg5);
    }
  }
  return 0;
fail:
  {
    //if (arg2) free(arg2);
  }
  {
    if (arg5->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg5);
    }
  }
  return 1;
}


int _wrap_helicsInputGetNamedPoint(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_input arg1 = (helics_input) 0 ;
  char *arg2 = (char *) 0 ;
  int arg3 ;
  int *arg4 = (int *) 0 ;
  double *arg5 = (double *) 0 ;
  helics_error *arg6 = (helics_error *) 0 ;
  int res1 ;
  double temp5 ;
  int res5 = SWIG_TMPOBJ ;
  helics_error etemp6 ;
  mxArray * _out;
  
  {
    arg4=&(arg3);
  }
  arg5 = &temp5;
  {
    etemp6=helicsErrorInitialize();
    arg6=&etemp6;
  }
  if (!SWIG_check_num_args("helicsInputGetNamedPoint",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsInputGetNamedPoint" "', argument " "1"" of type '" "helics_input""'"); 
  }
  {
    arg3=helicsInputGetStringSize(arg1)+2;
    arg2 = (char *) malloc(arg3);
  }
  helicsInputGetNamedPoint(arg1,arg2,arg3,arg4,arg5,arg6);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  {
    if (--resc>=0) *resv++ = SWIG_FromCharPtrAndSize(arg2,*arg4-1);
  }
  if (SWIG_IsTmpObj(res5)) {
    if (--resc>=0) *resv++ = SWIG_From_double((*arg5));
  } else {
    int new_flags = SWIG_IsNewObj(res5) ? (SWIG_POINTER_OWN |  0 ) :  0 ;
    if (--resc>=0) *resv++ = SWIG_NewPointerObj((void*)(arg5), SWIGTYPE_p_double, new_flags);
  }
  {
    if (arg2) free(arg2);
  }
  {
    if (arg6->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg6);
    }
  }
  return 0;
fail:
  {
    if (arg2) free(arg2);
  }
  {
    if (arg6->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg6);
    }
  }
  return 1;
}


int _wrap_helicsInputSetDefaultRaw(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_input arg1 = (helics_input) 0 ;
  void *arg2 = (void *) 0 ;
  int arg3 ;
  helics_error *arg4 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  size_t size2 = 0 ;
  int alloc2 = 0 ;
  helics_error etemp4 ;
  mxArray * _out;
  
  {
    etemp4=helicsErrorInitialize();
    arg4=&etemp4;
  }
  if (!SWIG_check_num_args("helicsInputSetDefaultRaw",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsInputSetDefaultRaw" "', argument " "1"" of type '" "helics_input""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, &size2, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsInputSetDefaultRaw" "', argument " "2"" of type '" "void const *""'");
  }  
  arg2 = reinterpret_cast< void * >(buf2);
  arg3 = static_cast< int >(size2 - 1);
  helicsInputSetDefaultRaw(arg1,(void const *)arg2,arg3,arg4);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 1;
}


int _wrap_helicsInputSetDefaultString(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_input arg1 = (helics_input) 0 ;
  char *arg2 = (char *) 0 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsInputSetDefaultString",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsInputSetDefaultString" "', argument " "1"" of type '" "helics_input""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsInputSetDefaultString" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  helicsInputSetDefaultString(arg1,(char const *)arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsInputSetDefaultInteger(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_input arg1 = (helics_input) 0 ;
  int64_t arg2 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  long long val2 ;
  int ecode2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsInputSetDefaultInteger",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsInputSetDefaultInteger" "', argument " "1"" of type '" "helics_input""'"); 
  }
  ecode2 = SWIG_AsVal_long_SS_long(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "helicsInputSetDefaultInteger" "', argument " "2"" of type '" "int64_t""'");
  } 
  arg2 = static_cast< int64_t >(val2);
  helicsInputSetDefaultInteger(arg1,arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsInputSetDefaultBoolean(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_input arg1 = (helics_input) 0 ;
  helics_bool arg2 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int val2 ;
  int ecode2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsInputSetDefaultBoolean",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsInputSetDefaultBoolean" "', argument " "1"" of type '" "helics_input""'"); 
  }
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "helicsInputSetDefaultBoolean" "', argument " "2"" of type '" "helics_bool""'");
  } 
  arg2 = static_cast< helics_bool >(val2);
  helicsInputSetDefaultBoolean(arg1,arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsInputSetDefaultTime(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_input arg1 = (helics_input) 0 ;
  helics_time arg2 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  double val2 ;
  int ecode2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsInputSetDefaultTime",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsInputSetDefaultTime" "', argument " "1"" of type '" "helics_input""'"); 
  }
  ecode2 = SWIG_AsVal_double(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "helicsInputSetDefaultTime" "', argument " "2"" of type '" "helics_time""'");
  } 
  arg2 = static_cast< helics_time >(val2);
  helicsInputSetDefaultTime(arg1,arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsInputSetDefaultChar(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_input arg1 = (helics_input) 0 ;
  char arg2 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  char val2 ;
  int ecode2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsInputSetDefaultChar",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsInputSetDefaultChar" "', argument " "1"" of type '" "helics_input""'"); 
  }
  ecode2 = SWIG_AsVal_char(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "helicsInputSetDefaultChar" "', argument " "2"" of type '" "char""'");
  } 
  arg2 = static_cast< char >(val2);
  helicsInputSetDefaultChar(arg1,arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsInputSetDefaultDouble(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_input arg1 = (helics_input) 0 ;
  double arg2 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  double val2 ;
  int ecode2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsInputSetDefaultDouble",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsInputSetDefaultDouble" "', argument " "1"" of type '" "helics_input""'"); 
  }
  ecode2 = SWIG_AsVal_double(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "helicsInputSetDefaultDouble" "', argument " "2"" of type '" "double""'");
  } 
  arg2 = static_cast< double >(val2);
  helicsInputSetDefaultDouble(arg1,arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsInputSetDefaultComplex(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_input arg1 = (helics_input) 0 ;
  double arg2 ;
  double arg3 ;
  helics_error *arg4 = (helics_error *) 0 ;
  int res1 ;
  helics_error etemp4 ;
  mxArray * _out;
  
  {
    etemp4=helicsErrorInitialize();
    arg4=&etemp4;
  }
  if (!SWIG_check_num_args("helicsInputSetDefaultComplex",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsInputSetDefaultComplex" "', argument " "1"" of type '" "helics_input""'"); 
  }
  {
    if(mxIsComplex(argv[1]))
    {
      arg2=mxGetPr(argv[1])[0];
      arg3=mxGetPi(argv[1])[0];
    }
    else if (mxIsDouble(argv[1]))
    {
      arg3=0.0;
      arg2=mxGetPr(argv[1])[0];
    }
    else
    {
      arg2=0.0;
      arg3 = 0.0;
    }
  }
  helicsInputSetDefaultComplex(arg1,arg2,arg3,arg4);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 0;
fail:
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 1;
}


int _wrap_helicsInputSetDefaultVector(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_input arg1 = (helics_input) 0 ;
  double *arg2 = (double *) 0 ;
  int arg3 ;
  helics_error *arg4 = (helics_error *) 0 ;
  int res1 ;
  helics_error etemp4 ;
  mxArray * _out;
  
  {
    etemp4=helicsErrorInitialize();
    arg4=&etemp4;
  }
  if (!SWIG_check_num_args("helicsInputSetDefaultVector",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsInputSetDefaultVector" "', argument " "1"" of type '" "helics_input""'"); 
  }
  {
    if (!mxIsDouble(argv[1])) {
      SWIG_exception_fail(SWIG_ArgError(3), "argument must be a double array");
      return NULL;
    }
    arg3=static_cast<int>(mxGetNumberOfElements(argv[1]));
    arg2=mxGetPr(argv[1]);
  }
  helicsInputSetDefaultVector(arg1,(double const *)arg2,arg3,arg4);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  {
    
  }
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 0;
fail:
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 1;
}


int _wrap_helicsInputSetDefaultNamedPoint(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_input arg1 = (helics_input) 0 ;
  char *arg2 = (char *) 0 ;
  double arg3 ;
  helics_error *arg4 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  double val3 ;
  int ecode3 = 0 ;
  helics_error etemp4 ;
  mxArray * _out;
  
  {
    etemp4=helicsErrorInitialize();
    arg4=&etemp4;
  }
  if (!SWIG_check_num_args("helicsInputSetDefaultNamedPoint",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsInputSetDefaultNamedPoint" "', argument " "1"" of type '" "helics_input""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsInputSetDefaultNamedPoint" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  ecode3 = SWIG_AsVal_double(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "helicsInputSetDefaultNamedPoint" "', argument " "3"" of type '" "double""'");
  } 
  arg3 = static_cast< double >(val3);
  helicsInputSetDefaultNamedPoint(arg1,(char const *)arg2,arg3,arg4);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 1;
}


int _wrap_helicsInputGetType(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_input arg1 = (helics_input) 0 ;
  int res1 ;
  mxArray * _out;
  char *result = 0 ;
  
  if (!SWIG_check_num_args("helicsInputGetType",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsInputGetType" "', argument " "1"" of type '" "helics_input""'"); 
  }
  result = (char *)helicsInputGetType(arg1);
  _out = SWIG_FromCharPtr((const char *)result);
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsInputGetPublicationType(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_input arg1 = (helics_input) 0 ;
  int res1 ;
  mxArray * _out;
  char *result = 0 ;
  
  if (!SWIG_check_num_args("helicsInputGetPublicationType",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsInputGetPublicationType" "', argument " "1"" of type '" "helics_input""'"); 
  }
  result = (char *)helicsInputGetPublicationType(arg1);
  _out = SWIG_FromCharPtr((const char *)result);
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsPublicationGetType(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_publication arg1 = (helics_publication) 0 ;
  int res1 ;
  mxArray * _out;
  char *result = 0 ;
  
  if (!SWIG_check_num_args("helicsPublicationGetType",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsPublicationGetType" "', argument " "1"" of type '" "helics_publication""'"); 
  }
  result = (char *)helicsPublicationGetType(arg1);
  _out = SWIG_FromCharPtr((const char *)result);
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsInputGetKey(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_input arg1 = (helics_input) 0 ;
  int res1 ;
  mxArray * _out;
  char *result = 0 ;
  
  if (!SWIG_check_num_args("helicsInputGetKey",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsInputGetKey" "', argument " "1"" of type '" "helics_input""'"); 
  }
  result = (char *)helicsInputGetKey(arg1);
  _out = SWIG_FromCharPtr((const char *)result);
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsSubscriptionGetKey(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_input arg1 = (helics_input) 0 ;
  int res1 ;
  mxArray * _out;
  char *result = 0 ;
  
  if (!SWIG_check_num_args("helicsSubscriptionGetKey",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsSubscriptionGetKey" "', argument " "1"" of type '" "helics_input""'"); 
  }
  result = (char *)helicsSubscriptionGetKey(arg1);
  _out = SWIG_FromCharPtr((const char *)result);
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsPublicationGetKey(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_publication arg1 = (helics_publication) 0 ;
  int res1 ;
  mxArray * _out;
  char *result = 0 ;
  
  if (!SWIG_check_num_args("helicsPublicationGetKey",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsPublicationGetKey" "', argument " "1"" of type '" "helics_publication""'"); 
  }
  result = (char *)helicsPublicationGetKey(arg1);
  _out = SWIG_FromCharPtr((const char *)result);
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsInputGetUnits(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_input arg1 = (helics_input) 0 ;
  int res1 ;
  mxArray * _out;
  char *result = 0 ;
  
  if (!SWIG_check_num_args("helicsInputGetUnits",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsInputGetUnits" "', argument " "1"" of type '" "helics_input""'"); 
  }
  result = (char *)helicsInputGetUnits(arg1);
  _out = SWIG_FromCharPtr((const char *)result);
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsInputGetInjectionUnits(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_input arg1 = (helics_input) 0 ;
  int res1 ;
  mxArray * _out;
  char *result = 0 ;
  
  if (!SWIG_check_num_args("helicsInputGetInjectionUnits",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsInputGetInjectionUnits" "', argument " "1"" of type '" "helics_input""'"); 
  }
  result = (char *)helicsInputGetInjectionUnits(arg1);
  _out = SWIG_FromCharPtr((const char *)result);
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsInputGetExtractionUnits(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_input arg1 = (helics_input) 0 ;
  int res1 ;
  mxArray * _out;
  char *result = 0 ;
  
  if (!SWIG_check_num_args("helicsInputGetExtractionUnits",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsInputGetExtractionUnits" "', argument " "1"" of type '" "helics_input""'"); 
  }
  result = (char *)helicsInputGetExtractionUnits(arg1);
  _out = SWIG_FromCharPtr((const char *)result);
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsPublicationGetUnits(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_publication arg1 = (helics_publication) 0 ;
  int res1 ;
  mxArray * _out;
  char *result = 0 ;
  
  if (!SWIG_check_num_args("helicsPublicationGetUnits",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsPublicationGetUnits" "', argument " "1"" of type '" "helics_publication""'"); 
  }
  result = (char *)helicsPublicationGetUnits(arg1);
  _out = SWIG_FromCharPtr((const char *)result);
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsInputGetInfo(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_input arg1 = (helics_input) 0 ;
  int res1 ;
  mxArray * _out;
  char *result = 0 ;
  
  if (!SWIG_check_num_args("helicsInputGetInfo",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsInputGetInfo" "', argument " "1"" of type '" "helics_input""'"); 
  }
  result = (char *)helicsInputGetInfo(arg1);
  _out = SWIG_FromCharPtr((const char *)result);
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsInputSetInfo(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_input arg1 = (helics_input) 0 ;
  char *arg2 = (char *) 0 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsInputSetInfo",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsInputSetInfo" "', argument " "1"" of type '" "helics_input""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsInputSetInfo" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  helicsInputSetInfo(arg1,(char const *)arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsPublicationGetInfo(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_publication arg1 = (helics_publication) 0 ;
  int res1 ;
  mxArray * _out;
  char *result = 0 ;
  
  if (!SWIG_check_num_args("helicsPublicationGetInfo",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsPublicationGetInfo" "', argument " "1"" of type '" "helics_publication""'"); 
  }
  result = (char *)helicsPublicationGetInfo(arg1);
  _out = SWIG_FromCharPtr((const char *)result);
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsPublicationSetInfo(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_publication arg1 = (helics_publication) 0 ;
  char *arg2 = (char *) 0 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsPublicationSetInfo",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsPublicationSetInfo" "', argument " "1"" of type '" "helics_publication""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsPublicationSetInfo" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  helicsPublicationSetInfo(arg1,(char const *)arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsInputGetOption(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_input arg1 = (helics_input) 0 ;
  int arg2 ;
  int res1 ;
  int val2 ;
  int ecode2 = 0 ;
  mxArray * _out;
  int result;
  
  if (!SWIG_check_num_args("helicsInputGetOption",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsInputGetOption" "', argument " "1"" of type '" "helics_input""'"); 
  }
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "helicsInputGetOption" "', argument " "2"" of type '" "int""'");
  } 
  arg2 = static_cast< int >(val2);
  result = (int)helicsInputGetOption(arg1,arg2);
  _out = SWIG_From_int(static_cast< int >(result));
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsInputSetOption(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_input arg1 = (helics_input) 0 ;
  int arg2 ;
  int arg3 ;
  helics_error *arg4 = (helics_error *) 0 ;
  int res1 ;
  int val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  helics_error etemp4 ;
  mxArray * _out;
  
  {
    etemp4=helicsErrorInitialize();
    arg4=&etemp4;
  }
  if (!SWIG_check_num_args("helicsInputSetOption",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsInputSetOption" "', argument " "1"" of type '" "helics_input""'"); 
  }
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "helicsInputSetOption" "', argument " "2"" of type '" "int""'");
  } 
  arg2 = static_cast< int >(val2);
  ecode3 = SWIG_AsVal_int(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "helicsInputSetOption" "', argument " "3"" of type '" "int""'");
  } 
  arg3 = static_cast< int >(val3);
  helicsInputSetOption(arg1,arg2,arg3,arg4);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 0;
fail:
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 1;
}


int _wrap_helicsPublicationGetOption(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_publication arg1 = (helics_publication) 0 ;
  int arg2 ;
  int res1 ;
  int val2 ;
  int ecode2 = 0 ;
  mxArray * _out;
  int result;
  
  if (!SWIG_check_num_args("helicsPublicationGetOption",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsPublicationGetOption" "', argument " "1"" of type '" "helics_publication""'"); 
  }
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "helicsPublicationGetOption" "', argument " "2"" of type '" "int""'");
  } 
  arg2 = static_cast< int >(val2);
  result = (int)helicsPublicationGetOption(arg1,arg2);
  _out = SWIG_From_int(static_cast< int >(result));
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsPublicationSetOption(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_publication arg1 = (helics_publication) 0 ;
  int arg2 ;
  int arg3 ;
  helics_error *arg4 = (helics_error *) 0 ;
  int res1 ;
  int val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  helics_error etemp4 ;
  mxArray * _out;
  
  {
    etemp4=helicsErrorInitialize();
    arg4=&etemp4;
  }
  if (!SWIG_check_num_args("helicsPublicationSetOption",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsPublicationSetOption" "', argument " "1"" of type '" "helics_publication""'"); 
  }
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "helicsPublicationSetOption" "', argument " "2"" of type '" "int""'");
  } 
  arg2 = static_cast< int >(val2);
  ecode3 = SWIG_AsVal_int(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "helicsPublicationSetOption" "', argument " "3"" of type '" "int""'");
  } 
  arg3 = static_cast< int >(val3);
  helicsPublicationSetOption(arg1,arg2,arg3,arg4);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 0;
fail:
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 1;
}


int _wrap_helicsPublicationSetMinimumChange(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_publication arg1 = (helics_publication) 0 ;
  double arg2 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  double val2 ;
  int ecode2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsPublicationSetMinimumChange",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsPublicationSetMinimumChange" "', argument " "1"" of type '" "helics_publication""'"); 
  }
  ecode2 = SWIG_AsVal_double(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "helicsPublicationSetMinimumChange" "', argument " "2"" of type '" "double""'");
  } 
  arg2 = static_cast< double >(val2);
  helicsPublicationSetMinimumChange(arg1,arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsInputSetMinimumChange(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_input arg1 = (helics_input) 0 ;
  double arg2 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  double val2 ;
  int ecode2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsInputSetMinimumChange",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsInputSetMinimumChange" "', argument " "1"" of type '" "helics_input""'"); 
  }
  ecode2 = SWIG_AsVal_double(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "helicsInputSetMinimumChange" "', argument " "2"" of type '" "double""'");
  } 
  arg2 = static_cast< double >(val2);
  helicsInputSetMinimumChange(arg1,arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsInputIsUpdated(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_input arg1 = (helics_input) 0 ;
  int res1 ;
  mxArray * _out;
  helics_bool result;
  
  if (!SWIG_check_num_args("helicsInputIsUpdated",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsInputIsUpdated" "', argument " "1"" of type '" "helics_input""'"); 
  }
  result = (helics_bool)helicsInputIsUpdated(arg1);
  _out = SWIG_From_int(static_cast< int >(result));
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsInputLastUpdateTime(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_input arg1 = (helics_input) 0 ;
  int res1 ;
  mxArray * _out;
  helics_time result;
  
  if (!SWIG_check_num_args("helicsInputLastUpdateTime",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsInputLastUpdateTime" "', argument " "1"" of type '" "helics_input""'"); 
  }
  result = (helics_time)helicsInputLastUpdateTime(arg1);
  _out = SWIG_From_double(static_cast< double >(result));
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsInputClearUpdate(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_input arg1 = (helics_input) 0 ;
  int res1 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("helicsInputClearUpdate",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsInputClearUpdate" "', argument " "1"" of type '" "helics_input""'"); 
  }
  helicsInputClearUpdate(arg1);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsFederateGetPublicationCount(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  int res1 ;
  mxArray * _out;
  int result;
  
  if (!SWIG_check_num_args("helicsFederateGetPublicationCount",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateGetPublicationCount" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  result = (int)helicsFederateGetPublicationCount(arg1);
  _out = SWIG_From_int(static_cast< int >(result));
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsFederateGetInputCount(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  int res1 ;
  mxArray * _out;
  int result;
  
  if (!SWIG_check_num_args("helicsFederateGetInputCount",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateGetInputCount" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  result = (int)helicsFederateGetInputCount(arg1);
  _out = SWIG_From_int(static_cast< int >(result));
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsFederateRegisterEndpoint(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  char *arg2 = (char *) 0 ;
  char *arg3 = (char *) 0 ;
  helics_error *arg4 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  int res3 ;
  char *buf3 = 0 ;
  int alloc3 = 0 ;
  helics_error etemp4 ;
  mxArray * _out;
  helics_endpoint result;
  
  {
    etemp4=helicsErrorInitialize();
    arg4=&etemp4;
  }
  if (!SWIG_check_num_args("helicsFederateRegisterEndpoint",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateRegisterEndpoint" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsFederateRegisterEndpoint" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "helicsFederateRegisterEndpoint" "', argument " "3"" of type '" "char const *""'");
  }
  arg3 = reinterpret_cast< char * >(buf3);
  result = (helics_endpoint)helicsFederateRegisterEndpoint(arg1,(char const *)arg2,(char const *)arg3,arg4);
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 1;
}


int _wrap_helicsFederateRegisterGlobalEndpoint(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  char *arg2 = (char *) 0 ;
  char *arg3 = (char *) 0 ;
  helics_error *arg4 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  int res3 ;
  char *buf3 = 0 ;
  int alloc3 = 0 ;
  helics_error etemp4 ;
  mxArray * _out;
  helics_endpoint result;
  
  {
    etemp4=helicsErrorInitialize();
    arg4=&etemp4;
  }
  if (!SWIG_check_num_args("helicsFederateRegisterGlobalEndpoint",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateRegisterGlobalEndpoint" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsFederateRegisterGlobalEndpoint" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "helicsFederateRegisterGlobalEndpoint" "', argument " "3"" of type '" "char const *""'");
  }
  arg3 = reinterpret_cast< char * >(buf3);
  result = (helics_endpoint)helicsFederateRegisterGlobalEndpoint(arg1,(char const *)arg2,(char const *)arg3,arg4);
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 1;
}


int _wrap_helicsFederateGetEndpoint(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  char *arg2 = (char *) 0 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  helics_endpoint result;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsFederateGetEndpoint",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateGetEndpoint" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsFederateGetEndpoint" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  result = (helics_endpoint)helicsFederateGetEndpoint(arg1,(char const *)arg2,arg3);
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsFederateGetEndpointByIndex(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  int arg2 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int val2 ;
  int ecode2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  helics_endpoint result;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsFederateGetEndpointByIndex",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateGetEndpointByIndex" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "helicsFederateGetEndpointByIndex" "', argument " "2"" of type '" "int""'");
  } 
  arg2 = static_cast< int >(val2);
  result = (helics_endpoint)helicsFederateGetEndpointByIndex(arg1,arg2,arg3);
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
  if (_out) --resc, *resv++ = _out;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsEndpointIsValid(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_endpoint arg1 = (helics_endpoint) 0 ;
  int res1 ;
  mxArray * _out;
  helics_bool result;
  
  if (!SWIG_check_num_args("helicsEndpointIsValid",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsEndpointIsValid" "', argument " "1"" of type '" "helics_endpoint""'"); 
  }
  result = (helics_bool)helicsEndpointIsValid(arg1);
  _out = SWIG_From_int(static_cast< int >(result));
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsEndpointSetDefaultDestination(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_endpoint arg1 = (helics_endpoint) 0 ;
  char *arg2 = (char *) 0 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsEndpointSetDefaultDestination",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsEndpointSetDefaultDestination" "', argument " "1"" of type '" "helics_endpoint""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsEndpointSetDefaultDestination" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  helicsEndpointSetDefaultDestination(arg1,(char const *)arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsEndpointGetDefaultDestination(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_endpoint arg1 = (helics_endpoint) 0 ;
  int res1 ;
  mxArray * _out;
  char *result = 0 ;
  
  if (!SWIG_check_num_args("helicsEndpointGetDefaultDestination",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsEndpointGetDefaultDestination" "', argument " "1"" of type '" "helics_endpoint""'"); 
  }
  result = (char *)helicsEndpointGetDefaultDestination(arg1);
  _out = SWIG_FromCharPtr((const char *)result);
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsEndpointSendMessageRaw(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_endpoint arg1 = (helics_endpoint) 0 ;
  char *arg2 = (char *) 0 ;
  void *arg3 = (void *) 0 ;
  int arg4 ;
  helics_error *arg5 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  int res3 ;
  char *buf3 = 0 ;
  size_t size3 = 0 ;
  int alloc3 = 0 ;
  helics_error etemp5 ;
  mxArray * _out;
  
  {
    etemp5=helicsErrorInitialize();
    arg5=&etemp5;
  }
  if (!SWIG_check_num_args("helicsEndpointSendMessageRaw",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsEndpointSendMessageRaw" "', argument " "1"" of type '" "helics_endpoint""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsEndpointSendMessageRaw" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, &size3, &alloc3);
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "helicsEndpointSendMessageRaw" "', argument " "3"" of type '" "void const *""'");
  }  
  arg3 = reinterpret_cast< void * >(buf3);
  arg4 = static_cast< int >(size3 - 1);
  helicsEndpointSendMessageRaw(arg1,(char const *)arg2,(void const *)arg3,arg4,arg5);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  {
    if (arg5->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg5);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  {
    if (arg5->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg5);
    }
  }
  return 1;
}


int _wrap_helicsEndpointSendEventRaw(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_endpoint arg1 = (helics_endpoint) 0 ;
  char *arg2 = (char *) 0 ;
  void *arg3 = (void *) 0 ;
  int arg4 ;
  helics_time arg5 ;
  helics_error *arg6 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  int res3 ;
  char *buf3 = 0 ;
  size_t size3 = 0 ;
  int alloc3 = 0 ;
  double val5 ;
  int ecode5 = 0 ;
  helics_error etemp6 ;
  mxArray * _out;
  
  {
    etemp6=helicsErrorInitialize();
    arg6=&etemp6;
  }
  if (!SWIG_check_num_args("helicsEndpointSendEventRaw",argc,4,4,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsEndpointSendEventRaw" "', argument " "1"" of type '" "helics_endpoint""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsEndpointSendEventRaw" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, &size3, &alloc3);
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "helicsEndpointSendEventRaw" "', argument " "3"" of type '" "void const *""'");
  }  
  arg3 = reinterpret_cast< void * >(buf3);
  arg4 = static_cast< int >(size3 - 1);
  ecode5 = SWIG_AsVal_double(argv[3], &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "helicsEndpointSendEventRaw" "', argument " "5"" of type '" "helics_time""'");
  } 
  arg5 = static_cast< helics_time >(val5);
  helicsEndpointSendEventRaw(arg1,(char const *)arg2,(void const *)arg3,arg4,arg5,arg6);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  {
    if (arg6->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg6);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  {
    if (arg6->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg6);
    }
  }
  return 1;
}


int _wrap_helicsEndpointSendMessage(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_endpoint arg1 = (helics_endpoint) 0 ;
  helics_message *arg2 = (helics_message *) 0 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsEndpointSendMessage",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsEndpointSendMessage" "', argument " "1"" of type '" "helics_endpoint""'"); 
  }
  res2 = SWIG_ConvertPtr(argv[1], &argp2,SWIGTYPE_p_helics_message, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsEndpointSendMessage" "', argument " "2"" of type '" "helics_message *""'"); 
  }
  arg2 = reinterpret_cast< helics_message * >(argp2);
  helicsEndpointSendMessage(arg1,arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsEndpointSendMessageObject(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_endpoint arg1 = (helics_endpoint) 0 ;
  helics_message_object arg2 = (helics_message_object) 0 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsEndpointSendMessageObject",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsEndpointSendMessageObject" "', argument " "1"" of type '" "helics_endpoint""'"); 
  }
  res2 = SWIG_ConvertPtr(argv[1],SWIG_as_voidptrptr(&arg2), 0, 0);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsEndpointSendMessageObject" "', argument " "2"" of type '" "helics_message_object""'"); 
  }
  helicsEndpointSendMessageObject(arg1,arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsEndpointSendMessageObjectZeroCopy(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_endpoint arg1 = (helics_endpoint) 0 ;
  helics_message_object arg2 = (helics_message_object) 0 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsEndpointSendMessageObjectZeroCopy",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsEndpointSendMessageObjectZeroCopy" "', argument " "1"" of type '" "helics_endpoint""'"); 
  }
  res2 = SWIG_ConvertPtr(argv[1],SWIG_as_voidptrptr(&arg2), 0, 0);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsEndpointSendMessageObjectZeroCopy" "', argument " "2"" of type '" "helics_message_object""'"); 
  }
  helicsEndpointSendMessageObjectZeroCopy(arg1,arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsEndpointSubscribe(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_endpoint arg1 = (helics_endpoint) 0 ;
  char *arg2 = (char *) 0 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsEndpointSubscribe",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsEndpointSubscribe" "', argument " "1"" of type '" "helics_endpoint""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsEndpointSubscribe" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  helicsEndpointSubscribe(arg1,(char const *)arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsFederateHasMessage(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  int res1 ;
  mxArray * _out;
  helics_bool result;
  
  if (!SWIG_check_num_args("helicsFederateHasMessage",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateHasMessage" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  result = (helics_bool)helicsFederateHasMessage(arg1);
  _out = SWIG_From_int(static_cast< int >(result));
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsEndpointHasMessage(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_endpoint arg1 = (helics_endpoint) 0 ;
  int res1 ;
  mxArray * _out;
  helics_bool result;
  
  if (!SWIG_check_num_args("helicsEndpointHasMessage",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsEndpointHasMessage" "', argument " "1"" of type '" "helics_endpoint""'"); 
  }
  result = (helics_bool)helicsEndpointHasMessage(arg1);
  _out = SWIG_From_int(static_cast< int >(result));
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsFederatePendingMessages(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  int res1 ;
  mxArray * _out;
  int result;
  
  if (!SWIG_check_num_args("helicsFederatePendingMessages",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederatePendingMessages" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  result = (int)helicsFederatePendingMessages(arg1);
  _out = SWIG_From_int(static_cast< int >(result));
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsEndpointPendingMessages(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_endpoint arg1 = (helics_endpoint) 0 ;
  int res1 ;
  mxArray * _out;
  int result;
  
  if (!SWIG_check_num_args("helicsEndpointPendingMessages",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsEndpointPendingMessages" "', argument " "1"" of type '" "helics_endpoint""'"); 
  }
  result = (int)helicsEndpointPendingMessages(arg1);
  _out = SWIG_From_int(static_cast< int >(result));
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsEndpointGetMessage(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_endpoint arg1 = (helics_endpoint) 0 ;
  int res1 ;
  mxArray * _out;
  helics_message result;
  
  if (!SWIG_check_num_args("helicsEndpointGetMessage",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsEndpointGetMessage" "', argument " "1"" of type '" "helics_endpoint""'"); 
  }
  result = helicsEndpointGetMessage(arg1);
  _out = SWIG_NewPointerObj((new helics_message(static_cast< const helics_message& >(result))), SWIGTYPE_p_helics_message, SWIG_POINTER_OWN |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsEndpointGetMessageObject(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_endpoint arg1 = (helics_endpoint) 0 ;
  int res1 ;
  mxArray * _out;
  helics_message_object result;
  
  if (!SWIG_check_num_args("helicsEndpointGetMessageObject",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsEndpointGetMessageObject" "', argument " "1"" of type '" "helics_endpoint""'"); 
  }
  result = (helics_message_object)helicsEndpointGetMessageObject(arg1);
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsEndpointCreateMessageObject(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_endpoint arg1 = (helics_endpoint) 0 ;
  helics_error *arg2 = (helics_error *) 0 ;
  int res1 ;
  helics_error etemp2 ;
  mxArray * _out;
  helics_message_object result;
  
  {
    etemp2=helicsErrorInitialize();
    arg2=&etemp2;
  }
  if (!SWIG_check_num_args("helicsEndpointCreateMessageObject",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsEndpointCreateMessageObject" "', argument " "1"" of type '" "helics_endpoint""'"); 
  }
  result = (helics_message_object)helicsEndpointCreateMessageObject(arg1,arg2);
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
  if (_out) --resc, *resv++ = _out;
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 0;
fail:
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 1;
}


int _wrap_helicsFederateGetMessage(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  int res1 ;
  mxArray * _out;
  helics_message result;
  
  if (!SWIG_check_num_args("helicsFederateGetMessage",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateGetMessage" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  result = helicsFederateGetMessage(arg1);
  _out = SWIG_NewPointerObj((new helics_message(static_cast< const helics_message& >(result))), SWIGTYPE_p_helics_message, SWIG_POINTER_OWN |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsFederateGetMessageObject(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  int res1 ;
  mxArray * _out;
  helics_message_object result;
  
  if (!SWIG_check_num_args("helicsFederateGetMessageObject",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateGetMessageObject" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  result = (helics_message_object)helicsFederateGetMessageObject(arg1);
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsFederateCreateMessageObject(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  helics_error *arg2 = (helics_error *) 0 ;
  int res1 ;
  helics_error etemp2 ;
  mxArray * _out;
  helics_message_object result;
  
  {
    etemp2=helicsErrorInitialize();
    arg2=&etemp2;
  }
  if (!SWIG_check_num_args("helicsFederateCreateMessageObject",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateCreateMessageObject" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  result = (helics_message_object)helicsFederateCreateMessageObject(arg1,arg2);
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
  if (_out) --resc, *resv++ = _out;
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 0;
fail:
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 1;
}


int _wrap_helicsFederateClearMessages(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  int res1 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("helicsFederateClearMessages",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateClearMessages" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  helicsFederateClearMessages(arg1);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsEndpointClearMessages(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_endpoint arg1 = (helics_endpoint) 0 ;
  int res1 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("helicsEndpointClearMessages",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsEndpointClearMessages" "', argument " "1"" of type '" "helics_endpoint""'"); 
  }
  helicsEndpointClearMessages(arg1);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsEndpointGetType(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_endpoint arg1 = (helics_endpoint) 0 ;
  int res1 ;
  mxArray * _out;
  char *result = 0 ;
  
  if (!SWIG_check_num_args("helicsEndpointGetType",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsEndpointGetType" "', argument " "1"" of type '" "helics_endpoint""'"); 
  }
  result = (char *)helicsEndpointGetType(arg1);
  _out = SWIG_FromCharPtr((const char *)result);
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsEndpointGetName(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_endpoint arg1 = (helics_endpoint) 0 ;
  int res1 ;
  mxArray * _out;
  char *result = 0 ;
  
  if (!SWIG_check_num_args("helicsEndpointGetName",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsEndpointGetName" "', argument " "1"" of type '" "helics_endpoint""'"); 
  }
  result = (char *)helicsEndpointGetName(arg1);
  _out = SWIG_FromCharPtr((const char *)result);
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsFederateGetEndpointCount(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  int res1 ;
  mxArray * _out;
  int result;
  
  if (!SWIG_check_num_args("helicsFederateGetEndpointCount",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateGetEndpointCount" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  result = (int)helicsFederateGetEndpointCount(arg1);
  _out = SWIG_From_int(static_cast< int >(result));
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsEndpointGetInfo(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_endpoint arg1 = (helics_endpoint) 0 ;
  int res1 ;
  mxArray * _out;
  char *result = 0 ;
  
  if (!SWIG_check_num_args("helicsEndpointGetInfo",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsEndpointGetInfo" "', argument " "1"" of type '" "helics_endpoint""'"); 
  }
  result = (char *)helicsEndpointGetInfo(arg1);
  _out = SWIG_FromCharPtr((const char *)result);
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsEndpointSetInfo(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_endpoint arg1 = (helics_endpoint) 0 ;
  char *arg2 = (char *) 0 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsEndpointSetInfo",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsEndpointSetInfo" "', argument " "1"" of type '" "helics_endpoint""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsEndpointSetInfo" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  helicsEndpointSetInfo(arg1,(char const *)arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsEndpointSetOption(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_endpoint arg1 = (helics_endpoint) 0 ;
  int arg2 ;
  int arg3 ;
  helics_error *arg4 = (helics_error *) 0 ;
  int res1 ;
  int val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  helics_error etemp4 ;
  mxArray * _out;
  
  {
    etemp4=helicsErrorInitialize();
    arg4=&etemp4;
  }
  if (!SWIG_check_num_args("helicsEndpointSetOption",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsEndpointSetOption" "', argument " "1"" of type '" "helics_endpoint""'"); 
  }
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "helicsEndpointSetOption" "', argument " "2"" of type '" "int""'");
  } 
  arg2 = static_cast< int >(val2);
  ecode3 = SWIG_AsVal_int(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "helicsEndpointSetOption" "', argument " "3"" of type '" "int""'");
  } 
  arg3 = static_cast< int >(val3);
  helicsEndpointSetOption(arg1,arg2,arg3,arg4);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 0;
fail:
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 1;
}


int _wrap_helicsEndpointGetOption(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_endpoint arg1 = (helics_endpoint) 0 ;
  int arg2 ;
  int res1 ;
  int val2 ;
  int ecode2 = 0 ;
  mxArray * _out;
  int result;
  
  if (!SWIG_check_num_args("helicsEndpointGetOption",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsEndpointGetOption" "', argument " "1"" of type '" "helics_endpoint""'"); 
  }
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "helicsEndpointGetOption" "', argument " "2"" of type '" "int""'");
  } 
  arg2 = static_cast< int >(val2);
  result = (int)helicsEndpointGetOption(arg1,arg2);
  _out = SWIG_From_int(static_cast< int >(result));
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsMessageGetSource(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_message_object arg1 = (helics_message_object) 0 ;
  int res1 ;
  mxArray * _out;
  char *result = 0 ;
  
  if (!SWIG_check_num_args("helicsMessageGetSource",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsMessageGetSource" "', argument " "1"" of type '" "helics_message_object""'"); 
  }
  result = (char *)helicsMessageGetSource(arg1);
  _out = SWIG_FromCharPtr((const char *)result);
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsMessageGetDestination(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_message_object arg1 = (helics_message_object) 0 ;
  int res1 ;
  mxArray * _out;
  char *result = 0 ;
  
  if (!SWIG_check_num_args("helicsMessageGetDestination",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsMessageGetDestination" "', argument " "1"" of type '" "helics_message_object""'"); 
  }
  result = (char *)helicsMessageGetDestination(arg1);
  _out = SWIG_FromCharPtr((const char *)result);
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsMessageGetOriginalSource(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_message_object arg1 = (helics_message_object) 0 ;
  int res1 ;
  mxArray * _out;
  char *result = 0 ;
  
  if (!SWIG_check_num_args("helicsMessageGetOriginalSource",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsMessageGetOriginalSource" "', argument " "1"" of type '" "helics_message_object""'"); 
  }
  result = (char *)helicsMessageGetOriginalSource(arg1);
  _out = SWIG_FromCharPtr((const char *)result);
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsMessageGetOriginalDestination(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_message_object arg1 = (helics_message_object) 0 ;
  int res1 ;
  mxArray * _out;
  char *result = 0 ;
  
  if (!SWIG_check_num_args("helicsMessageGetOriginalDestination",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsMessageGetOriginalDestination" "', argument " "1"" of type '" "helics_message_object""'"); 
  }
  result = (char *)helicsMessageGetOriginalDestination(arg1);
  _out = SWIG_FromCharPtr((const char *)result);
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsMessageGetTime(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_message_object arg1 = (helics_message_object) 0 ;
  int res1 ;
  mxArray * _out;
  helics_time result;
  
  if (!SWIG_check_num_args("helicsMessageGetTime",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsMessageGetTime" "', argument " "1"" of type '" "helics_message_object""'"); 
  }
  result = (helics_time)helicsMessageGetTime(arg1);
  _out = SWIG_From_double(static_cast< double >(result));
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsMessageGetString(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_message_object arg1 = (helics_message_object) 0 ;
  int res1 ;
  mxArray * _out;
  char *result = 0 ;
  
  if (!SWIG_check_num_args("helicsMessageGetString",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsMessageGetString" "', argument " "1"" of type '" "helics_message_object""'"); 
  }
  result = (char *)helicsMessageGetString(arg1);
  _out = SWIG_FromCharPtr((const char *)result);
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsMessageGetMessageID(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_message_object arg1 = (helics_message_object) 0 ;
  int res1 ;
  mxArray * _out;
  int result;
  
  if (!SWIG_check_num_args("helicsMessageGetMessageID",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsMessageGetMessageID" "', argument " "1"" of type '" "helics_message_object""'"); 
  }
  result = (int)helicsMessageGetMessageID(arg1);
  _out = SWIG_From_int(static_cast< int >(result));
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsMessageCheckFlag(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_message_object arg1 = (helics_message_object) 0 ;
  int arg2 ;
  int res1 ;
  int val2 ;
  int ecode2 = 0 ;
  mxArray * _out;
  helics_bool result;
  
  if (!SWIG_check_num_args("helicsMessageCheckFlag",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsMessageCheckFlag" "', argument " "1"" of type '" "helics_message_object""'"); 
  }
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "helicsMessageCheckFlag" "', argument " "2"" of type '" "int""'");
  } 
  arg2 = static_cast< int >(val2);
  result = (helics_bool)helicsMessageCheckFlag(arg1,arg2);
  _out = SWIG_From_int(static_cast< int >(result));
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsMessageGetRawDataSize(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_message_object arg1 = (helics_message_object) 0 ;
  int res1 ;
  mxArray * _out;
  int result;
  
  if (!SWIG_check_num_args("helicsMessageGetRawDataSize",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsMessageGetRawDataSize" "', argument " "1"" of type '" "helics_message_object""'"); 
  }
  result = (int)helicsMessageGetRawDataSize(arg1);
  _out = SWIG_From_int(static_cast< int >(result));
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsMessageGetRawData(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_message_object arg1 = (helics_message_object) 0 ;
  void *arg2 = (void *) 0 ;
  int arg3 ;
  int *arg4 = (int *) 0 ;
  helics_error *arg5 = (helics_error *) 0 ;
  int res1 ;
  helics_error etemp5 ;
  mxArray * _out;
  
  {
    arg4=&(arg3);
  }
  {
    etemp5=helicsErrorInitialize();
    arg5=&etemp5;
  }
  if (!SWIG_check_num_args("helicsMessageGetRawData",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsMessageGetRawData" "', argument " "1"" of type '" "helics_message_object""'"); 
  }
  {
    arg3=helicsMessageGetRawDataSize(arg1)+2;
    arg2 =  malloc(arg3);
  }
  helicsMessageGetRawData(arg1,arg2,arg3,arg4,arg5);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  {
    if (--resc>=0) *resv++ = SWIG_FromCharPtrAndSize((char*)arg2,*arg4);
  }
  {
    if (arg2) free(arg2);
  }
  {
    if (arg5->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg5);
    }
  }
  return 0;
fail:
  {
    if (arg2) free(arg2);
  }
  {
    if (arg5->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg5);
    }
  }
  return 1;
}


int _wrap_helicsMessageIsValid(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_message_object arg1 = (helics_message_object) 0 ;
  int res1 ;
  mxArray * _out;
  helics_bool result;
  
  if (!SWIG_check_num_args("helicsMessageIsValid",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsMessageIsValid" "', argument " "1"" of type '" "helics_message_object""'"); 
  }
  result = (helics_bool)helicsMessageIsValid(arg1);
  _out = SWIG_From_int(static_cast< int >(result));
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsMessageSetSource(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_message_object arg1 = (helics_message_object) 0 ;
  char *arg2 = (char *) 0 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsMessageSetSource",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsMessageSetSource" "', argument " "1"" of type '" "helics_message_object""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsMessageSetSource" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  helicsMessageSetSource(arg1,(char const *)arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsMessageSetDestination(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_message_object arg1 = (helics_message_object) 0 ;
  char *arg2 = (char *) 0 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsMessageSetDestination",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsMessageSetDestination" "', argument " "1"" of type '" "helics_message_object""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsMessageSetDestination" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  helicsMessageSetDestination(arg1,(char const *)arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsMessageSetOriginalSource(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_message_object arg1 = (helics_message_object) 0 ;
  char *arg2 = (char *) 0 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsMessageSetOriginalSource",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsMessageSetOriginalSource" "', argument " "1"" of type '" "helics_message_object""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsMessageSetOriginalSource" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  helicsMessageSetOriginalSource(arg1,(char const *)arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsMessageSetOriginalDestination(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_message_object arg1 = (helics_message_object) 0 ;
  char *arg2 = (char *) 0 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsMessageSetOriginalDestination",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsMessageSetOriginalDestination" "', argument " "1"" of type '" "helics_message_object""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsMessageSetOriginalDestination" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  helicsMessageSetOriginalDestination(arg1,(char const *)arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsMessageSetTime(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_message_object arg1 = (helics_message_object) 0 ;
  helics_time arg2 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  double val2 ;
  int ecode2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsMessageSetTime",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsMessageSetTime" "', argument " "1"" of type '" "helics_message_object""'"); 
  }
  ecode2 = SWIG_AsVal_double(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "helicsMessageSetTime" "', argument " "2"" of type '" "helics_time""'");
  } 
  arg2 = static_cast< helics_time >(val2);
  helicsMessageSetTime(arg1,arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsMessageReserve(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_message_object arg1 = (helics_message_object) 0 ;
  int arg2 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int val2 ;
  int ecode2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsMessageReserve",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsMessageReserve" "', argument " "1"" of type '" "helics_message_object""'"); 
  }
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "helicsMessageReserve" "', argument " "2"" of type '" "int""'");
  } 
  arg2 = static_cast< int >(val2);
  helicsMessageReserve(arg1,arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsMessageSetMessageID(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_message_object arg1 = (helics_message_object) 0 ;
  int32_t arg2 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  void *argp2 ;
  int res2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsMessageSetMessageID",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsMessageSetMessageID" "', argument " "1"" of type '" "helics_message_object""'"); 
  }
  {
    res2 = SWIG_ConvertPtr(argv[1], &argp2, SWIGTYPE_p_int32_t,  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsMessageSetMessageID" "', argument " "2"" of type '" "int32_t""'"); 
    }  
    if (!argp2) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "helicsMessageSetMessageID" "', argument " "2"" of type '" "int32_t""'");
    } else {
      arg2 = *(reinterpret_cast< int32_t * >(argp2));
    }
  }
  helicsMessageSetMessageID(arg1,arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsMessageClearFlags(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_message_object arg1 = (helics_message_object) 0 ;
  int res1 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("helicsMessageClearFlags",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsMessageClearFlags" "', argument " "1"" of type '" "helics_message_object""'"); 
  }
  helicsMessageClearFlags(arg1);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsMessageSetFlagOption(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_message_object arg1 = (helics_message_object) 0 ;
  int arg2 ;
  helics_bool arg3 ;
  helics_error *arg4 = (helics_error *) 0 ;
  int res1 ;
  int val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  helics_error etemp4 ;
  mxArray * _out;
  
  {
    etemp4=helicsErrorInitialize();
    arg4=&etemp4;
  }
  if (!SWIG_check_num_args("helicsMessageSetFlagOption",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsMessageSetFlagOption" "', argument " "1"" of type '" "helics_message_object""'"); 
  }
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "helicsMessageSetFlagOption" "', argument " "2"" of type '" "int""'");
  } 
  arg2 = static_cast< int >(val2);
  ecode3 = SWIG_AsVal_int(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "helicsMessageSetFlagOption" "', argument " "3"" of type '" "helics_bool""'");
  } 
  arg3 = static_cast< helics_bool >(val3);
  helicsMessageSetFlagOption(arg1,arg2,arg3,arg4);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 0;
fail:
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 1;
}


int _wrap_helicsMessageSetString(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_message_object arg1 = (helics_message_object) 0 ;
  char *arg2 = (char *) 0 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsMessageSetString",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsMessageSetString" "', argument " "1"" of type '" "helics_message_object""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsMessageSetString" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  helicsMessageSetString(arg1,(char const *)arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsMessageSetData(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_message_object arg1 = (helics_message_object) 0 ;
  void *arg2 = (void *) 0 ;
  int arg3 ;
  helics_error *arg4 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  size_t size2 = 0 ;
  int alloc2 = 0 ;
  helics_error etemp4 ;
  mxArray * _out;
  
  {
    etemp4=helicsErrorInitialize();
    arg4=&etemp4;
  }
  if (!SWIG_check_num_args("helicsMessageSetData",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsMessageSetData" "', argument " "1"" of type '" "helics_message_object""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, &size2, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsMessageSetData" "', argument " "2"" of type '" "void const *""'");
  }  
  arg2 = reinterpret_cast< void * >(buf2);
  arg3 = static_cast< int >(size2 - 1);
  helicsMessageSetData(arg1,(void const *)arg2,arg3,arg4);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 1;
}


int _wrap_helicsMessageAppendData(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_message_object arg1 = (helics_message_object) 0 ;
  void *arg2 = (void *) 0 ;
  int arg3 ;
  helics_error *arg4 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  size_t size2 = 0 ;
  int alloc2 = 0 ;
  helics_error etemp4 ;
  mxArray * _out;
  
  {
    etemp4=helicsErrorInitialize();
    arg4=&etemp4;
  }
  if (!SWIG_check_num_args("helicsMessageAppendData",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsMessageAppendData" "', argument " "1"" of type '" "helics_message_object""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, &size2, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsMessageAppendData" "', argument " "2"" of type '" "void const *""'");
  }  
  arg2 = reinterpret_cast< void * >(buf2);
  arg3 = static_cast< int >(size2 - 1);
  helicsMessageAppendData(arg1,(void const *)arg2,arg3,arg4);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 1;
}


int _wrap_helicsMessageCopy(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_message_object arg1 = (helics_message_object) 0 ;
  helics_message_object arg2 = (helics_message_object) 0 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsMessageCopy",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsMessageCopy" "', argument " "1"" of type '" "helics_message_object""'"); 
  }
  res2 = SWIG_ConvertPtr(argv[1],SWIG_as_voidptrptr(&arg2), 0, 0);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsMessageCopy" "', argument " "2"" of type '" "helics_message_object""'"); 
  }
  helicsMessageCopy(arg1,arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsMessageClone(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_message_object arg1 = (helics_message_object) 0 ;
  helics_error *arg2 = (helics_error *) 0 ;
  int res1 ;
  helics_error etemp2 ;
  mxArray * _out;
  helics_message_object result;
  
  {
    etemp2=helicsErrorInitialize();
    arg2=&etemp2;
  }
  if (!SWIG_check_num_args("helicsMessageClone",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsMessageClone" "', argument " "1"" of type '" "helics_message_object""'"); 
  }
  result = (helics_message_object)helicsMessageClone(arg1,arg2);
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
  if (_out) --resc, *resv++ = _out;
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 0;
fail:
  {
    if (arg2->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg2);
    }
  }
  return 1;
}


int _wrap_helicsMessageFree(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_message_object arg1 = (helics_message_object) 0 ;
  int res1 ;
  mxArray * _out;
  
  if (!SWIG_check_num_args("helicsMessageFree",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsMessageFree" "', argument " "1"" of type '" "helics_message_object""'"); 
  }
  helicsMessageFree(arg1);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsFederateRegisterFilter(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  helics_filter_type arg2 ;
  char *arg3 = (char *) 0 ;
  helics_error *arg4 = (helics_error *) 0 ;
  int res1 ;
  int val2 ;
  int ecode2 = 0 ;
  int res3 ;
  char *buf3 = 0 ;
  int alloc3 = 0 ;
  helics_error etemp4 ;
  mxArray * _out;
  helics_filter result;
  
  {
    etemp4=helicsErrorInitialize();
    arg4=&etemp4;
  }
  if (!SWIG_check_num_args("helicsFederateRegisterFilter",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateRegisterFilter" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "helicsFederateRegisterFilter" "', argument " "2"" of type '" "helics_filter_type""'");
  } 
  arg2 = static_cast< helics_filter_type >(val2);
  res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "helicsFederateRegisterFilter" "', argument " "3"" of type '" "char const *""'");
  }
  arg3 = reinterpret_cast< char * >(buf3);
  result = (helics_filter)helicsFederateRegisterFilter(arg1,arg2,(char const *)arg3,arg4);
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
  if (_out) --resc, *resv++ = _out;
  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 0;
fail:
  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 1;
}


int _wrap_helicsFederateRegisterGlobalFilter(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  helics_filter_type arg2 ;
  char *arg3 = (char *) 0 ;
  helics_error *arg4 = (helics_error *) 0 ;
  int res1 ;
  int val2 ;
  int ecode2 = 0 ;
  int res3 ;
  char *buf3 = 0 ;
  int alloc3 = 0 ;
  helics_error etemp4 ;
  mxArray * _out;
  helics_filter result;
  
  {
    etemp4=helicsErrorInitialize();
    arg4=&etemp4;
  }
  if (!SWIG_check_num_args("helicsFederateRegisterGlobalFilter",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateRegisterGlobalFilter" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "helicsFederateRegisterGlobalFilter" "', argument " "2"" of type '" "helics_filter_type""'");
  } 
  arg2 = static_cast< helics_filter_type >(val2);
  res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "helicsFederateRegisterGlobalFilter" "', argument " "3"" of type '" "char const *""'");
  }
  arg3 = reinterpret_cast< char * >(buf3);
  result = (helics_filter)helicsFederateRegisterGlobalFilter(arg1,arg2,(char const *)arg3,arg4);
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
  if (_out) --resc, *resv++ = _out;
  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 0;
fail:
  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 1;
}


int _wrap_helicsFederateRegisterCloningFilter(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  char *arg2 = (char *) 0 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  helics_filter result;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsFederateRegisterCloningFilter",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateRegisterCloningFilter" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsFederateRegisterCloningFilter" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  result = (helics_filter)helicsFederateRegisterCloningFilter(arg1,(char const *)arg2,arg3);
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsFederateRegisterGlobalCloningFilter(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  char *arg2 = (char *) 0 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  helics_filter result;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsFederateRegisterGlobalCloningFilter",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateRegisterGlobalCloningFilter" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsFederateRegisterGlobalCloningFilter" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  result = (helics_filter)helicsFederateRegisterGlobalCloningFilter(arg1,(char const *)arg2,arg3);
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsCoreRegisterFilter(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_core arg1 = (helics_core) 0 ;
  helics_filter_type arg2 ;
  char *arg3 = (char *) 0 ;
  helics_error *arg4 = (helics_error *) 0 ;
  int res1 ;
  int val2 ;
  int ecode2 = 0 ;
  int res3 ;
  char *buf3 = 0 ;
  int alloc3 = 0 ;
  helics_error etemp4 ;
  mxArray * _out;
  helics_filter result;
  
  {
    etemp4=helicsErrorInitialize();
    arg4=&etemp4;
  }
  if (!SWIG_check_num_args("helicsCoreRegisterFilter",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsCoreRegisterFilter" "', argument " "1"" of type '" "helics_core""'"); 
  }
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "helicsCoreRegisterFilter" "', argument " "2"" of type '" "helics_filter_type""'");
  } 
  arg2 = static_cast< helics_filter_type >(val2);
  res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "helicsCoreRegisterFilter" "', argument " "3"" of type '" "char const *""'");
  }
  arg3 = reinterpret_cast< char * >(buf3);
  result = (helics_filter)helicsCoreRegisterFilter(arg1,arg2,(char const *)arg3,arg4);
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
  if (_out) --resc, *resv++ = _out;
  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 0;
fail:
  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 1;
}


int _wrap_helicsCoreRegisterCloningFilter(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_core arg1 = (helics_core) 0 ;
  char *arg2 = (char *) 0 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  helics_filter result;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsCoreRegisterCloningFilter",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsCoreRegisterCloningFilter" "', argument " "1"" of type '" "helics_core""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsCoreRegisterCloningFilter" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  result = (helics_filter)helicsCoreRegisterCloningFilter(arg1,(char const *)arg2,arg3);
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsFederateGetFilterCount(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  int res1 ;
  mxArray * _out;
  int result;
  
  if (!SWIG_check_num_args("helicsFederateGetFilterCount",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateGetFilterCount" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  result = (int)helicsFederateGetFilterCount(arg1);
  _out = SWIG_From_int(static_cast< int >(result));
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsFederateGetFilter(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  char *arg2 = (char *) 0 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  helics_filter result;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsFederateGetFilter",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateGetFilter" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsFederateGetFilter" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  result = (helics_filter)helicsFederateGetFilter(arg1,(char const *)arg2,arg3);
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsFederateGetFilterByIndex(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_federate arg1 = (helics_federate) 0 ;
  int arg2 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int val2 ;
  int ecode2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  helics_filter result;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsFederateGetFilterByIndex",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFederateGetFilterByIndex" "', argument " "1"" of type '" "helics_federate""'"); 
  }
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "helicsFederateGetFilterByIndex" "', argument " "2"" of type '" "int""'");
  } 
  arg2 = static_cast< int >(val2);
  result = (helics_filter)helicsFederateGetFilterByIndex(arg1,arg2,arg3);
  _out = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
  if (_out) --resc, *resv++ = _out;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsFilterIsValid(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_filter arg1 = (helics_filter) 0 ;
  int res1 ;
  mxArray * _out;
  helics_bool result;
  
  if (!SWIG_check_num_args("helicsFilterIsValid",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFilterIsValid" "', argument " "1"" of type '" "helics_filter""'"); 
  }
  result = (helics_bool)helicsFilterIsValid(arg1);
  _out = SWIG_From_int(static_cast< int >(result));
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsFilterGetName(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_filter arg1 = (helics_filter) 0 ;
  int res1 ;
  mxArray * _out;
  char *result = 0 ;
  
  if (!SWIG_check_num_args("helicsFilterGetName",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFilterGetName" "', argument " "1"" of type '" "helics_filter""'"); 
  }
  result = (char *)helicsFilterGetName(arg1);
  _out = SWIG_FromCharPtr((const char *)result);
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsFilterSet(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_filter arg1 = (helics_filter) 0 ;
  char *arg2 = (char *) 0 ;
  double arg3 ;
  helics_error *arg4 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  double val3 ;
  int ecode3 = 0 ;
  helics_error etemp4 ;
  mxArray * _out;
  
  {
    etemp4=helicsErrorInitialize();
    arg4=&etemp4;
  }
  if (!SWIG_check_num_args("helicsFilterSet",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFilterSet" "', argument " "1"" of type '" "helics_filter""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsFilterSet" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  ecode3 = SWIG_AsVal_double(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "helicsFilterSet" "', argument " "3"" of type '" "double""'");
  } 
  arg3 = static_cast< double >(val3);
  helicsFilterSet(arg1,(char const *)arg2,arg3,arg4);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 1;
}


int _wrap_helicsFilterSetString(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_filter arg1 = (helics_filter) 0 ;
  char *arg2 = (char *) 0 ;
  char *arg3 = (char *) 0 ;
  helics_error *arg4 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  int res3 ;
  char *buf3 = 0 ;
  int alloc3 = 0 ;
  helics_error etemp4 ;
  mxArray * _out;
  
  {
    etemp4=helicsErrorInitialize();
    arg4=&etemp4;
  }
  if (!SWIG_check_num_args("helicsFilterSetString",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFilterSetString" "', argument " "1"" of type '" "helics_filter""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsFilterSetString" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "helicsFilterSetString" "', argument " "3"" of type '" "char const *""'");
  }
  arg3 = reinterpret_cast< char * >(buf3);
  helicsFilterSetString(arg1,(char const *)arg2,(char const *)arg3,arg4);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 1;
}


int _wrap_helicsFilterAddDestinationTarget(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_filter arg1 = (helics_filter) 0 ;
  char *arg2 = (char *) 0 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsFilterAddDestinationTarget",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFilterAddDestinationTarget" "', argument " "1"" of type '" "helics_filter""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsFilterAddDestinationTarget" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  helicsFilterAddDestinationTarget(arg1,(char const *)arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsFilterAddSourceTarget(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_filter arg1 = (helics_filter) 0 ;
  char *arg2 = (char *) 0 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsFilterAddSourceTarget",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFilterAddSourceTarget" "', argument " "1"" of type '" "helics_filter""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsFilterAddSourceTarget" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  helicsFilterAddSourceTarget(arg1,(char const *)arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsFilterAddDeliveryEndpoint(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_filter arg1 = (helics_filter) 0 ;
  char *arg2 = (char *) 0 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsFilterAddDeliveryEndpoint",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFilterAddDeliveryEndpoint" "', argument " "1"" of type '" "helics_filter""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsFilterAddDeliveryEndpoint" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  helicsFilterAddDeliveryEndpoint(arg1,(char const *)arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsFilterRemoveTarget(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_filter arg1 = (helics_filter) 0 ;
  char *arg2 = (char *) 0 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsFilterRemoveTarget",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFilterRemoveTarget" "', argument " "1"" of type '" "helics_filter""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsFilterRemoveTarget" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  helicsFilterRemoveTarget(arg1,(char const *)arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsFilterRemoveDeliveryEndpoint(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_filter arg1 = (helics_filter) 0 ;
  char *arg2 = (char *) 0 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsFilterRemoveDeliveryEndpoint",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFilterRemoveDeliveryEndpoint" "', argument " "1"" of type '" "helics_filter""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsFilterRemoveDeliveryEndpoint" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  helicsFilterRemoveDeliveryEndpoint(arg1,(char const *)arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsFilterGetInfo(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_filter arg1 = (helics_filter) 0 ;
  int res1 ;
  mxArray * _out;
  char *result = 0 ;
  
  if (!SWIG_check_num_args("helicsFilterGetInfo",argc,1,1,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFilterGetInfo" "', argument " "1"" of type '" "helics_filter""'"); 
  }
  result = (char *)helicsFilterGetInfo(arg1);
  _out = SWIG_FromCharPtr((const char *)result);
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}


int _wrap_helicsFilterSetInfo(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_filter arg1 = (helics_filter) 0 ;
  char *arg2 = (char *) 0 ;
  helics_error *arg3 = (helics_error *) 0 ;
  int res1 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  helics_error etemp3 ;
  mxArray * _out;
  
  {
    etemp3=helicsErrorInitialize();
    arg3=&etemp3;
  }
  if (!SWIG_check_num_args("helicsFilterSetInfo",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFilterSetInfo" "', argument " "1"" of type '" "helics_filter""'"); 
  }
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "helicsFilterSetInfo" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = reinterpret_cast< char * >(buf2);
  helicsFilterSetInfo(arg1,(char const *)arg2,arg3);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 0;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  {
    if (arg3->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg3);
    }
  }
  return 1;
}


int _wrap_helicsFilterSetOption(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_filter arg1 = (helics_filter) 0 ;
  int arg2 ;
  int arg3 ;
  helics_error *arg4 = (helics_error *) 0 ;
  int res1 ;
  int val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  helics_error etemp4 ;
  mxArray * _out;
  
  {
    etemp4=helicsErrorInitialize();
    arg4=&etemp4;
  }
  if (!SWIG_check_num_args("helicsFilterSetOption",argc,3,3,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFilterSetOption" "', argument " "1"" of type '" "helics_filter""'"); 
  }
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "helicsFilterSetOption" "', argument " "2"" of type '" "int""'");
  } 
  arg2 = static_cast< int >(val2);
  ecode3 = SWIG_AsVal_int(argv[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "helicsFilterSetOption" "', argument " "3"" of type '" "int""'");
  } 
  arg3 = static_cast< int >(val3);
  helicsFilterSetOption(arg1,arg2,arg3,arg4);
  _out = (mxArray*)0;
  if (_out) --resc, *resv++ = _out;
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 0;
fail:
  {
    if (arg4->error_code!=helics_ok)
    {
      throwHelicsMatlabError(arg4);
    }
  }
  return 1;
}


int _wrap_helicsFilterGetOption(int resc, mxArray *resv[], int argc, mxArray *argv[]) {
  helics_filter arg1 = (helics_filter) 0 ;
  int arg2 ;
  int res1 ;
  int val2 ;
  int ecode2 = 0 ;
  mxArray * _out;
  int result;
  
  if (!SWIG_check_num_args("helicsFilterGetOption",argc,2,2,0)) {
    SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1), 0, 0);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "helicsFilterGetOption" "', argument " "1"" of type '" "helics_filter""'"); 
  }
  ecode2 = SWIG_AsVal_int(argv[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "helicsFilterGetOption" "', argument " "2"" of type '" "int""'");
  } 
  arg2 = static_cast< int >(val2);
  result = (int)helicsFilterGetOption(arg1,arg2);
  _out = SWIG_From_int(static_cast< int >(result));
  if (_out) --resc, *resv++ = _out;
  return 0;
fail:
  return 1;
}



/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */

static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_double = {"_p_double", "helics_time *|double *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_helics_core_type = {"_p_helics_core_type", "enum helics_core_type *|helics_core_type *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_helics_data_type = {"_p_helics_data_type", "enum helics_data_type *|helics_data_type *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_helics_error = {"_p_helics_error", "helics_error *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_helics_error_types = {"_p_helics_error_types", "enum helics_error_types *|helics_error_types *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_helics_federate_flags = {"_p_helics_federate_flags", "enum helics_federate_flags *|helics_federate_flags *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_helics_federate_state = {"_p_helics_federate_state", "enum helics_federate_state *|helics_federate_state *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_helics_filter_type = {"_p_helics_filter_type", "enum helics_filter_type *|helics_filter_type *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_helics_handle_options = {"_p_helics_handle_options", "enum helics_handle_options *|helics_handle_options *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_helics_iteration_request = {"_p_helics_iteration_request", "enum helics_iteration_request *|helics_iteration_request *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_helics_iteration_result = {"_p_helics_iteration_result", "enum helics_iteration_result *|helics_iteration_result *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_helics_log_levels = {"_p_helics_log_levels", "enum helics_log_levels *|helics_log_levels *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_helics_message = {"_p_helics_message", "helics_message *", 0, 0, (void*)"helics.helics_message", 0};
static swig_type_info _swigt__p_helics_multi_input_mode = {"_p_helics_multi_input_mode", "enum helics_multi_input_mode *|helics_multi_input_mode *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_helics_properties = {"_p_helics_properties", "enum helics_properties *|helics_properties *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_int = {"_p_int", "helics_bool *|int *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_int16_t = {"_p_int16_t", "int16_t *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_int32_t = {"_p_int32_t", "int32_t *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_p_char = {"_p_p_char", "char **", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_void = {"_p_void", "helics_publication|helics_core|helics_broker|helics_query|helics_filter|helics_federate_info|helics_message_object|helics_federate|helics_endpoint|void *|helics_input", 0, 0, (void*)0, 0};

static swig_type_info *swig_type_initial[] = {
  &_swigt__p_char,
  &_swigt__p_double,
  &_swigt__p_helics_core_type,
  &_swigt__p_helics_data_type,
  &_swigt__p_helics_error,
  &_swigt__p_helics_error_types,
  &_swigt__p_helics_federate_flags,
  &_swigt__p_helics_federate_state,
  &_swigt__p_helics_filter_type,
  &_swigt__p_helics_handle_options,
  &_swigt__p_helics_iteration_request,
  &_swigt__p_helics_iteration_result,
  &_swigt__p_helics_log_levels,
  &_swigt__p_helics_message,
  &_swigt__p_helics_multi_input_mode,
  &_swigt__p_helics_properties,
  &_swigt__p_int,
  &_swigt__p_int16_t,
  &_swigt__p_int32_t,
  &_swigt__p_p_char,
  &_swigt__p_void,
};

static swig_cast_info _swigc__p_char[] = {  {&_swigt__p_char, 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_helics_core_type[] = {  {&_swigt__p_helics_core_type, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_helics_data_type[] = {  {&_swigt__p_helics_data_type, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_helics_error[] = {  {&_swigt__p_helics_error, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_helics_error_types[] = {  {&_swigt__p_helics_error_types, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_helics_federate_flags[] = {  {&_swigt__p_helics_federate_flags, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_helics_federate_state[] = {  {&_swigt__p_helics_federate_state, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_helics_filter_type[] = {  {&_swigt__p_helics_filter_type, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_helics_handle_options[] = {  {&_swigt__p_helics_handle_options, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_helics_iteration_request[] = {  {&_swigt__p_helics_iteration_request, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_helics_iteration_result[] = {  {&_swigt__p_helics_iteration_result, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_helics_log_levels[] = {  {&_swigt__p_helics_log_levels, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_helics_message[] = {  {&_swigt__p_helics_message, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_helics_multi_input_mode[] = {  {&_swigt__p_helics_multi_input_mode, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_helics_properties[] = {  {&_swigt__p_helics_properties, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_int[] = {  {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_int16_t[] = {  {&_swigt__p_int16_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_int32_t[] = {  {&_swigt__p_int32_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_p_char[] = {  {&_swigt__p_p_char, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_void[] = {  {&_swigt__p_void, 0, 0, 0},{0, 0, 0, 0}};

static swig_cast_info *swig_cast_initial[] = {
  _swigc__p_char,
  _swigc__p_double,
  _swigc__p_helics_core_type,
  _swigc__p_helics_data_type,
  _swigc__p_helics_error,
  _swigc__p_helics_error_types,
  _swigc__p_helics_federate_flags,
  _swigc__p_helics_federate_state,
  _swigc__p_helics_filter_type,
  _swigc__p_helics_handle_options,
  _swigc__p_helics_iteration_request,
  _swigc__p_helics_iteration_result,
  _swigc__p_helics_log_levels,
  _swigc__p_helics_message,
  _swigc__p_helics_multi_input_mode,
  _swigc__p_helics_properties,
  _swigc__p_int,
  _swigc__p_int16_t,
  _swigc__p_int32_t,
  _swigc__p_p_char,
  _swigc__p_void,
};


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

SWIG_InitializeModule(0);

}


SWIGINTERN const char* SwigConstantName(int con_id) {
  switch (con_id) {
  case 0: return "helics_core_type_default";
  case 1: return "helics_core_type_zmq";
  case 2: return "helics_core_type_mpi";
  case 3: return "helics_core_type_test";
  case 4: return "helics_core_type_interprocess";
  case 5: return "helics_core_type_ipc";
  case 6: return "helics_core_type_tcp";
  case 7: return "helics_core_type_udp";
  case 8: return "helics_core_type_zmq_test";
  case 9: return "helics_core_type_nng";
  case 10: return "helics_core_type_tcp_ss";
  case 11: return "helics_core_type_http";
  case 12: return "helics_core_type_websocket";
  case 13: return "helics_core_type_inproc";
  case 14: return "helics_core_type_null";
  case 15: return "helics_data_type_string";
  case 16: return "helics_data_type_double";
  case 17: return "helics_data_type_int";
  case 18: return "helics_data_type_complex";
  case 19: return "helics_data_type_vector";
  case 20: return "helics_data_type_complex_vector";
  case 21: return "helics_data_type_named_point";
  case 22: return "helics_data_type_boolean";
  case 23: return "helics_data_type_time";
  case 24: return "helics_data_type_raw";
  case 25: return "helics_data_type_multi";
  case 26: return "helics_data_type_any";
  case 27: return "helics_flag_observer";
  case 28: return "helics_flag_uninterruptible";
  case 29: return "helics_flag_interruptible";
  case 30: return "helics_flag_source_only";
  case 31: return "helics_flag_only_transmit_on_change";
  case 32: return "helics_flag_only_update_on_change";
  case 33: return "helics_flag_wait_for_current_time_update";
  case 34: return "helics_flag_restrictive_time_policy";
  case 35: return "helics_flag_rollback";
  case 36: return "helics_flag_forward_compute";
  case 37: return "helics_flag_realtime";
  case 38: return "helics_flag_single_thread_federate";
  case 39: return "helics_flag_slow_responding";
  case 40: return "helics_flag_delay_init_entry";
  case 41: return "helics_flag_enable_init_entry";
  case 42: return "helics_flag_ignore_time_mismatch_warnings";
  case 43: return "helics_flag_terminate_on_error";
  case 44: return "helics_log_level_no_print";
  case 45: return "helics_log_level_error";
  case 46: return "helics_log_level_warning";
  case 47: return "helics_log_level_summary";
  case 48: return "helics_log_level_connections";
  case 49: return "helics_log_level_interfaces";
  case 50: return "helics_log_level_timing";
  case 51: return "helics_log_level_data";
  case 52: return "helics_log_level_trace";
  case 53: return "helics_error_fatal";
  case 54: return "helics_error_external_type";
  case 55: return "helics_error_other";
  case 56: return "helics_error_insufficient_space";
  case 57: return "helics_error_execution_failure";
  case 58: return "helics_error_invalid_function_call";
  case 59: return "helics_error_invalid_state_transition";
  case 60: return "helics_warning";
  case 61: return "helics_error_system_failure";
  case 62: return "helics_error_discard";
  case 63: return "helics_error_invalid_argument";
  case 64: return "helics_error_invalid_object";
  case 65: return "helics_error_connection_failure";
  case 66: return "helics_error_registration_failure";
  case 67: return "helics_ok";
  case 68: return "helics_property_time_delta";
  case 69: return "helics_property_time_period";
  case 70: return "helics_property_time_offset";
  case 71: return "helics_property_time_rt_lag";
  case 72: return "helics_property_time_rt_lead";
  case 73: return "helics_property_time_rt_tolerance";
  case 74: return "helics_property_time_input_delay";
  case 75: return "helics_property_time_output_delay";
  case 76: return "helics_property_int_max_iterations";
  case 77: return "helics_property_int_log_level";
  case 78: return "helics_property_int_file_log_level";
  case 79: return "helics_property_int_console_log_level";
  case 80: return "helics_multi_input_no_op";
  case 81: return "helics_multi_input_vectorize_operation";
  case 82: return "helics_multi_input_and_operation";
  case 83: return "helics_multi_input_or_operation";
  case 84: return "helics_multi_input_sum_operation";
  case 85: return "helics_multi_input_diff_operation";
  case 86: return "helics_multi_input_max_operation";
  case 87: return "helics_multi_input_min_operation";
  case 88: return "helics_multi_input_average_operation";
  case 89: return "helics_handle_option_connection_required";
  case 90: return "helics_handle_option_connection_optional";
  case 91: return "helics_handle_option_single_connection_only";
  case 92: return "helics_handle_option_multiple_connections_allowed";
  case 93: return "helics_handle_option_buffer_data";
  case 94: return "helics_handle_option_strict_type_checking";
  case 95: return "helics_handle_option_ignore_unit_mismatch";
  case 96: return "helics_handle_option_only_transmit_on_change";
  case 97: return "helics_handle_option_only_update_on_change";
  case 98: return "helics_handle_option_ignore_interrupts";
  case 99: return "helics_handle_option_multi_input_handling_method";
  case 100: return "helics_handle_option_input_priority_location";
  case 101: return "helics_handle_option_clear_priority_list";
  case 102: return "helics_handle_option_connections";
  case 103: return "helics_filter_type_custom";
  case 104: return "helics_filter_type_delay";
  case 105: return "helics_filter_type_random_delay";
  case 106: return "helics_filter_type_random_drop";
  case 107: return "helics_filter_type_reroute";
  case 108: return "helics_filter_type_clone";
  case 109: return "helics_filter_type_firewall";
  case 110: return "helics_iteration_request_no_iteration";
  case 111: return "helics_iteration_request_force_iteration";
  case 112: return "helics_iteration_request_iterate_if_needed";
  case 113: return "helics_iteration_result_next_step";
  case 114: return "helics_iteration_result_error";
  case 115: return "helics_iteration_result_halted";
  case 116: return "helics_iteration_result_iterating";
  case 117: return "helics_state_startup";
  case 118: return "helics_state_initialization";
  case 119: return "helics_state_execution";
  case 120: return "helics_state_finalize";
  case 121: return "helics_state_error";
  case 122: return "helics_state_pending_init";
  case 123: return "helics_state_pending_exec";
  case 124: return "helics_state_pending_time";
  case 125: return "helics_state_pending_iterative_time";
  case 126: return "helics_state_pending_finalize";
  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,"helics_core_type_default",SWIG_From_int(static_cast< int >(helics_core_type_default)));; break;
  case 1: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_core_type_zmq",SWIG_From_int(static_cast< int >(helics_core_type_zmq)));; break;
  case 2: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_core_type_mpi",SWIG_From_int(static_cast< int >(helics_core_type_mpi)));; break;
  case 3: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_core_type_test",SWIG_From_int(static_cast< int >(helics_core_type_test)));; break;
  case 4: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_core_type_interprocess",SWIG_From_int(static_cast< int >(helics_core_type_interprocess)));; break;
  case 5: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_core_type_ipc",SWIG_From_int(static_cast< int >(helics_core_type_ipc)));; break;
  case 6: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_core_type_tcp",SWIG_From_int(static_cast< int >(helics_core_type_tcp)));; break;
  case 7: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_core_type_udp",SWIG_From_int(static_cast< int >(helics_core_type_udp)));; break;
  case 8: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_core_type_zmq_test",SWIG_From_int(static_cast< int >(helics_core_type_zmq_test)));; break;
  case 9: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_core_type_nng",SWIG_From_int(static_cast< int >(helics_core_type_nng)));; break;
  case 10: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_core_type_tcp_ss",SWIG_From_int(static_cast< int >(helics_core_type_tcp_ss)));; break;
  case 11: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_core_type_http",SWIG_From_int(static_cast< int >(helics_core_type_http)));; break;
  case 12: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_core_type_websocket",SWIG_From_int(static_cast< int >(helics_core_type_websocket)));; break;
  case 13: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_core_type_inproc",SWIG_From_int(static_cast< int >(helics_core_type_inproc)));; break;
  case 14: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_core_type_null",SWIG_From_int(static_cast< int >(helics_core_type_null)));; break;
  case 15: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_data_type_string",SWIG_From_int(static_cast< int >(helics_data_type_string)));; break;
  case 16: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_data_type_double",SWIG_From_int(static_cast< int >(helics_data_type_double)));; break;
  case 17: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_data_type_int",SWIG_From_int(static_cast< int >(helics_data_type_int)));; break;
  case 18: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_data_type_complex",SWIG_From_int(static_cast< int >(helics_data_type_complex)));; break;
  case 19: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_data_type_vector",SWIG_From_int(static_cast< int >(helics_data_type_vector)));; break;
  case 20: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_data_type_complex_vector",SWIG_From_int(static_cast< int >(helics_data_type_complex_vector)));; break;
  case 21: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_data_type_named_point",SWIG_From_int(static_cast< int >(helics_data_type_named_point)));; break;
  case 22: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_data_type_boolean",SWIG_From_int(static_cast< int >(helics_data_type_boolean)));; break;
  case 23: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_data_type_time",SWIG_From_int(static_cast< int >(helics_data_type_time)));; break;
  case 24: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_data_type_raw",SWIG_From_int(static_cast< int >(helics_data_type_raw)));; break;
  case 25: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_data_type_multi",SWIG_From_int(static_cast< int >(helics_data_type_multi)));; break;
  case 26: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_data_type_any",SWIG_From_int(static_cast< int >(helics_data_type_any)));; break;
  case 27: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_flag_observer",SWIG_From_int(static_cast< int >(helics_flag_observer)));; break;
  case 28: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_flag_uninterruptible",SWIG_From_int(static_cast< int >(helics_flag_uninterruptible)));; break;
  case 29: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_flag_interruptible",SWIG_From_int(static_cast< int >(helics_flag_interruptible)));; break;
  case 30: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_flag_source_only",SWIG_From_int(static_cast< int >(helics_flag_source_only)));; break;
  case 31: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_flag_only_transmit_on_change",SWIG_From_int(static_cast< int >(helics_flag_only_transmit_on_change)));; break;
  case 32: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_flag_only_update_on_change",SWIG_From_int(static_cast< int >(helics_flag_only_update_on_change)));; break;
  case 33: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_flag_wait_for_current_time_update",SWIG_From_int(static_cast< int >(helics_flag_wait_for_current_time_update)));; break;
  case 34: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_flag_restrictive_time_policy",SWIG_From_int(static_cast< int >(helics_flag_restrictive_time_policy)));; break;
  case 35: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_flag_rollback",SWIG_From_int(static_cast< int >(helics_flag_rollback)));; break;
  case 36: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_flag_forward_compute",SWIG_From_int(static_cast< int >(helics_flag_forward_compute)));; break;
  case 37: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_flag_realtime",SWIG_From_int(static_cast< int >(helics_flag_realtime)));; break;
  case 38: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_flag_single_thread_federate",SWIG_From_int(static_cast< int >(helics_flag_single_thread_federate)));; break;
  case 39: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_flag_slow_responding",SWIG_From_int(static_cast< int >(helics_flag_slow_responding)));; break;
  case 40: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_flag_delay_init_entry",SWIG_From_int(static_cast< int >(helics_flag_delay_init_entry)));; break;
  case 41: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_flag_enable_init_entry",SWIG_From_int(static_cast< int >(helics_flag_enable_init_entry)));; break;
  case 42: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_flag_ignore_time_mismatch_warnings",SWIG_From_int(static_cast< int >(helics_flag_ignore_time_mismatch_warnings)));; break;
  case 43: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_flag_terminate_on_error",SWIG_From_int(static_cast< int >(helics_flag_terminate_on_error)));; break;
  case 44: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_log_level_no_print",SWIG_From_int(static_cast< int >(helics_log_level_no_print)));; break;
  case 45: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_log_level_error",SWIG_From_int(static_cast< int >(helics_log_level_error)));; break;
  case 46: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_log_level_warning",SWIG_From_int(static_cast< int >(helics_log_level_warning)));; break;
  case 47: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_log_level_summary",SWIG_From_int(static_cast< int >(helics_log_level_summary)));; break;
  case 48: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_log_level_connections",SWIG_From_int(static_cast< int >(helics_log_level_connections)));; break;
  case 49: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_log_level_interfaces",SWIG_From_int(static_cast< int >(helics_log_level_interfaces)));; break;
  case 50: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_log_level_timing",SWIG_From_int(static_cast< int >(helics_log_level_timing)));; break;
  case 51: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_log_level_data",SWIG_From_int(static_cast< int >(helics_log_level_data)));; break;
  case 52: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_log_level_trace",SWIG_From_int(static_cast< int >(helics_log_level_trace)));; break;
  case 53: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_error_fatal",SWIG_From_int(static_cast< int >(helics_error_fatal)));; break;
  case 54: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_error_external_type",SWIG_From_int(static_cast< int >(helics_error_external_type)));; break;
  case 55: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_error_other",SWIG_From_int(static_cast< int >(helics_error_other)));; break;
  case 56: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_error_insufficient_space",SWIG_From_int(static_cast< int >(helics_error_insufficient_space)));; break;
  case 57: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_error_execution_failure",SWIG_From_int(static_cast< int >(helics_error_execution_failure)));; break;
  case 58: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_error_invalid_function_call",SWIG_From_int(static_cast< int >(helics_error_invalid_function_call)));; break;
  case 59: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_error_invalid_state_transition",SWIG_From_int(static_cast< int >(helics_error_invalid_state_transition)));; break;
  case 60: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_warning",SWIG_From_int(static_cast< int >(helics_warning)));; break;
  case 61: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_error_system_failure",SWIG_From_int(static_cast< int >(helics_error_system_failure)));; break;
  case 62: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_error_discard",SWIG_From_int(static_cast< int >(helics_error_discard)));; break;
  case 63: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_error_invalid_argument",SWIG_From_int(static_cast< int >(helics_error_invalid_argument)));; break;
  case 64: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_error_invalid_object",SWIG_From_int(static_cast< int >(helics_error_invalid_object)));; break;
  case 65: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_error_connection_failure",SWIG_From_int(static_cast< int >(helics_error_connection_failure)));; break;
  case 66: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_error_registration_failure",SWIG_From_int(static_cast< int >(helics_error_registration_failure)));; break;
  case 67: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_ok",SWIG_From_int(static_cast< int >(helics_ok)));; break;
  case 68: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_property_time_delta",SWIG_From_int(static_cast< int >(helics_property_time_delta)));; break;
  case 69: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_property_time_period",SWIG_From_int(static_cast< int >(helics_property_time_period)));; break;
  case 70: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_property_time_offset",SWIG_From_int(static_cast< int >(helics_property_time_offset)));; break;
  case 71: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_property_time_rt_lag",SWIG_From_int(static_cast< int >(helics_property_time_rt_lag)));; break;
  case 72: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_property_time_rt_lead",SWIG_From_int(static_cast< int >(helics_property_time_rt_lead)));; break;
  case 73: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_property_time_rt_tolerance",SWIG_From_int(static_cast< int >(helics_property_time_rt_tolerance)));; break;
  case 74: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_property_time_input_delay",SWIG_From_int(static_cast< int >(helics_property_time_input_delay)));; break;
  case 75: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_property_time_output_delay",SWIG_From_int(static_cast< int >(helics_property_time_output_delay)));; break;
  case 76: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_property_int_max_iterations",SWIG_From_int(static_cast< int >(helics_property_int_max_iterations)));; break;
  case 77: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_property_int_log_level",SWIG_From_int(static_cast< int >(helics_property_int_log_level)));; break;
  case 78: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_property_int_file_log_level",SWIG_From_int(static_cast< int >(helics_property_int_file_log_level)));; break;
  case 79: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_property_int_console_log_level",SWIG_From_int(static_cast< int >(helics_property_int_console_log_level)));; break;
  case 80: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_multi_input_no_op",SWIG_From_int(static_cast< int >(helics_multi_input_no_op)));; break;
  case 81: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_multi_input_vectorize_operation",SWIG_From_int(static_cast< int >(helics_multi_input_vectorize_operation)));; break;
  case 82: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_multi_input_and_operation",SWIG_From_int(static_cast< int >(helics_multi_input_and_operation)));; break;
  case 83: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_multi_input_or_operation",SWIG_From_int(static_cast< int >(helics_multi_input_or_operation)));; break;
  case 84: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_multi_input_sum_operation",SWIG_From_int(static_cast< int >(helics_multi_input_sum_operation)));; break;
  case 85: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_multi_input_diff_operation",SWIG_From_int(static_cast< int >(helics_multi_input_diff_operation)));; break;
  case 86: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_multi_input_max_operation",SWIG_From_int(static_cast< int >(helics_multi_input_max_operation)));; break;
  case 87: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_multi_input_min_operation",SWIG_From_int(static_cast< int >(helics_multi_input_min_operation)));; break;
  case 88: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_multi_input_average_operation",SWIG_From_int(static_cast< int >(helics_multi_input_average_operation)));; break;
  case 89: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_handle_option_connection_required",SWIG_From_int(static_cast< int >(helics_handle_option_connection_required)));; break;
  case 90: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_handle_option_connection_optional",SWIG_From_int(static_cast< int >(helics_handle_option_connection_optional)));; break;
  case 91: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_handle_option_single_connection_only",SWIG_From_int(static_cast< int >(helics_handle_option_single_connection_only)));; break;
  case 92: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_handle_option_multiple_connections_allowed",SWIG_From_int(static_cast< int >(helics_handle_option_multiple_connections_allowed)));; break;
  case 93: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_handle_option_buffer_data",SWIG_From_int(static_cast< int >(helics_handle_option_buffer_data)));; break;
  case 94: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_handle_option_strict_type_checking",SWIG_From_int(static_cast< int >(helics_handle_option_strict_type_checking)));; break;
  case 95: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_handle_option_ignore_unit_mismatch",SWIG_From_int(static_cast< int >(helics_handle_option_ignore_unit_mismatch)));; break;
  case 96: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_handle_option_only_transmit_on_change",SWIG_From_int(static_cast< int >(helics_handle_option_only_transmit_on_change)));; break;
  case 97: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_handle_option_only_update_on_change",SWIG_From_int(static_cast< int >(helics_handle_option_only_update_on_change)));; break;
  case 98: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_handle_option_ignore_interrupts",SWIG_From_int(static_cast< int >(helics_handle_option_ignore_interrupts)));; break;
  case 99: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_handle_option_multi_input_handling_method",SWIG_From_int(static_cast< int >(helics_handle_option_multi_input_handling_method)));; break;
  case 100: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_handle_option_input_priority_location",SWIG_From_int(static_cast< int >(helics_handle_option_input_priority_location)));; break;
  case 101: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_handle_option_clear_priority_list",SWIG_From_int(static_cast< int >(helics_handle_option_clear_priority_list)));; break;
  case 102: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_handle_option_connections",SWIG_From_int(static_cast< int >(helics_handle_option_connections)));; break;
  case 103: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_filter_type_custom",SWIG_From_int(static_cast< int >(helics_filter_type_custom)));; break;
  case 104: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_filter_type_delay",SWIG_From_int(static_cast< int >(helics_filter_type_delay)));; break;
  case 105: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_filter_type_random_delay",SWIG_From_int(static_cast< int >(helics_filter_type_random_delay)));; break;
  case 106: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_filter_type_random_drop",SWIG_From_int(static_cast< int >(helics_filter_type_random_drop)));; break;
  case 107: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_filter_type_reroute",SWIG_From_int(static_cast< int >(helics_filter_type_reroute)));; break;
  case 108: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_filter_type_clone",SWIG_From_int(static_cast< int >(helics_filter_type_clone)));; break;
  case 109: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_filter_type_firewall",SWIG_From_int(static_cast< int >(helics_filter_type_firewall)));; break;
  case 110: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_iteration_request_no_iteration",SWIG_From_int(static_cast< int >(helics_iteration_request_no_iteration)));; break;
  case 111: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_iteration_request_force_iteration",SWIG_From_int(static_cast< int >(helics_iteration_request_force_iteration)));; break;
  case 112: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_iteration_request_iterate_if_needed",SWIG_From_int(static_cast< int >(helics_iteration_request_iterate_if_needed)));; break;
  case 113: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_iteration_result_next_step",SWIG_From_int(static_cast< int >(helics_iteration_result_next_step)));; break;
  case 114: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_iteration_result_error",SWIG_From_int(static_cast< int >(helics_iteration_result_error)));; break;
  case 115: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_iteration_result_halted",SWIG_From_int(static_cast< int >(helics_iteration_result_halted)));; break;
  case 116: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_iteration_result_iterating",SWIG_From_int(static_cast< int >(helics_iteration_result_iterating)));; break;
  case 117: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_state_startup",SWIG_From_int(static_cast< int >(helics_state_startup)));; break;
  case 118: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_state_initialization",SWIG_From_int(static_cast< int >(helics_state_initialization)));; break;
  case 119: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_state_execution",SWIG_From_int(static_cast< int >(helics_state_execution)));; break;
  case 120: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_state_finalize",SWIG_From_int(static_cast< int >(helics_state_finalize)));; break;
  case 121: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_state_error",SWIG_From_int(static_cast< int >(helics_state_error)));; break;
  case 122: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_state_pending_init",SWIG_From_int(static_cast< int >(helics_state_pending_init)));; break;
  case 123: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_state_pending_exec",SWIG_From_int(static_cast< int >(helics_state_pending_exec)));; break;
  case 124: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_state_pending_time",SWIG_From_int(static_cast< int >(helics_state_pending_time)));; break;
  case 125: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_state_pending_iterative_time",SWIG_From_int(static_cast< int >(helics_state_pending_iterative_time)));; break;
  case 126: *resv = SWIG_Matlab_SetConstant(module_ns,"helics_state_pending_finalize",SWIG_From_int(static_cast< int >(helics_state_pending_finalize)));; 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 "helics_time_zero_get";
  case 6: return "helics_time_epsilon_get";
  case 7: return "helics_time_invalid_get";
  case 8: return "helics_time_maxtime_get";
  case 9: return "helics_true_get";
  case 10: return "helics_false_get";
  case 11: return "helics_message_time_get";
  case 12: return "helics_message_time_set";
  case 13: return "helics_message_data_get";
  case 14: return "helics_message_data_set";
  case 15: return "helics_message_length_get";
  case 16: return "helics_message_length_set";
  case 17: return "helics_message_messageID_get";
  case 18: return "helics_message_messageID_set";
  case 19: return "helics_message_flags_get";
  case 20: return "helics_message_flags_set";
  case 21: return "helics_message_original_source_get";
  case 22: return "helics_message_original_source_set";
  case 23: return "helics_message_source_get";
  case 24: return "helics_message_source_set";
  case 25: return "helics_message_dest_get";
  case 26: return "helics_message_dest_set";
  case 27: return "helics_message_original_dest_get";
  case 28: return "helics_message_original_dest_set";
  case 29: return "new_helics_message";
  case 30: return "delete_helics_message";
  case 31: return "_wrap_helicsGetVersion";
  case 32: return "_wrap_helicsGetBuildFlags";
  case 33: return "_wrap_helicsGetCompilerVersion";
  case 34: return "_wrap_helicsIsCoreTypeAvailable";
  case 35: return "_wrap_helicsCreateCore";
  case 36: return "_wrap_helicsCreateCoreFromArgs";
  case 37: return "_wrap_helicsCoreClone";
  case 38: return "_wrap_helicsCoreIsValid";
  case 39: return "_wrap_helicsCreateBroker";
  case 40: return "_wrap_helicsCreateBrokerFromArgs";
  case 41: return "_wrap_helicsBrokerClone";
  case 42: return "_wrap_helicsBrokerIsValid";
  case 43: return "_wrap_helicsBrokerIsConnected";
  case 44: return "_wrap_helicsBrokerDataLink";
  case 45: return "_wrap_helicsBrokerAddSourceFilterToEndpoint";
  case 46: return "_wrap_helicsBrokerAddDestinationFilterToEndpoint";
  case 47: return "_wrap_helicsBrokerMakeConnections";
  case 48: return "_wrap_helicsCoreWaitForDisconnect";
  case 49: return "_wrap_helicsBrokerWaitForDisconnect";
  case 50: return "_wrap_helicsCoreIsConnected";
  case 51: return "_wrap_helicsCoreDataLink";
  case 52: return "_wrap_helicsCoreAddSourceFilterToEndpoint";
  case 53: return "_wrap_helicsCoreAddDestinationFilterToEndpoint";
  case 54: return "_wrap_helicsCoreMakeConnections";
  case 55: return "_wrap_helicsBrokerGetIdentifier";
  case 56: return "_wrap_helicsCoreGetIdentifier";
  case 57: return "_wrap_helicsBrokerGetAddress";
  case 58: return "_wrap_helicsCoreGetAddress";
  case 59: return "_wrap_helicsCoreSetReadyToInit";
  case 60: return "_wrap_helicsCoreConnect";
  case 61: return "_wrap_helicsCoreDisconnect";
  case 62: return "_wrap_helicsGetFederateByName";
  case 63: return "_wrap_helicsBrokerDisconnect";
  case 64: return "_wrap_helicsFederateDestroy";
  case 65: return "_wrap_helicsBrokerDestroy";
  case 66: return "_wrap_helicsCoreDestroy";
  case 67: return "_wrap_helicsCoreFree";
  case 68: return "_wrap_helicsBrokerFree";
  case 69: return "_wrap_helicsCreateValueFederate";
  case 70: return "_wrap_helicsCreateValueFederateFromConfig";
  case 71: return "_wrap_helicsCreateMessageFederate";
  case 72: return "_wrap_helicsCreateMessageFederateFromConfig";
  case 73: return "_wrap_helicsCreateCombinationFederate";
  case 74: return "_wrap_helicsCreateCombinationFederateFromConfig";
  case 75: return "_wrap_helicsFederateClone";
  case 76: return "_wrap_helicsCreateFederateInfo";
  case 77: return "_wrap_helicsFederateInfoClone";
  case 78: return "_wrap_helicsFederateInfoLoadFromArgs";
  case 79: return "_wrap_helicsFederateInfoFree";
  case 80: return "_wrap_helicsFederateIsValid";
  case 81: return "_wrap_helicsFederateInfoSetCoreName";
  case 82: return "_wrap_helicsFederateInfoSetCoreInitString";
  case 83: return "_wrap_helicsFederateInfoSetBrokerInitString";
  case 84: return "_wrap_helicsFederateInfoSetCoreType";
  case 85: return "_wrap_helicsFederateInfoSetCoreTypeFromString";
  case 86: return "_wrap_helicsFederateInfoSetBroker";
  case 87: return "_wrap_helicsFederateInfoSetBrokerKey";
  case 88: return "_wrap_helicsFederateInfoSetBrokerPort";
  case 89: return "_wrap_helicsFederateInfoSetLocalPort";
  case 90: return "_wrap_helicsGetPropertyIndex";
  case 91: return "_wrap_helicsGetFlagIndex";
  case 92: return "_wrap_helicsGetOptionIndex";
  case 93: return "_wrap_helicsGetOptionValue";
  case 94: return "_wrap_helicsFederateInfoSetFlagOption";
  case 95: return "_wrap_helicsFederateInfoSetSeparator";
  case 96: return "_wrap_helicsFederateInfoSetTimeProperty";
  case 97: return "_wrap_helicsFederateInfoSetIntegerProperty";
  case 98: return "_wrap_helicsFederateRegisterInterfaces";
  case 99: return "_wrap_helicsFederateGlobalError";
  case 100: return "_wrap_helicsFederateLocalError";
  case 101: return "_wrap_helicsFederateFinalize";
  case 102: return "_wrap_helicsFederateFinalizeAsync";
  case 103: return "_wrap_helicsFederateFinalizeComplete";
  case 104: return "_wrap_helicsFederateFree";
  case 105: return "_wrap_helicsCloseLibrary";
  case 106: return "_wrap_helicsFederateEnterInitializingMode";
  case 107: return "_wrap_helicsFederateEnterInitializingModeAsync";
  case 108: return "_wrap_helicsFederateIsAsyncOperationCompleted";
  case 109: return "_wrap_helicsFederateEnterInitializingModeComplete";
  case 110: return "_wrap_helicsFederateEnterExecutingMode";
  case 111: return "_wrap_helicsFederateEnterExecutingModeAsync";
  case 112: return "_wrap_helicsFederateEnterExecutingModeComplete";
  case 113: return "_wrap_helicsFederateEnterExecutingModeIterative";
  case 114: return "_wrap_helicsFederateEnterExecutingModeIterativeAsync";
  case 115: return "_wrap_helicsFederateEnterExecutingModeIterativeComplete";
  case 116: return "_wrap_helicsFederateGetState";
  case 117: return "_wrap_helicsFederateGetCoreObject";
  case 118: return "_wrap_helicsFederateRequestTime";
  case 119: return "_wrap_helicsFederateRequestTimeAdvance";
  case 120: return "_wrap_helicsFederateRequestNextStep";
  case 121: return "_wrap_helicsFederateRequestTimeIterative";
  case 122: return "_wrap_helicsFederateRequestTimeAsync";
  case 123: return "_wrap_helicsFederateRequestTimeComplete";
  case 124: return "_wrap_helicsFederateRequestTimeIterativeAsync";
  case 125: return "_wrap_helicsFederateRequestTimeIterativeComplete";
  case 126: return "_wrap_helicsFederateGetName";
  case 127: return "_wrap_helicsFederateSetTimeProperty";
  case 128: return "_wrap_helicsFederateSetFlagOption";
  case 129: return "_wrap_helicsFederateSetSeparator";
  case 130: return "_wrap_helicsFederateSetIntegerProperty";
  case 131: return "_wrap_helicsFederateGetTimeProperty";
  case 132: return "_wrap_helicsFederateGetFlagOption";
  case 133: return "_wrap_helicsFederateGetIntegerProperty";
  case 134: return "_wrap_helicsFederateGetCurrentTime";
  case 135: return "_wrap_helicsFederateSetGlobal";
  case 136: return "_wrap_helicsFederateAddDependency";
  case 137: return "_wrap_helicsFederateSetLogFile";
  case 138: return "_wrap_helicsFederateLogErrorMessage";
  case 139: return "_wrap_helicsFederateLogWarningMessage";
  case 140: return "_wrap_helicsFederateLogInfoMessage";
  case 141: return "_wrap_helicsFederateLogDebugMessage";
  case 142: return "_wrap_helicsFederateLogLevelMessage";
  case 143: return "_wrap_helicsCoreSetGlobal";
  case 144: return "_wrap_helicsBrokerSetGlobal";
  case 145: return "_wrap_helicsCoreSetLogFile";
  case 146: return "_wrap_helicsBrokerSetLogFile";
  case 147: return "_wrap_helicsCreateQuery";
  case 148: return "_wrap_helicsQueryExecute";
  case 149: return "_wrap_helicsQueryCoreExecute";
  case 150: return "_wrap_helicsQueryBrokerExecute";
  case 151: return "_wrap_helicsQueryExecuteAsync";
  case 152: return "_wrap_helicsQueryExecuteComplete";
  case 153: return "_wrap_helicsQueryIsCompleted";
  case 154: return "_wrap_helicsQuerySetTarget";
  case 155: return "_wrap_helicsQuerySetQueryString";
  case 156: return "_wrap_helicsQueryFree";
  case 157: return "_wrap_helicsCleanupLibrary";
  case 158: return "_wrap_helicsFederateRegisterSubscription";
  case 159: return "_wrap_helicsFederateRegisterPublication";
  case 160: return "_wrap_helicsFederateRegisterTypePublication";
  case 161: return "_wrap_helicsFederateRegisterGlobalPublication";
  case 162: return "_wrap_helicsFederateRegisterGlobalTypePublication";
  case 163: return "_wrap_helicsFederateRegisterInput";
  case 164: return "_wrap_helicsFederateRegisterTypeInput";
  case 165: return "_wrap_helicsFederateRegisterGlobalInput";
  case 166: return "_wrap_helicsFederateRegisterGlobalTypeInput";
  case 167: return "_wrap_helicsFederateGetPublication";
  case 168: return "_wrap_helicsFederateGetPublicationByIndex";
  case 169: return "_wrap_helicsFederateGetInput";
  case 170: return "_wrap_helicsFederateGetInputByIndex";
  case 171: return "_wrap_helicsFederateGetSubscription";
  case 172: return "_wrap_helicsFederateClearUpdates";
  case 173: return "_wrap_helicsFederateRegisterFromPublicationJSON";
  case 174: return "_wrap_helicsFederatePublishJSON";
  case 175: return "_wrap_helicsPublicationIsValid";
  case 176: return "_wrap_helicsPublicationPublishRaw";
  case 177: return "_wrap_helicsPublicationPublishString";
  case 178: return "_wrap_helicsPublicationPublishInteger";
  case 179: return "_wrap_helicsPublicationPublishBoolean";
  case 180: return "_wrap_helicsPublicationPublishDouble";
  case 181: return "_wrap_helicsPublicationPublishTime";
  case 182: return "_wrap_helicsPublicationPublishChar";
  case 183: return "_wrap_helicsPublicationPublishComplex";
  case 184: return "_wrap_helicsPublicationPublishVector";
  case 185: return "_wrap_helicsPublicationPublishNamedPoint";
  case 186: return "_wrap_helicsPublicationAddTarget";
  case 187: return "_wrap_helicsInputIsValid";
  case 188: return "_wrap_helicsInputAddTarget";
  case 189: return "_wrap_helicsInputGetRawValueSize";
  case 190: return "_wrap_helicsInputGetRawValue";
  case 191: return "_wrap_helicsInputGetStringSize";
  case 192: return "_wrap_helicsInputGetString";
  case 193: return "_wrap_helicsInputGetInteger";
  case 194: return "_wrap_helicsInputGetBoolean";
  case 195: return "_wrap_helicsInputGetDouble";
  case 196: return "_wrap_helicsInputGetTime";
  case 197: return "_wrap_helicsInputGetChar";
  case 198: return "_wrap_helicsInputGetComplex";
  case 199: return "_wrap_helicsInputGetVectorSize";
  case 200: return "_wrap_helicsInputGetVector";
  case 201: return "_wrap_helicsInputGetNamedPoint";
  case 202: return "_wrap_helicsInputSetDefaultRaw";
  case 203: return "_wrap_helicsInputSetDefaultString";
  case 204: return "_wrap_helicsInputSetDefaultInteger";
  case 205: return "_wrap_helicsInputSetDefaultBoolean";
  case 206: return "_wrap_helicsInputSetDefaultTime";
  case 207: return "_wrap_helicsInputSetDefaultChar";
  case 208: return "_wrap_helicsInputSetDefaultDouble";
  case 209: return "_wrap_helicsInputSetDefaultComplex";
  case 210: return "_wrap_helicsInputSetDefaultVector";
  case 211: return "_wrap_helicsInputSetDefaultNamedPoint";
  case 212: return "_wrap_helicsInputGetType";
  case 213: return "_wrap_helicsInputGetPublicationType";
  case 214: return "_wrap_helicsPublicationGetType";
  case 215: return "_wrap_helicsInputGetKey";
  case 216: return "_wrap_helicsSubscriptionGetKey";
  case 217: return "_wrap_helicsPublicationGetKey";
  case 218: return "_wrap_helicsInputGetUnits";
  case 219: return "_wrap_helicsInputGetInjectionUnits";
  case 220: return "_wrap_helicsInputGetExtractionUnits";
  case 221: return "_wrap_helicsPublicationGetUnits";
  case 222: return "_wrap_helicsInputGetInfo";
  case 223: return "_wrap_helicsInputSetInfo";
  case 224: return "_wrap_helicsPublicationGetInfo";
  case 225: return "_wrap_helicsPublicationSetInfo";
  case 226: return "_wrap_helicsInputGetOption";
  case 227: return "_wrap_helicsInputSetOption";
  case 228: return "_wrap_helicsPublicationGetOption";
  case 229: return "_wrap_helicsPublicationSetOption";
  case 230: return "_wrap_helicsPublicationSetMinimumChange";
  case 231: return "_wrap_helicsInputSetMinimumChange";
  case 232: return "_wrap_helicsInputIsUpdated";
  case 233: return "_wrap_helicsInputLastUpdateTime";
  case 234: return "_wrap_helicsInputClearUpdate";
  case 235: return "_wrap_helicsFederateGetPublicationCount";
  case 236: return "_wrap_helicsFederateGetInputCount";
  case 237: return "_wrap_helicsFederateRegisterEndpoint";
  case 238: return "_wrap_helicsFederateRegisterGlobalEndpoint";
  case 239: return "_wrap_helicsFederateGetEndpoint";
  case 240: return "_wrap_helicsFederateGetEndpointByIndex";
  case 241: return "_wrap_helicsEndpointIsValid";
  case 242: return "_wrap_helicsEndpointSetDefaultDestination";
  case 243: return "_wrap_helicsEndpointGetDefaultDestination";
  case 244: return "_wrap_helicsEndpointSendMessageRaw";
  case 245: return "_wrap_helicsEndpointSendEventRaw";
  case 246: return "_wrap_helicsEndpointSendMessage";
  case 247: return "_wrap_helicsEndpointSendMessageObject";
  case 248: return "_wrap_helicsEndpointSendMessageObjectZeroCopy";
  case 249: return "_wrap_helicsEndpointSubscribe";
  case 250: return "_wrap_helicsFederateHasMessage";
  case 251: return "_wrap_helicsEndpointHasMessage";
  case 252: return "_wrap_helicsFederatePendingMessages";
  case 253: return "_wrap_helicsEndpointPendingMessages";
  case 254: return "_wrap_helicsEndpointGetMessage";
  case 255: return "_wrap_helicsEndpointGetMessageObject";
  case 256: return "_wrap_helicsEndpointCreateMessageObject";
  case 257: return "_wrap_helicsFederateGetMessage";
  case 258: return "_wrap_helicsFederateGetMessageObject";
  case 259: return "_wrap_helicsFederateCreateMessageObject";
  case 260: return "_wrap_helicsFederateClearMessages";
  case 261: return "_wrap_helicsEndpointClearMessages";
  case 262: return "_wrap_helicsEndpointGetType";
  case 263: return "_wrap_helicsEndpointGetName";
  case 264: return "_wrap_helicsFederateGetEndpointCount";
  case 265: return "_wrap_helicsEndpointGetInfo";
  case 266: return "_wrap_helicsEndpointSetInfo";
  case 267: return "_wrap_helicsEndpointSetOption";
  case 268: return "_wrap_helicsEndpointGetOption";
  case 269: return "_wrap_helicsMessageGetSource";
  case 270: return "_wrap_helicsMessageGetDestination";
  case 271: return "_wrap_helicsMessageGetOriginalSource";
  case 272: return "_wrap_helicsMessageGetOriginalDestination";
  case 273: return "_wrap_helicsMessageGetTime";
  case 274: return "_wrap_helicsMessageGetString";
  case 275: return "_wrap_helicsMessageGetMessageID";
  case 276: return "_wrap_helicsMessageCheckFlag";
  case 277: return "_wrap_helicsMessageGetRawDataSize";
  case 278: return "_wrap_helicsMessageGetRawData";
  case 279: return "_wrap_helicsMessageIsValid";
  case 280: return "_wrap_helicsMessageSetSource";
  case 281: return "_wrap_helicsMessageSetDestination";
  case 282: return "_wrap_helicsMessageSetOriginalSource";
  case 283: return "_wrap_helicsMessageSetOriginalDestination";
  case 284: return "_wrap_helicsMessageSetTime";
  case 285: return "_wrap_helicsMessageReserve";
  case 286: return "_wrap_helicsMessageSetMessageID";
  case 287: return "_wrap_helicsMessageClearFlags";
  case 288: return "_wrap_helicsMessageSetFlagOption";
  case 289: return "_wrap_helicsMessageSetString";
  case 290: return "_wrap_helicsMessageSetData";
  case 291: return "_wrap_helicsMessageAppendData";
  case 292: return "_wrap_helicsMessageCopy";
  case 293: return "_wrap_helicsMessageClone";
  case 294: return "_wrap_helicsMessageFree";
  case 295: return "_wrap_helicsFederateRegisterFilter";
  case 296: return "_wrap_helicsFederateRegisterGlobalFilter";
  case 297: return "_wrap_helicsFederateRegisterCloningFilter";
  case 298: return "_wrap_helicsFederateRegisterGlobalCloningFilter";
  case 299: return "_wrap_helicsCoreRegisterFilter";
  case 300: return "_wrap_helicsCoreRegisterCloningFilter";
  case 301: return "_wrap_helicsFederateGetFilterCount";
  case 302: return "_wrap_helicsFederateGetFilter";
  case 303: return "_wrap_helicsFederateGetFilterByIndex";
  case 304: return "_wrap_helicsFilterIsValid";
  case 305: return "_wrap_helicsFilterGetName";
  case 306: return "_wrap_helicsFilterSet";
  case 307: return "_wrap_helicsFilterSetString";
  case 308: return "_wrap_helicsFilterAddDestinationTarget";
  case 309: return "_wrap_helicsFilterAddSourceTarget";
  case 310: return "_wrap_helicsFilterAddDeliveryEndpoint";
  case 311: return "_wrap_helicsFilterRemoveTarget";
  case 312: return "_wrap_helicsFilterRemoveDeliveryEndpoint";
  case 313: return "_wrap_helicsFilterGetInfo";
  case 314: return "_wrap_helicsFilterSetInfo";
  case 315: return "_wrap_helicsFilterSetOption";
  case 316: return "_wrap_helicsFilterGetOption";
  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"
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)
    mexErrMsgTxt("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_helics_time_zero_get(resc,resv,argc,(mxArray**)(argv)); break;
  case 6: flag=_wrap_helics_time_epsilon_get(resc,resv,argc,(mxArray**)(argv)); break;
  case 7: flag=_wrap_helics_time_invalid_get(resc,resv,argc,(mxArray**)(argv)); break;
  case 8: flag=_wrap_helics_time_maxtime_get(resc,resv,argc,(mxArray**)(argv)); break;
  case 9: flag=_wrap_helics_true_get(resc,resv,argc,(mxArray**)(argv)); break;
  case 10: flag=_wrap_helics_false_get(resc,resv,argc,(mxArray**)(argv)); break;
  case 11: flag=_wrap_helics_message_time_get(resc,resv,argc,(mxArray**)(argv)); break;
  case 12: flag=_wrap_helics_message_time_set(resc,resv,argc,(mxArray**)(argv)); break;
  case 13: flag=_wrap_helics_message_data_get(resc,resv,argc,(mxArray**)(argv)); break;
  case 14: flag=_wrap_helics_message_data_set(resc,resv,argc,(mxArray**)(argv)); break;
  case 15: flag=_wrap_helics_message_length_get(resc,resv,argc,(mxArray**)(argv)); break;
  case 16: flag=_wrap_helics_message_length_set(resc,resv,argc,(mxArray**)(argv)); break;
  case 17: flag=_wrap_helics_message_messageID_get(resc,resv,argc,(mxArray**)(argv)); break;
  case 18: flag=_wrap_helics_message_messageID_set(resc,resv,argc,(mxArray**)(argv)); break;
  case 19: flag=_wrap_helics_message_flags_get(resc,resv,argc,(mxArray**)(argv)); break;
  case 20: flag=_wrap_helics_message_flags_set(resc,resv,argc,(mxArray**)(argv)); break;
  case 21: flag=_wrap_helics_message_original_source_get(resc,resv,argc,(mxArray**)(argv)); break;
  case 22: flag=_wrap_helics_message_original_source_set(resc,resv,argc,(mxArray**)(argv)); break;
  case 23: flag=_wrap_helics_message_source_get(resc,resv,argc,(mxArray**)(argv)); break;
  case 24: flag=_wrap_helics_message_source_set(resc,resv,argc,(mxArray**)(argv)); break;
  case 25: flag=_wrap_helics_message_dest_get(resc,resv,argc,(mxArray**)(argv)); break;
  case 26: flag=_wrap_helics_message_dest_set(resc,resv,argc,(mxArray**)(argv)); break;
  case 27: flag=_wrap_helics_message_original_dest_get(resc,resv,argc,(mxArray**)(argv)); break;
  case 28: flag=_wrap_helics_message_original_dest_set(resc,resv,argc,(mxArray**)(argv)); break;
  case 29: flag=_wrap_new_helics_message(resc,resv,argc,(mxArray**)(argv)); break;
  case 30: flag=_wrap_delete_helics_message(resc,resv,argc,(mxArray**)(argv)); break;
  case 31: flag=_wrap_helicsGetVersion(resc,resv,argc,(mxArray**)(argv)); break;
  case 32: flag=_wrap_helicsGetBuildFlags(resc,resv,argc,(mxArray**)(argv)); break;
  case 33: flag=_wrap_helicsGetCompilerVersion(resc,resv,argc,(mxArray**)(argv)); break;
  case 34: flag=_wrap_helicsIsCoreTypeAvailable(resc,resv,argc,(mxArray**)(argv)); break;
  case 35: flag=_wrap_helicsCreateCore(resc,resv,argc,(mxArray**)(argv)); break;
  case 36: flag=_wrap_helicsCreateCoreFromArgs(resc,resv,argc,(mxArray**)(argv)); break;
  case 37: flag=_wrap_helicsCoreClone(resc,resv,argc,(mxArray**)(argv)); break;
  case 38: flag=_wrap_helicsCoreIsValid(resc,resv,argc,(mxArray**)(argv)); break;
  case 39: flag=_wrap_helicsCreateBroker(resc,resv,argc,(mxArray**)(argv)); break;
  case 40: flag=_wrap_helicsCreateBrokerFromArgs(resc,resv,argc,(mxArray**)(argv)); break;
  case 41: flag=_wrap_helicsBrokerClone(resc,resv,argc,(mxArray**)(argv)); break;
  case 42: flag=_wrap_helicsBrokerIsValid(resc,resv,argc,(mxArray**)(argv)); break;
  case 43: flag=_wrap_helicsBrokerIsConnected(resc,resv,argc,(mxArray**)(argv)); break;
  case 44: flag=_wrap_helicsBrokerDataLink(resc,resv,argc,(mxArray**)(argv)); break;
  case 45: flag=_wrap_helicsBrokerAddSourceFilterToEndpoint(resc,resv,argc,(mxArray**)(argv)); break;
  case 46: flag=_wrap_helicsBrokerAddDestinationFilterToEndpoint(resc,resv,argc,(mxArray**)(argv)); break;
  case 47: flag=_wrap_helicsBrokerMakeConnections(resc,resv,argc,(mxArray**)(argv)); break;
  case 48: flag=_wrap_helicsCoreWaitForDisconnect(resc,resv,argc,(mxArray**)(argv)); break;
  case 49: flag=_wrap_helicsBrokerWaitForDisconnect(resc,resv,argc,(mxArray**)(argv)); break;
  case 50: flag=_wrap_helicsCoreIsConnected(resc,resv,argc,(mxArray**)(argv)); break;
  case 51: flag=_wrap_helicsCoreDataLink(resc,resv,argc,(mxArray**)(argv)); break;
  case 52: flag=_wrap_helicsCoreAddSourceFilterToEndpoint(resc,resv,argc,(mxArray**)(argv)); break;
  case 53: flag=_wrap_helicsCoreAddDestinationFilterToEndpoint(resc,resv,argc,(mxArray**)(argv)); break;
  case 54: flag=_wrap_helicsCoreMakeConnections(resc,resv,argc,(mxArray**)(argv)); break;
  case 55: flag=_wrap_helicsBrokerGetIdentifier(resc,resv,argc,(mxArray**)(argv)); break;
  case 56: flag=_wrap_helicsCoreGetIdentifier(resc,resv,argc,(mxArray**)(argv)); break;
  case 57: flag=_wrap_helicsBrokerGetAddress(resc,resv,argc,(mxArray**)(argv)); break;
  case 58: flag=_wrap_helicsCoreGetAddress(resc,resv,argc,(mxArray**)(argv)); break;
  case 59: flag=_wrap_helicsCoreSetReadyToInit(resc,resv,argc,(mxArray**)(argv)); break;
  case 60: flag=_wrap_helicsCoreConnect(resc,resv,argc,(mxArray**)(argv)); break;
  case 61: flag=_wrap_helicsCoreDisconnect(resc,resv,argc,(mxArray**)(argv)); break;
  case 62: flag=_wrap_helicsGetFederateByName(resc,resv,argc,(mxArray**)(argv)); break;
  case 63: flag=_wrap_helicsBrokerDisconnect(resc,resv,argc,(mxArray**)(argv)); break;
  case 64: flag=_wrap_helicsFederateDestroy(resc,resv,argc,(mxArray**)(argv)); break;
  case 65: flag=_wrap_helicsBrokerDestroy(resc,resv,argc,(mxArray**)(argv)); break;
  case 66: flag=_wrap_helicsCoreDestroy(resc,resv,argc,(mxArray**)(argv)); break;
  case 67: flag=_wrap_helicsCoreFree(resc,resv,argc,(mxArray**)(argv)); break;
  case 68: flag=_wrap_helicsBrokerFree(resc,resv,argc,(mxArray**)(argv)); break;
  case 69: flag=_wrap_helicsCreateValueFederate(resc,resv,argc,(mxArray**)(argv)); break;
  case 70: flag=_wrap_helicsCreateValueFederateFromConfig(resc,resv,argc,(mxArray**)(argv)); break;
  case 71: flag=_wrap_helicsCreateMessageFederate(resc,resv,argc,(mxArray**)(argv)); break;
  case 72: flag=_wrap_helicsCreateMessageFederateFromConfig(resc,resv,argc,(mxArray**)(argv)); break;
  case 73: flag=_wrap_helicsCreateCombinationFederate(resc,resv,argc,(mxArray**)(argv)); break;
  case 74: flag=_wrap_helicsCreateCombinationFederateFromConfig(resc,resv,argc,(mxArray**)(argv)); break;
  case 75: flag=_wrap_helicsFederateClone(resc,resv,argc,(mxArray**)(argv)); break;
  case 76: flag=_wrap_helicsCreateFederateInfo(resc,resv,argc,(mxArray**)(argv)); break;
  case 77: flag=_wrap_helicsFederateInfoClone(resc,resv,argc,(mxArray**)(argv)); break;
  case 78: flag=_wrap_helicsFederateInfoLoadFromArgs(resc,resv,argc,(mxArray**)(argv)); break;
  case 79: flag=_wrap_helicsFederateInfoFree(resc,resv,argc,(mxArray**)(argv)); break;
  case 80: flag=_wrap_helicsFederateIsValid(resc,resv,argc,(mxArray**)(argv)); break;
  case 81: flag=_wrap_helicsFederateInfoSetCoreName(resc,resv,argc,(mxArray**)(argv)); break;
  case 82: flag=_wrap_helicsFederateInfoSetCoreInitString(resc,resv,argc,(mxArray**)(argv)); break;
  case 83: flag=_wrap_helicsFederateInfoSetBrokerInitString(resc,resv,argc,(mxArray**)(argv)); break;
  case 84: flag=_wrap_helicsFederateInfoSetCoreType(resc,resv,argc,(mxArray**)(argv)); break;
  case 85: flag=_wrap_helicsFederateInfoSetCoreTypeFromString(resc,resv,argc,(mxArray**)(argv)); break;
  case 86: flag=_wrap_helicsFederateInfoSetBroker(resc,resv,argc,(mxArray**)(argv)); break;
  case 87: flag=_wrap_helicsFederateInfoSetBrokerKey(resc,resv,argc,(mxArray**)(argv)); break;
  case 88: flag=_wrap_helicsFederateInfoSetBrokerPort(resc,resv,argc,(mxArray**)(argv)); break;
  case 89: flag=_wrap_helicsFederateInfoSetLocalPort(resc,resv,argc,(mxArray**)(argv)); break;
  case 90: flag=_wrap_helicsGetPropertyIndex(resc,resv,argc,(mxArray**)(argv)); break;
  case 91: flag=_wrap_helicsGetFlagIndex(resc,resv,argc,(mxArray**)(argv)); break;
  case 92: flag=_wrap_helicsGetOptionIndex(resc,resv,argc,(mxArray**)(argv)); break;
  case 93: flag=_wrap_helicsGetOptionValue(resc,resv,argc,(mxArray**)(argv)); break;
  case 94: flag=_wrap_helicsFederateInfoSetFlagOption(resc,resv,argc,(mxArray**)(argv)); break;
  case 95: flag=_wrap_helicsFederateInfoSetSeparator(resc,resv,argc,(mxArray**)(argv)); break;
  case 96: flag=_wrap_helicsFederateInfoSetTimeProperty(resc,resv,argc,(mxArray**)(argv)); break;
  case 97: flag=_wrap_helicsFederateInfoSetIntegerProperty(resc,resv,argc,(mxArray**)(argv)); break;
  case 98: flag=_wrap_helicsFederateRegisterInterfaces(resc,resv,argc,(mxArray**)(argv)); break;
  case 99: flag=_wrap_helicsFederateGlobalError(resc,resv,argc,(mxArray**)(argv)); break;
  case 100: flag=_wrap_helicsFederateLocalError(resc,resv,argc,(mxArray**)(argv)); break;
  case 101: flag=_wrap_helicsFederateFinalize(resc,resv,argc,(mxArray**)(argv)); break;
  case 102: flag=_wrap_helicsFederateFinalizeAsync(resc,resv,argc,(mxArray**)(argv)); break;
  case 103: flag=_wrap_helicsFederateFinalizeComplete(resc,resv,argc,(mxArray**)(argv)); break;
  case 104: flag=_wrap_helicsFederateFree(resc,resv,argc,(mxArray**)(argv)); break;
  case 105: flag=_wrap_helicsCloseLibrary(resc,resv,argc,(mxArray**)(argv)); break;
  case 106: flag=_wrap_helicsFederateEnterInitializingMode(resc,resv,argc,(mxArray**)(argv)); break;
  case 107: flag=_wrap_helicsFederateEnterInitializingModeAsync(resc,resv,argc,(mxArray**)(argv)); break;
  case 108: flag=_wrap_helicsFederateIsAsyncOperationCompleted(resc,resv,argc,(mxArray**)(argv)); break;
  case 109: flag=_wrap_helicsFederateEnterInitializingModeComplete(resc,resv,argc,(mxArray**)(argv)); break;
  case 110: flag=_wrap_helicsFederateEnterExecutingMode(resc,resv,argc,(mxArray**)(argv)); break;
  case 111: flag=_wrap_helicsFederateEnterExecutingModeAsync(resc,resv,argc,(mxArray**)(argv)); break;
  case 112: flag=_wrap_helicsFederateEnterExecutingModeComplete(resc,resv,argc,(mxArray**)(argv)); break;
  case 113: flag=_wrap_helicsFederateEnterExecutingModeIterative(resc,resv,argc,(mxArray**)(argv)); break;
  case 114: flag=_wrap_helicsFederateEnterExecutingModeIterativeAsync(resc,resv,argc,(mxArray**)(argv)); break;
  case 115: flag=_wrap_helicsFederateEnterExecutingModeIterativeComplete(resc,resv,argc,(mxArray**)(argv)); break;
  case 116: flag=_wrap_helicsFederateGetState(resc,resv,argc,(mxArray**)(argv)); break;
  case 117: flag=_wrap_helicsFederateGetCoreObject(resc,resv,argc,(mxArray**)(argv)); break;
  case 118: flag=_wrap_helicsFederateRequestTime(resc,resv,argc,(mxArray**)(argv)); break;
  case 119: flag=_wrap_helicsFederateRequestTimeAdvance(resc,resv,argc,(mxArray**)(argv)); break;
  case 120: flag=_wrap_helicsFederateRequestNextStep(resc,resv,argc,(mxArray**)(argv)); break;
  case 121: flag=_wrap_helicsFederateRequestTimeIterative(resc,resv,argc,(mxArray**)(argv)); break;
  case 122: flag=_wrap_helicsFederateRequestTimeAsync(resc,resv,argc,(mxArray**)(argv)); break;
  case 123: flag=_wrap_helicsFederateRequestTimeComplete(resc,resv,argc,(mxArray**)(argv)); break;
  case 124: flag=_wrap_helicsFederateRequestTimeIterativeAsync(resc,resv,argc,(mxArray**)(argv)); break;
  case 125: flag=_wrap_helicsFederateRequestTimeIterativeComplete(resc,resv,argc,(mxArray**)(argv)); break;
  case 126: flag=_wrap_helicsFederateGetName(resc,resv,argc,(mxArray**)(argv)); break;
  case 127: flag=_wrap_helicsFederateSetTimeProperty(resc,resv,argc,(mxArray**)(argv)); break;
  case 128: flag=_wrap_helicsFederateSetFlagOption(resc,resv,argc,(mxArray**)(argv)); break;
  case 129: flag=_wrap_helicsFederateSetSeparator(resc,resv,argc,(mxArray**)(argv)); break;
  case 130: flag=_wrap_helicsFederateSetIntegerProperty(resc,resv,argc,(mxArray**)(argv)); break;
  case 131: flag=_wrap_helicsFederateGetTimeProperty(resc,resv,argc,(mxArray**)(argv)); break;
  case 132: flag=_wrap_helicsFederateGetFlagOption(resc,resv,argc,(mxArray**)(argv)); break;
  case 133: flag=_wrap_helicsFederateGetIntegerProperty(resc,resv,argc,(mxArray**)(argv)); break;
  case 134: flag=_wrap_helicsFederateGetCurrentTime(resc,resv,argc,(mxArray**)(argv)); break;
  case 135: flag=_wrap_helicsFederateSetGlobal(resc,resv,argc,(mxArray**)(argv)); break;
  case 136: flag=_wrap_helicsFederateAddDependency(resc,resv,argc,(mxArray**)(argv)); break;
  case 137: flag=_wrap_helicsFederateSetLogFile(resc,resv,argc,(mxArray**)(argv)); break;
  case 138: flag=_wrap_helicsFederateLogErrorMessage(resc,resv,argc,(mxArray**)(argv)); break;
  case 139: flag=_wrap_helicsFederateLogWarningMessage(resc,resv,argc,(mxArray**)(argv)); break;
  case 140: flag=_wrap_helicsFederateLogInfoMessage(resc,resv,argc,(mxArray**)(argv)); break;
  case 141: flag=_wrap_helicsFederateLogDebugMessage(resc,resv,argc,(mxArray**)(argv)); break;
  case 142: flag=_wrap_helicsFederateLogLevelMessage(resc,resv,argc,(mxArray**)(argv)); break;
  case 143: flag=_wrap_helicsCoreSetGlobal(resc,resv,argc,(mxArray**)(argv)); break;
  case 144: flag=_wrap_helicsBrokerSetGlobal(resc,resv,argc,(mxArray**)(argv)); break;
  case 145: flag=_wrap_helicsCoreSetLogFile(resc,resv,argc,(mxArray**)(argv)); break;
  case 146: flag=_wrap_helicsBrokerSetLogFile(resc,resv,argc,(mxArray**)(argv)); break;
  case 147: flag=_wrap_helicsCreateQuery(resc,resv,argc,(mxArray**)(argv)); break;
  case 148: flag=_wrap_helicsQueryExecute(resc,resv,argc,(mxArray**)(argv)); break;
  case 149: flag=_wrap_helicsQueryCoreExecute(resc,resv,argc,(mxArray**)(argv)); break;
  case 150: flag=_wrap_helicsQueryBrokerExecute(resc,resv,argc,(mxArray**)(argv)); break;
  case 151: flag=_wrap_helicsQueryExecuteAsync(resc,resv,argc,(mxArray**)(argv)); break;
  case 152: flag=_wrap_helicsQueryExecuteComplete(resc,resv,argc,(mxArray**)(argv)); break;
  case 153: flag=_wrap_helicsQueryIsCompleted(resc,resv,argc,(mxArray**)(argv)); break;
  case 154: flag=_wrap_helicsQuerySetTarget(resc,resv,argc,(mxArray**)(argv)); break;
  case 155: flag=_wrap_helicsQuerySetQueryString(resc,resv,argc,(mxArray**)(argv)); break;
  case 156: flag=_wrap_helicsQueryFree(resc,resv,argc,(mxArray**)(argv)); break;
  case 157: flag=_wrap_helicsCleanupLibrary(resc,resv,argc,(mxArray**)(argv)); break;
  case 158: flag=_wrap_helicsFederateRegisterSubscription(resc,resv,argc,(mxArray**)(argv)); break;
  case 159: flag=_wrap_helicsFederateRegisterPublication(resc,resv,argc,(mxArray**)(argv)); break;
  case 160: flag=_wrap_helicsFederateRegisterTypePublication(resc,resv,argc,(mxArray**)(argv)); break;
  case 161: flag=_wrap_helicsFederateRegisterGlobalPublication(resc,resv,argc,(mxArray**)(argv)); break;
  case 162: flag=_wrap_helicsFederateRegisterGlobalTypePublication(resc,resv,argc,(mxArray**)(argv)); break;
  case 163: flag=_wrap_helicsFederateRegisterInput(resc,resv,argc,(mxArray**)(argv)); break;
  case 164: flag=_wrap_helicsFederateRegisterTypeInput(resc,resv,argc,(mxArray**)(argv)); break;
  case 165: flag=_wrap_helicsFederateRegisterGlobalInput(resc,resv,argc,(mxArray**)(argv)); break;
  case 166: flag=_wrap_helicsFederateRegisterGlobalTypeInput(resc,resv,argc,(mxArray**)(argv)); break;
  case 167: flag=_wrap_helicsFederateGetPublication(resc,resv,argc,(mxArray**)(argv)); break;
  case 168: flag=_wrap_helicsFederateGetPublicationByIndex(resc,resv,argc,(mxArray**)(argv)); break;
  case 169: flag=_wrap_helicsFederateGetInput(resc,resv,argc,(mxArray**)(argv)); break;
  case 170: flag=_wrap_helicsFederateGetInputByIndex(resc,resv,argc,(mxArray**)(argv)); break;
  case 171: flag=_wrap_helicsFederateGetSubscription(resc,resv,argc,(mxArray**)(argv)); break;
  case 172: flag=_wrap_helicsFederateClearUpdates(resc,resv,argc,(mxArray**)(argv)); break;
  case 173: flag=_wrap_helicsFederateRegisterFromPublicationJSON(resc,resv,argc,(mxArray**)(argv)); break;
  case 174: flag=_wrap_helicsFederatePublishJSON(resc,resv,argc,(mxArray**)(argv)); break;
  case 175: flag=_wrap_helicsPublicationIsValid(resc,resv,argc,(mxArray**)(argv)); break;
  case 176: flag=_wrap_helicsPublicationPublishRaw(resc,resv,argc,(mxArray**)(argv)); break;
  case 177: flag=_wrap_helicsPublicationPublishString(resc,resv,argc,(mxArray**)(argv)); break;
  case 178: flag=_wrap_helicsPublicationPublishInteger(resc,resv,argc,(mxArray**)(argv)); break;
  case 179: flag=_wrap_helicsPublicationPublishBoolean(resc,resv,argc,(mxArray**)(argv)); break;
  case 180: flag=_wrap_helicsPublicationPublishDouble(resc,resv,argc,(mxArray**)(argv)); break;
  case 181: flag=_wrap_helicsPublicationPublishTime(resc,resv,argc,(mxArray**)(argv)); break;
  case 182: flag=_wrap_helicsPublicationPublishChar(resc,resv,argc,(mxArray**)(argv)); break;
  case 183: flag=_wrap_helicsPublicationPublishComplex(resc,resv,argc,(mxArray**)(argv)); break;
  case 184: flag=_wrap_helicsPublicationPublishVector(resc,resv,argc,(mxArray**)(argv)); break;
  case 185: flag=_wrap_helicsPublicationPublishNamedPoint(resc,resv,argc,(mxArray**)(argv)); break;
  case 186: flag=_wrap_helicsPublicationAddTarget(resc,resv,argc,(mxArray**)(argv)); break;
  case 187: flag=_wrap_helicsInputIsValid(resc,resv,argc,(mxArray**)(argv)); break;
  case 188: flag=_wrap_helicsInputAddTarget(resc,resv,argc,(mxArray**)(argv)); break;
  case 189: flag=_wrap_helicsInputGetRawValueSize(resc,resv,argc,(mxArray**)(argv)); break;
  case 190: flag=_wrap_helicsInputGetRawValue(resc,resv,argc,(mxArray**)(argv)); break;
  case 191: flag=_wrap_helicsInputGetStringSize(resc,resv,argc,(mxArray**)(argv)); break;
  case 192: flag=_wrap_helicsInputGetString(resc,resv,argc,(mxArray**)(argv)); break;
  case 193: flag=_wrap_helicsInputGetInteger(resc,resv,argc,(mxArray**)(argv)); break;
  case 194: flag=_wrap_helicsInputGetBoolean(resc,resv,argc,(mxArray**)(argv)); break;
  case 195: flag=_wrap_helicsInputGetDouble(resc,resv,argc,(mxArray**)(argv)); break;
  case 196: flag=_wrap_helicsInputGetTime(resc,resv,argc,(mxArray**)(argv)); break;
  case 197: flag=_wrap_helicsInputGetChar(resc,resv,argc,(mxArray**)(argv)); break;
  case 198: flag=_wrap_helicsInputGetComplex(resc,resv,argc,(mxArray**)(argv)); break;
  case 199: flag=_wrap_helicsInputGetVectorSize(resc,resv,argc,(mxArray**)(argv)); break;
  case 200: flag=_wrap_helicsInputGetVector(resc,resv,argc,(mxArray**)(argv)); break;
  case 201: flag=_wrap_helicsInputGetNamedPoint(resc,resv,argc,(mxArray**)(argv)); break;
  case 202: flag=_wrap_helicsInputSetDefaultRaw(resc,resv,argc,(mxArray**)(argv)); break;
  case 203: flag=_wrap_helicsInputSetDefaultString(resc,resv,argc,(mxArray**)(argv)); break;
  case 204: flag=_wrap_helicsInputSetDefaultInteger(resc,resv,argc,(mxArray**)(argv)); break;
  case 205: flag=_wrap_helicsInputSetDefaultBoolean(resc,resv,argc,(mxArray**)(argv)); break;
  case 206: flag=_wrap_helicsInputSetDefaultTime(resc,resv,argc,(mxArray**)(argv)); break;
  case 207: flag=_wrap_helicsInputSetDefaultChar(resc,resv,argc,(mxArray**)(argv)); break;
  case 208: flag=_wrap_helicsInputSetDefaultDouble(resc,resv,argc,(mxArray**)(argv)); break;
  case 209: flag=_wrap_helicsInputSetDefaultComplex(resc,resv,argc,(mxArray**)(argv)); break;
  case 210: flag=_wrap_helicsInputSetDefaultVector(resc,resv,argc,(mxArray**)(argv)); break;
  case 211: flag=_wrap_helicsInputSetDefaultNamedPoint(resc,resv,argc,(mxArray**)(argv)); break;
  case 212: flag=_wrap_helicsInputGetType(resc,resv,argc,(mxArray**)(argv)); break;
  case 213: flag=_wrap_helicsInputGetPublicationType(resc,resv,argc,(mxArray**)(argv)); break;
  case 214: flag=_wrap_helicsPublicationGetType(resc,resv,argc,(mxArray**)(argv)); break;
  case 215: flag=_wrap_helicsInputGetKey(resc,resv,argc,(mxArray**)(argv)); break;
  case 216: flag=_wrap_helicsSubscriptionGetKey(resc,resv,argc,(mxArray**)(argv)); break;
  case 217: flag=_wrap_helicsPublicationGetKey(resc,resv,argc,(mxArray**)(argv)); break;
  case 218: flag=_wrap_helicsInputGetUnits(resc,resv,argc,(mxArray**)(argv)); break;
  case 219: flag=_wrap_helicsInputGetInjectionUnits(resc,resv,argc,(mxArray**)(argv)); break;
  case 220: flag=_wrap_helicsInputGetExtractionUnits(resc,resv,argc,(mxArray**)(argv)); break;
  case 221: flag=_wrap_helicsPublicationGetUnits(resc,resv,argc,(mxArray**)(argv)); break;
  case 222: flag=_wrap_helicsInputGetInfo(resc,resv,argc,(mxArray**)(argv)); break;
  case 223: flag=_wrap_helicsInputSetInfo(resc,resv,argc,(mxArray**)(argv)); break;
  case 224: flag=_wrap_helicsPublicationGetInfo(resc,resv,argc,(mxArray**)(argv)); break;
  case 225: flag=_wrap_helicsPublicationSetInfo(resc,resv,argc,(mxArray**)(argv)); break;
  case 226: flag=_wrap_helicsInputGetOption(resc,resv,argc,(mxArray**)(argv)); break;
  case 227: flag=_wrap_helicsInputSetOption(resc,resv,argc,(mxArray**)(argv)); break;
  case 228: flag=_wrap_helicsPublicationGetOption(resc,resv,argc,(mxArray**)(argv)); break;
  case 229: flag=_wrap_helicsPublicationSetOption(resc,resv,argc,(mxArray**)(argv)); break;
  case 230: flag=_wrap_helicsPublicationSetMinimumChange(resc,resv,argc,(mxArray**)(argv)); break;
  case 231: flag=_wrap_helicsInputSetMinimumChange(resc,resv,argc,(mxArray**)(argv)); break;
  case 232: flag=_wrap_helicsInputIsUpdated(resc,resv,argc,(mxArray**)(argv)); break;
  case 233: flag=_wrap_helicsInputLastUpdateTime(resc,resv,argc,(mxArray**)(argv)); break;
  case 234: flag=_wrap_helicsInputClearUpdate(resc,resv,argc,(mxArray**)(argv)); break;
  case 235: flag=_wrap_helicsFederateGetPublicationCount(resc,resv,argc,(mxArray**)(argv)); break;
  case 236: flag=_wrap_helicsFederateGetInputCount(resc,resv,argc,(mxArray**)(argv)); break;
  case 237: flag=_wrap_helicsFederateRegisterEndpoint(resc,resv,argc,(mxArray**)(argv)); break;
  case 238: flag=_wrap_helicsFederateRegisterGlobalEndpoint(resc,resv,argc,(mxArray**)(argv)); break;
  case 239: flag=_wrap_helicsFederateGetEndpoint(resc,resv,argc,(mxArray**)(argv)); break;
  case 240: flag=_wrap_helicsFederateGetEndpointByIndex(resc,resv,argc,(mxArray**)(argv)); break;
  case 241: flag=_wrap_helicsEndpointIsValid(resc,resv,argc,(mxArray**)(argv)); break;
  case 242: flag=_wrap_helicsEndpointSetDefaultDestination(resc,resv,argc,(mxArray**)(argv)); break;
  case 243: flag=_wrap_helicsEndpointGetDefaultDestination(resc,resv,argc,(mxArray**)(argv)); break;
  case 244: flag=_wrap_helicsEndpointSendMessageRaw(resc,resv,argc,(mxArray**)(argv)); break;
  case 245: flag=_wrap_helicsEndpointSendEventRaw(resc,resv,argc,(mxArray**)(argv)); break;
  case 246: flag=_wrap_helicsEndpointSendMessage(resc,resv,argc,(mxArray**)(argv)); break;
  case 247: flag=_wrap_helicsEndpointSendMessageObject(resc,resv,argc,(mxArray**)(argv)); break;
  case 248: flag=_wrap_helicsEndpointSendMessageObjectZeroCopy(resc,resv,argc,(mxArray**)(argv)); break;
  case 249: flag=_wrap_helicsEndpointSubscribe(resc,resv,argc,(mxArray**)(argv)); break;
  case 250: flag=_wrap_helicsFederateHasMessage(resc,resv,argc,(mxArray**)(argv)); break;
  case 251: flag=_wrap_helicsEndpointHasMessage(resc,resv,argc,(mxArray**)(argv)); break;
  case 252: flag=_wrap_helicsFederatePendingMessages(resc,resv,argc,(mxArray**)(argv)); break;
  case 253: flag=_wrap_helicsEndpointPendingMessages(resc,resv,argc,(mxArray**)(argv)); break;
  case 254: flag=_wrap_helicsEndpointGetMessage(resc,resv,argc,(mxArray**)(argv)); break;
  case 255: flag=_wrap_helicsEndpointGetMessageObject(resc,resv,argc,(mxArray**)(argv)); break;
  case 256: flag=_wrap_helicsEndpointCreateMessageObject(resc,resv,argc,(mxArray**)(argv)); break;
  case 257: flag=_wrap_helicsFederateGetMessage(resc,resv,argc,(mxArray**)(argv)); break;
  case 258: flag=_wrap_helicsFederateGetMessageObject(resc,resv,argc,(mxArray**)(argv)); break;
  case 259: flag=_wrap_helicsFederateCreateMessageObject(resc,resv,argc,(mxArray**)(argv)); break;
  case 260: flag=_wrap_helicsFederateClearMessages(resc,resv,argc,(mxArray**)(argv)); break;
  case 261: flag=_wrap_helicsEndpointClearMessages(resc,resv,argc,(mxArray**)(argv)); break;
  case 262: flag=_wrap_helicsEndpointGetType(resc,resv,argc,(mxArray**)(argv)); break;
  case 263: flag=_wrap_helicsEndpointGetName(resc,resv,argc,(mxArray**)(argv)); break;
  case 264: flag=_wrap_helicsFederateGetEndpointCount(resc,resv,argc,(mxArray**)(argv)); break;
  case 265: flag=_wrap_helicsEndpointGetInfo(resc,resv,argc,(mxArray**)(argv)); break;
  case 266: flag=_wrap_helicsEndpointSetInfo(resc,resv,argc,(mxArray**)(argv)); break;
  case 267: flag=_wrap_helicsEndpointSetOption(resc,resv,argc,(mxArray**)(argv)); break;
  case 268: flag=_wrap_helicsEndpointGetOption(resc,resv,argc,(mxArray**)(argv)); break;
  case 269: flag=_wrap_helicsMessageGetSource(resc,resv,argc,(mxArray**)(argv)); break;
  case 270: flag=_wrap_helicsMessageGetDestination(resc,resv,argc,(mxArray**)(argv)); break;
  case 271: flag=_wrap_helicsMessageGetOriginalSource(resc,resv,argc,(mxArray**)(argv)); break;
  case 272: flag=_wrap_helicsMessageGetOriginalDestination(resc,resv,argc,(mxArray**)(argv)); break;
  case 273: flag=_wrap_helicsMessageGetTime(resc,resv,argc,(mxArray**)(argv)); break;
  case 274: flag=_wrap_helicsMessageGetString(resc,resv,argc,(mxArray**)(argv)); break;
  case 275: flag=_wrap_helicsMessageGetMessageID(resc,resv,argc,(mxArray**)(argv)); break;
  case 276: flag=_wrap_helicsMessageCheckFlag(resc,resv,argc,(mxArray**)(argv)); break;
  case 277: flag=_wrap_helicsMessageGetRawDataSize(resc,resv,argc,(mxArray**)(argv)); break;
  case 278: flag=_wrap_helicsMessageGetRawData(resc,resv,argc,(mxArray**)(argv)); break;
  case 279: flag=_wrap_helicsMessageIsValid(resc,resv,argc,(mxArray**)(argv)); break;
  case 280: flag=_wrap_helicsMessageSetSource(resc,resv,argc,(mxArray**)(argv)); break;
  case 281: flag=_wrap_helicsMessageSetDestination(resc,resv,argc,(mxArray**)(argv)); break;
  case 282: flag=_wrap_helicsMessageSetOriginalSource(resc,resv,argc,(mxArray**)(argv)); break;
  case 283: flag=_wrap_helicsMessageSetOriginalDestination(resc,resv,argc,(mxArray**)(argv)); break;
  case 284: flag=_wrap_helicsMessageSetTime(resc,resv,argc,(mxArray**)(argv)); break;
  case 285: flag=_wrap_helicsMessageReserve(resc,resv,argc,(mxArray**)(argv)); break;
  case 286: flag=_wrap_helicsMessageSetMessageID(resc,resv,argc,(mxArray**)(argv)); break;
  case 287: flag=_wrap_helicsMessageClearFlags(resc,resv,argc,(mxArray**)(argv)); break;
  case 288: flag=_wrap_helicsMessageSetFlagOption(resc,resv,argc,(mxArray**)(argv)); break;
  case 289: flag=_wrap_helicsMessageSetString(resc,resv,argc,(mxArray**)(argv)); break;
  case 290: flag=_wrap_helicsMessageSetData(resc,resv,argc,(mxArray**)(argv)); break;
  case 291: flag=_wrap_helicsMessageAppendData(resc,resv,argc,(mxArray**)(argv)); break;
  case 292: flag=_wrap_helicsMessageCopy(resc,resv,argc,(mxArray**)(argv)); break;
  case 293: flag=_wrap_helicsMessageClone(resc,resv,argc,(mxArray**)(argv)); break;
  case 294: flag=_wrap_helicsMessageFree(resc,resv,argc,(mxArray**)(argv)); break;
  case 295: flag=_wrap_helicsFederateRegisterFilter(resc,resv,argc,(mxArray**)(argv)); break;
  case 296: flag=_wrap_helicsFederateRegisterGlobalFilter(resc,resv,argc,(mxArray**)(argv)); break;
  case 297: flag=_wrap_helicsFederateRegisterCloningFilter(resc,resv,argc,(mxArray**)(argv)); break;
  case 298: flag=_wrap_helicsFederateRegisterGlobalCloningFilter(resc,resv,argc,(mxArray**)(argv)); break;
  case 299: flag=_wrap_helicsCoreRegisterFilter(resc,resv,argc,(mxArray**)(argv)); break;
  case 300: flag=_wrap_helicsCoreRegisterCloningFilter(resc,resv,argc,(mxArray**)(argv)); break;
  case 301: flag=_wrap_helicsFederateGetFilterCount(resc,resv,argc,(mxArray**)(argv)); break;
  case 302: flag=_wrap_helicsFederateGetFilter(resc,resv,argc,(mxArray**)(argv)); break;
  case 303: flag=_wrap_helicsFederateGetFilterByIndex(resc,resv,argc,(mxArray**)(argv)); break;
  case 304: flag=_wrap_helicsFilterIsValid(resc,resv,argc,(mxArray**)(argv)); break;
  case 305: flag=_wrap_helicsFilterGetName(resc,resv,argc,(mxArray**)(argv)); break;
  case 306: flag=_wrap_helicsFilterSet(resc,resv,argc,(mxArray**)(argv)); break;
  case 307: flag=_wrap_helicsFilterSetString(resc,resv,argc,(mxArray**)(argv)); break;
  case 308: flag=_wrap_helicsFilterAddDestinationTarget(resc,resv,argc,(mxArray**)(argv)); break;
  case 309: flag=_wrap_helicsFilterAddSourceTarget(resc,resv,argc,(mxArray**)(argv)); break;
  case 310: flag=_wrap_helicsFilterAddDeliveryEndpoint(resc,resv,argc,(mxArray**)(argv)); break;
  case 311: flag=_wrap_helicsFilterRemoveTarget(resc,resv,argc,(mxArray**)(argv)); break;
  case 312: flag=_wrap_helicsFilterRemoveDeliveryEndpoint(resc,resv,argc,(mxArray**)(argv)); break;
  case 313: flag=_wrap_helicsFilterGetInfo(resc,resv,argc,(mxArray**)(argv)); break;
  case 314: flag=_wrap_helicsFilterSetInfo(resc,resv,argc,(mxArray**)(argv)); break;
  case 315: flag=_wrap_helicsFilterSetOption(resc,resv,argc,(mxArray**)(argv)); break;
  case 316: flag=_wrap_helicsFilterGetOption(resc,resv,argc,(mxArray**)(argv)); break;
  default: flag=1, SWIG_Error(SWIG_RuntimeError, "No function id %d.", fcn_id);
  }
  if (flag) {
    mexErrMsgIdAndTxt(SWIG_ErrorType(SWIG_lasterror_code), SWIG_lasterror_msg);
  }
}
