/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 2.0.12
 *
 * 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 SWIGGUILE
#define SWIG_GUILE_INIT_STATIC extern
extern "C" {

SWIG_GUILE_INIT_STATIC void
SWIG_init (void);

}


#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 (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
#  ifndef GCC_HASCLASSVISIBILITY
#    define GCC_HASCLASSVISIBILITY
#  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


/* -----------------------------------------------------------------------------
 * 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) {
      register size_t l = 0;
      register size_t r = iter->size - 1;
      do {
	/* since l+r >= 0, we can (>> 1) instead (/ 2) */
	register size_t i = (l + r) >> 1;
	const char *iname = iter->types[i]->name;
	if (iname) {
	  register 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 {
      register 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";
  register const unsigned char *u = (unsigned char *) ptr;
  register const unsigned char *eu =  u + sz;
  for (; u != eu; ++u) {
    register 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) {
  register unsigned char *u = (unsigned char *) ptr;
  register const unsigned char *eu = u + sz;
  for (; u != eu; ++u) {
    register char d = *(c++);
    register unsigned char uu;
    if ((d >= '0') && (d <= '9'))
      uu = ((d - '0') << 4);
    else if ((d >= 'a') && (d <= 'f'))
      uu = ((d - ('a'-10)) << 4);
    else
      return (char *) 0;
    d = *(c++);
    if ((d >= '0') && (d <= '9'))
      uu |= (d - '0');
    else if ((d >= 'a') && (d <= 'f'))
      uu |= (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

/* -----------------------------------------------------------------------------
 * guile_scm_run.swg
 * ----------------------------------------------------------------------------- */

#include <libguile.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>

#ifdef __cplusplus
extern "C" {
#endif


/* In the code below, use guile 2.0 compatible functions where possible.
   Functions that don't exist in older versions will be mapped to
   a deprecated equivalent for those versions only */
#if defined (SCM_MAJOR_VERSION) && (SCM_MAJOR_VERSION < 2)

static SCM
scm_module_variable (SCM module, SCM sym)
{
  return scm_sym2var (sym, scm_module_lookup_closure (module), SCM_BOOL_F);
}

#endif

#if SCM_MAJOR_VERSION >= 2
// scm_c_define_gsubr takes a different parameter type
// depending on the guile version

typedef scm_t_subr swig_guile_proc;
#else
typedef SCM (*swig_guile_proc)();
#endif
typedef SCM (*guile_destructor)(SCM);

typedef struct swig_guile_clientdata {
  guile_destructor destroy;
  SCM goops_class;
} swig_guile_clientdata;

#if SCM_MAJOR_VERSION <= 2
#define scm_to_utf8_string scm_to_locale_string
#define scm_from_utf8_string scm_from_locale_string
#endif
#define SWIG_scm2str(s) \
  SWIG_Guile_scm2newstr(s, NULL)
#define SWIG_str02scm(str) \
  str ? scm_from_utf8_string(str) : SCM_BOOL_F 
# define SWIG_malloc(size) \
  scm_malloc(size)
# define SWIG_free(mem) \
  free(mem)
#define SWIG_ConvertPtr(s, result, type, flags) \
  SWIG_Guile_ConvertPtr(s, result, type, flags)
#define SWIG_MustGetPtr(s, type, argnum, flags) \
  SWIG_Guile_MustGetPtr(s, type, argnum, flags, FUNC_NAME)
#define SWIG_NewPointerObj(ptr, type, owner) \
  SWIG_Guile_NewPointerObj((void*)ptr, type, owner)
#define SWIG_PointerAddress(object) \
  SWIG_Guile_PointerAddress(object)
#define SWIG_PointerType(object) \
  SWIG_Guile_PointerType(object)
#define SWIG_IsPointerOfType(object, type) \
  SWIG_Guile_IsPointerOfType(object, type)
#define SWIG_IsPointer(object) \
  SWIG_Guile_IsPointer(object)
#define SWIG_contract_assert(expr, msg)				\
  if (!(expr))							\
    scm_error(scm_from_locale_symbol("swig-contract-assertion-failed"),	\
	      (char *) FUNC_NAME, (char *) msg,			\
	      SCM_EOL, SCM_BOOL_F); else

/* for C++ member pointers, ie, member methods */
#define SWIG_ConvertMember(obj, ptr, sz, ty) \
  SWIG_Guile_ConvertMember(obj, ptr, sz, ty, FUNC_NAME)
#define SWIG_NewMemberObj(ptr, sz, type) \
  SWIG_Guile_NewMemberObj(ptr, sz, type, FUNC_NAME)
  
/* Runtime API */
static swig_module_info *SWIG_Guile_GetModule(void *SWIGUNUSEDPARM(clientdata));
#define SWIG_GetModule(clientdata) SWIG_Guile_GetModule(clientdata)
#define SWIG_SetModule(clientdata, pointer) SWIG_Guile_SetModule(pointer)
  
SWIGINTERN char *
SWIG_Guile_scm2newstr(SCM str, size_t *len) {
#define FUNC_NAME "SWIG_Guile_scm2newstr"
  char *ret;

  SCM_ASSERT (scm_is_string(str), str, 1, FUNC_NAME);

  ret = scm_to_utf8_string(str);
  if (!ret) return NULL;

  if (len) *len = strlen(ret) - 1;
  return ret;
#undef FUNC_NAME
}

static int swig_initialized = 0;
static scm_t_bits swig_tag = 0;
static scm_t_bits swig_collectable_tag = 0;
static scm_t_bits swig_destroyed_tag = 0;
static scm_t_bits swig_member_function_tag = 0;
static SCM swig_make_func = SCM_EOL;
static SCM swig_keyword = SCM_EOL;
static SCM swig_symbol = SCM_EOL;

#define SWIG_Guile_GetSmob(x) \
  ( !scm_is_null(x) && SCM_INSTANCEP(x) && scm_is_true(scm_slot_exists_p(x, swig_symbol)) \
      ? scm_slot_ref(x, swig_symbol) : (x) )

SWIGINTERN SCM
SWIG_Guile_NewPointerObj(void *ptr, swig_type_info *type, int owner)
{
  if (ptr == NULL)
    return SCM_EOL;
  else {
    SCM smob;
    swig_guile_clientdata *cdata = (swig_guile_clientdata *) type->clientdata;
    if (owner)
      SCM_NEWSMOB2(smob, swig_collectable_tag, ptr, (void *) type);
    else
      SCM_NEWSMOB2(smob, swig_tag, ptr, (void *) type);

    if (!cdata || SCM_NULLP(cdata->goops_class) || swig_make_func == SCM_EOL ) {
      return smob;
    } else {
      /* the scm_make() C function only handles the creation of gf,
	 methods and classes (no instances) the (make ...) function is
	 later redefined in goops.scm.  So we need to call that
	 Scheme function. */
      return scm_apply(swig_make_func,
		       scm_list_3(cdata->goops_class,
				  swig_keyword,
				  smob),
		       SCM_EOL);
    }
  }
}

SWIGINTERN unsigned long
SWIG_Guile_PointerAddress(SCM object)
{
  SCM smob = SWIG_Guile_GetSmob(object);
  if (SCM_NULLP(smob)) return 0;
  else if (SCM_SMOB_PREDICATE(swig_tag, smob)
	   || SCM_SMOB_PREDICATE(swig_collectable_tag, smob)
	   || SCM_SMOB_PREDICATE(swig_destroyed_tag, smob)) {
    return (unsigned long) (void *) SCM_CELL_WORD_1(smob);
  }
  else scm_wrong_type_arg("SWIG-Guile-PointerAddress", 1, object);
}

SWIGINTERN swig_type_info *
SWIG_Guile_PointerType(SCM object)
{
  SCM smob = SWIG_Guile_GetSmob(object);
  if (SCM_NULLP(smob)) return NULL;
  else if (SCM_SMOB_PREDICATE(swig_tag, smob)
	   || SCM_SMOB_PREDICATE(swig_collectable_tag, smob)
	   || SCM_SMOB_PREDICATE(swig_destroyed_tag, smob)) {
    return (swig_type_info *) SCM_CELL_WORD_2(smob);
  }
  else scm_wrong_type_arg("SWIG-Guile-PointerType", 1, object);
}
  
SWIGINTERN int
SWIG_Guile_ConvertPtr(SCM s, void **result, swig_type_info *type, int flags)
{
  swig_cast_info *cast;
  swig_type_info *from;
  SCM smob = SWIG_Guile_GetSmob(s);

  if (SCM_NULLP(smob)) {
    *result = NULL;
    return SWIG_OK;
  } else if (SCM_SMOB_PREDICATE(swig_tag, smob) || SCM_SMOB_PREDICATE(swig_collectable_tag, smob)) {
    /* we do not accept smobs representing destroyed pointers */
    from = (swig_type_info *) SCM_CELL_WORD_2(smob);
    if (!from) return SWIG_ERROR;
    if (type) {
      cast = SWIG_TypeCheckStruct(from, type);
      if (cast) {
        int newmemory = 0;
        *result = SWIG_TypeCast(cast, (void *) SCM_CELL_WORD_1(smob), &newmemory);
        assert(!newmemory); /* newmemory handling not yet implemented */
        return SWIG_OK;
      } else {
        return SWIG_ERROR;
      }
    } else {
      *result = (void *) SCM_CELL_WORD_1(smob);
      return SWIG_OK;
    }
  }
  return SWIG_ERROR;
}

SWIGINTERNINLINE void *
SWIG_Guile_MustGetPtr (SCM s, swig_type_info *type,
		       int argnum, int flags, const char *func_name)
{
  void *result;
  int res = SWIG_Guile_ConvertPtr(s, &result, type, flags);
  if (!SWIG_IsOK(res)) {
    /* type mismatch */
    scm_wrong_type_arg((char *) func_name, argnum, s);
  }
  return result;
}

SWIGINTERNINLINE int
SWIG_Guile_IsPointerOfType (SCM s, swig_type_info *type)
{
  void *result;
  if (SWIG_Guile_ConvertPtr(s, &result, type, 0)) {
    /* type mismatch */
    return 0;
  }
  else return 1;
}

SWIGINTERNINLINE int
SWIG_Guile_IsPointer (SCM s)
{
  /* module might not be initialized yet, so initialize it */
  SWIG_GetModule(0);
  return SWIG_Guile_IsPointerOfType (s, NULL);
}

/* Mark a pointer object non-collectable */
SWIGINTERN void
SWIG_Guile_MarkPointerNoncollectable(SCM s)
{
  SCM smob = SWIG_Guile_GetSmob(s);
  if (!SCM_NULLP(smob)) {
    if (SCM_SMOB_PREDICATE(swig_tag, smob) || SCM_SMOB_PREDICATE(swig_collectable_tag, smob)) {
      SCM_SET_CELL_TYPE(smob, swig_tag);
    }
    else scm_wrong_type_arg(NULL, 0, s);
  }
}

/* Mark a pointer object destroyed */
SWIGINTERN void
SWIG_Guile_MarkPointerDestroyed(SCM s)
{
  SCM smob = SWIG_Guile_GetSmob(s);
  if (!SCM_NULLP(smob)) {
    if (SCM_SMOB_PREDICATE(swig_tag, smob) || SCM_SMOB_PREDICATE(swig_collectable_tag, smob)) {
      SCM_SET_CELL_TYPE(smob, swig_destroyed_tag);
    }
    else scm_wrong_type_arg(NULL, 0, s);
  }
}

/* Member functions */

SWIGINTERN SCM
SWIG_Guile_NewMemberObj(void *ptr, size_t sz, swig_type_info *type,
			const char *func_name)
{
  SCM smob;
  void *copy = malloc(sz);
  memcpy(copy, ptr, sz);
  SCM_NEWSMOB2(smob, swig_member_function_tag, copy, (void *) type);
  return smob;
}

SWIGINTERN int
SWIG_Guile_ConvertMember(SCM smob, void *ptr, size_t sz, swig_type_info *type,
			 const char *func_name)
{
  swig_cast_info *cast;
  swig_type_info *from;

  if (SCM_SMOB_PREDICATE(swig_member_function_tag, smob)) {
    from = (swig_type_info *) SCM_CELL_WORD_2(smob);
    if (!from) return SWIG_ERROR;
    if (type) {
      cast = SWIG_TypeCheckStruct(from, type);
      if (!cast) return SWIG_ERROR;
    }
    memcpy(ptr, (void *) SCM_CELL_WORD_1(smob), sz);
    return SWIG_OK;
  }
  return SWIG_ERROR;
}
     

/* Init */

SWIGINTERN int
print_swig_aux (SCM swig_smob, SCM port, scm_print_state *pstate, 
                const char *attribute)
{
  swig_type_info *type;
  
  type = (swig_type_info *) SCM_CELL_WORD_2(swig_smob);
  if (type) {
    scm_puts((char *) "#<", port);
    scm_puts((char *) attribute, port);
    scm_puts((char *) "swig-pointer ", port);
    scm_puts((char *) SWIG_TypePrettyName(type), port);
    scm_puts((char *) " ", port);
    scm_intprint((long) SCM_CELL_WORD_1(swig_smob), 16, port);
    scm_puts((char *) ">", port);
    /* non-zero means success */
    return 1;
  } else {
    return 0;
  }
}

  
SWIGINTERN int
print_swig (SCM swig_smob, SCM port, scm_print_state *pstate)
{
  return print_swig_aux(swig_smob, port, pstate, "");
}

SWIGINTERN int
print_collectable_swig (SCM swig_smob, SCM port, scm_print_state *pstate)
{
  return print_swig_aux(swig_smob, port, pstate, "collectable-");
}

SWIGINTERN int
print_destroyed_swig (SCM swig_smob, SCM port, scm_print_state *pstate)
{
  return print_swig_aux(swig_smob, port, pstate, "destroyed-");
}

SWIGINTERN int
print_member_function_swig (SCM swig_smob, SCM port, scm_print_state *pstate)
{
  swig_type_info *type;
  type = (swig_type_info *) SCM_CELL_WORD_2(swig_smob);
  if (type) {
    scm_puts((char *) "#<", port);
    scm_puts((char *) "swig-member-function-pointer ", port);
    scm_puts((char *) SWIG_TypePrettyName(type), port);
    scm_puts((char *) " >", port);
    /* non-zero means success */
    return 1;
  } else {
    return 0;
  }
}

SWIGINTERN SCM
equalp_swig (SCM A, SCM B)
{
  if (SCM_CELL_WORD_0(A) == SCM_CELL_WORD_0(B) && SCM_CELL_WORD_1(A) == SCM_CELL_WORD_1(B) 
      && SCM_CELL_WORD_2(A) == SCM_CELL_WORD_2(B))
    return SCM_BOOL_T;
  else return SCM_BOOL_F;
}

SWIGINTERN size_t
free_swig(SCM A)
{
  swig_type_info *type = (swig_type_info *) SCM_CELL_WORD_2(A);
  if (type) {
    if (type->clientdata && ((swig_guile_clientdata *)type->clientdata)->destroy)
      ((swig_guile_clientdata *)type->clientdata)->destroy(A);
  } 
  return 0;
}

SWIGINTERN size_t
free_swig_member_function(SCM A)
{
  free((swig_type_info *) SCM_CELL_WORD_1(A));
  return 0;
}

SWIGINTERN int
ensure_smob_tag(SCM swig_module,
		scm_t_bits *tag_variable,
		const char *smob_name,
		const char *scheme_variable_name)
{
  SCM variable = scm_module_variable(swig_module,
                             scm_from_locale_symbol(scheme_variable_name));
  if (scm_is_false(variable)) {
    *tag_variable = scm_make_smob_type((char*)scheme_variable_name, 0);
    scm_c_module_define(swig_module, scheme_variable_name, 
                        scm_from_ulong(*tag_variable));
    return 1;
  }
  else {
    *tag_variable = scm_to_ulong(SCM_VARIABLE_REF(variable));
    return 0;
  }
}

SWIGINTERN SCM
SWIG_Guile_Init ()
{
  static SCM swig_module;
  
  if (swig_initialized) return swig_module;
  swig_initialized = 1;

  swig_module = scm_c_resolve_module("Swig swigrun");
  if (ensure_smob_tag(swig_module, &swig_tag,
		      "swig-pointer", "swig-pointer-tag")) {
    scm_set_smob_print(swig_tag, print_swig);
    scm_set_smob_equalp(swig_tag, equalp_swig);
  }
  if (ensure_smob_tag(swig_module, &swig_collectable_tag,
		      "collectable-swig-pointer", "collectable-swig-pointer-tag")) {
    scm_set_smob_print(swig_collectable_tag, print_collectable_swig);
    scm_set_smob_equalp(swig_collectable_tag, equalp_swig);
    scm_set_smob_free(swig_collectable_tag, free_swig);
  }
  if (ensure_smob_tag(swig_module, &swig_destroyed_tag,
		      "destroyed-swig-pointer", "destroyed-swig-pointer-tag")) {
    scm_set_smob_print(swig_destroyed_tag, print_destroyed_swig);
    scm_set_smob_equalp(swig_destroyed_tag, equalp_swig);
  }
  if (ensure_smob_tag(swig_module, &swig_member_function_tag,
		      "swig-member-function-pointer", "swig-member-function-pointer-tag")) {
    scm_set_smob_print(swig_member_function_tag, print_member_function_swig);
    scm_set_smob_free(swig_member_function_tag, free_swig_member_function);
  }
  swig_make_func = scm_permanent_object(
  scm_variable_ref(scm_c_module_lookup(scm_c_resolve_module("oop goops"), "make")));
  swig_keyword = scm_permanent_object(scm_from_locale_keyword((char*) "init-smob"));
  swig_symbol = scm_permanent_object(scm_from_locale_symbol("swig-smob"));
#ifdef SWIG_INIT_RUNTIME_MODULE
  SWIG_INIT_RUNTIME_MODULE
#endif

  return swig_module;
}

SWIGINTERN swig_module_info *
SWIG_Guile_GetModule(void *SWIGUNUSEDPARM(clientdata))
{
  SCM module;
  SCM variable;

  module = SWIG_Guile_Init();

  variable = scm_module_variable(module,
                 scm_from_locale_symbol("swig-type-list-address" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME));
  if (scm_is_false(variable)) {
    return NULL;
  } else {
    return (swig_module_info *) scm_to_ulong(SCM_VARIABLE_REF(variable));
  }
}

SWIGINTERN void
SWIG_Guile_SetModule(swig_module_info *swig_module)
{
  SCM module;
  SCM variable;

  module = SWIG_Guile_Init();
    
  scm_module_define(module,
                    scm_from_locale_symbol("swig-type-list-address" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME),
                    scm_from_ulong((unsigned long) swig_module));
}

SWIGINTERN int
SWIG_Guile_GetArgs (SCM *dest, SCM rest,
		    int reqargs, int optargs,
		    const char *procname)
{
  int i;
  int num_args_passed = 0;
  for (i = 0; i<reqargs; i++) {
    if (!SCM_CONSP(rest))
      scm_wrong_num_args(scm_from_utf8_string(procname ? (char *) procname : "unknown procedure"));
    *dest++ = SCM_CAR(rest);
    rest = SCM_CDR(rest);
    num_args_passed++;
  }
  for (i = 0; i<optargs && SCM_CONSP(rest); i++) {
    *dest++ = SCM_CAR(rest);
    rest = SCM_CDR(rest);
    num_args_passed++;
  }
  for (; i<optargs; i++)
    *dest++ = SCM_UNDEFINED;
  if (!SCM_NULLP(rest))
      scm_wrong_num_args(scm_from_utf8_string(procname ? (char *) procname : "unknown procedure"));
  return num_args_passed;
}

#ifdef __cplusplus
}
#endif



#define GUILE_MAYBE_VALUES \
      if (gswig_list_p) gswig_result = scm_values(gswig_result);

#define GUILE_MAYBE_VECTOR \
      if (gswig_list_p) gswig_result = scm_vector(gswig_result);

#define SWIG_APPEND_VALUE(object)						\
    if (gswig_result == SCM_UNSPECIFIED)						\
        gswig_result = object;							\
    else {									\
      if (!gswig_list_p) {							\
	      gswig_list_p = 1;							\
	      gswig_result = scm_listify(gswig_result, object, SCM_UNDEFINED);	\
      }									\
      else									\
            gswig_result = scm_append(scm_listify(gswig_result, scm_listify(object, SCM_UNDEFINED), SCM_UNDEFINED));		\
    }


static swig_guile_clientdata _swig_guile_clientdatanlopt_doublevector = { NULL, SCM_EOL };
static swig_guile_clientdata _swig_guile_clientdatanlopt_roundoff_limited = { NULL, SCM_EOL };
static swig_guile_clientdata _swig_guile_clientdatanlopt_forced_stop = { NULL, SCM_EOL };
static swig_guile_clientdata _swig_guile_clientdatanlopt_opt = { NULL, SCM_EOL };

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

#define SWIGTYPE_p_double swig_types[0]
#define SWIGTYPE_p_f_r_q_const__std__vector__double___r_std__vector__double___p_void__double swig_types[1]
#define SWIGTYPE_p_int swig_types[2]
#define SWIGTYPE_p_nlopt__forced_stop swig_types[3]
#define SWIGTYPE_p_nlopt__opt swig_types[4]
#define SWIGTYPE_p_nlopt__roundoff_limited swig_types[5]
#define SWIGTYPE_p_nlopt_func swig_types[6]
#define SWIGTYPE_p_nlopt_mfunc swig_types[7]
#define SWIGTYPE_p_nlopt_munge swig_types[8]
#define SWIGTYPE_p_nlopt_opt swig_types[9]
#define SWIGTYPE_p_nlopt_result swig_types[10]
#define SWIGTYPE_p_std__out_of_range swig_types[11]
#define SWIGTYPE_p_std__vectorT_double_t swig_types[12]
#define SWIGTYPE_p_unsigned_long swig_types[13]
static swig_type_info *swig_types[15];
static swig_module_info swig_module = {swig_types, 14, 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) -------- */


#include "nlopt.hpp"


#include <stdexcept>


#include <string>

inline std::string SWIG_scm2string(SCM x) {
    char* temp;
    temp = SWIG_scm2str(x);
    std::string s(temp);
    if (temp) SWIG_free(temp);
    return s;
}


#include <vector>
#include <algorithm>
#include <stdexcept>

SWIGINTERN double std_vector_Sl_double_Sg__pop(std::vector< double > *self){
                if (self->size() == 0)
                    throw std::out_of_range("pop from empty vector");
                double x = self->back();
                self->pop_back();
                return x;
            }
SWIGINTERN double std_vector_Sl_double_Sg__ref(std::vector< double > *self,int i){
                int size = int(self->size());
                if (i>=0 && i<size)
                    return (*self)[i];
                else
                    throw std::out_of_range("vector index out of range");
            }
SWIGINTERN void std_vector_Sl_double_Sg__set(std::vector< double > *self,int i,double x){
                int size = int(self->size());
                if (i>=0 && i<size)
                    (*self)[i] = x;
                else
                    throw std::out_of_range("vector index out of range");
            }

// work around obsolete stuff used by swig guile
#if SCM_MAJOR_VERSION >= 2
#  define gh_symbol2scm scm_from_latin1_symbol
#else
#  define gh_symbol2scm scm_str2symbol
#endif


// because our f_data pointer to the Scheme function is stored on the
// heap, rather than the stack, it may be missed by the Guile garbage
// collection and be accidentally freed.  Hence, use NLopts munge
// feature to prevent this, by incrementing Guile's reference count.
static void *free_guilefunc(void *p) { 
  scm_gc_unprotect_object((SCM) p); return p; }
static void *dup_guilefunc(void *p) { 
  scm_gc_protect_object((SCM) p); return p; }

// func wrapper around Guile function val = f(x, grad)
static double func_guile(unsigned n, const double *x, double *grad, void *f) {
  SCM xscm = scm_c_make_vector(n, SCM_UNSPECIFIED);
  for (unsigned i = 0; i < n; ++i)
    SCM_SIMPLE_VECTOR_SET(xscm, i, scm_make_real(x[i]));
  SCM grad_scm = grad ? scm_c_make_vector(n, SCM_UNSPECIFIED) : SCM_BOOL_F;
  SCM ret = scm_call_2((SCM) f, xscm, grad_scm);
  if (!scm_real_p(ret))
    throw std::invalid_argument("invalid result passed to nlopt");
  if (grad) {
    for (unsigned i = 0; i < n; ++i) {
      if (!scm_real_p(ret)) 
	throw std::invalid_argument("invalid gradient passed to nlopt");
      grad[i] = scm_to_double(SCM_SIMPLE_VECTOR_REF(grad_scm, i));
    }
  }
  return scm_to_double(ret);
}

static int gswig_const_NLOPT_GN_DIRECT = nlopt::GN_DIRECT;
static int gswig_const_NLOPT_GN_DIRECT_L = nlopt::GN_DIRECT_L;
static int gswig_const_NLOPT_GN_DIRECT_L_RAND = nlopt::GN_DIRECT_L_RAND;
static int gswig_const_NLOPT_GN_DIRECT_NOSCAL = nlopt::GN_DIRECT_NOSCAL;
static int gswig_const_NLOPT_GN_DIRECT_L_NOSCAL = nlopt::GN_DIRECT_L_NOSCAL;
static int gswig_const_NLOPT_GN_DIRECT_L_RAND_NOSCAL = nlopt::GN_DIRECT_L_RAND_NOSCAL;
static int gswig_const_NLOPT_GN_ORIG_DIRECT = nlopt::GN_ORIG_DIRECT;
static int gswig_const_NLOPT_GN_ORIG_DIRECT_L = nlopt::GN_ORIG_DIRECT_L;
static int gswig_const_NLOPT_GD_STOGO = nlopt::GD_STOGO;
static int gswig_const_NLOPT_GD_STOGO_RAND = nlopt::GD_STOGO_RAND;
static int gswig_const_NLOPT_LD_LBFGS_NOCEDAL = nlopt::LD_LBFGS_NOCEDAL;
static int gswig_const_NLOPT_LD_LBFGS = nlopt::LD_LBFGS;
static int gswig_const_NLOPT_LN_PRAXIS = nlopt::LN_PRAXIS;
static int gswig_const_NLOPT_LD_VAR1 = nlopt::LD_VAR1;
static int gswig_const_NLOPT_LD_VAR2 = nlopt::LD_VAR2;
static int gswig_const_NLOPT_LD_TNEWTON = nlopt::LD_TNEWTON;
static int gswig_const_NLOPT_LD_TNEWTON_RESTART = nlopt::LD_TNEWTON_RESTART;
static int gswig_const_NLOPT_LD_TNEWTON_PRECOND = nlopt::LD_TNEWTON_PRECOND;
static int gswig_const_NLOPT_LD_TNEWTON_PRECOND_RESTART = nlopt::LD_TNEWTON_PRECOND_RESTART;
static int gswig_const_NLOPT_GN_CRS2_LM = nlopt::GN_CRS2_LM;
static int gswig_const_NLOPT_GN_MLSL = nlopt::GN_MLSL;
static int gswig_const_NLOPT_GD_MLSL = nlopt::GD_MLSL;
static int gswig_const_NLOPT_GN_MLSL_LDS = nlopt::GN_MLSL_LDS;
static int gswig_const_NLOPT_GD_MLSL_LDS = nlopt::GD_MLSL_LDS;
static int gswig_const_NLOPT_LD_MMA = nlopt::LD_MMA;
static int gswig_const_NLOPT_LN_COBYLA = nlopt::LN_COBYLA;
static int gswig_const_NLOPT_LN_NEWUOA = nlopt::LN_NEWUOA;
static int gswig_const_NLOPT_LN_NEWUOA_BOUND = nlopt::LN_NEWUOA_BOUND;
static int gswig_const_NLOPT_LN_NELDERMEAD = nlopt::LN_NELDERMEAD;
static int gswig_const_NLOPT_LN_SBPLX = nlopt::LN_SBPLX;
static int gswig_const_NLOPT_LN_AUGLAG = nlopt::LN_AUGLAG;
static int gswig_const_NLOPT_LD_AUGLAG = nlopt::LD_AUGLAG;
static int gswig_const_NLOPT_LN_AUGLAG_EQ = nlopt::LN_AUGLAG_EQ;
static int gswig_const_NLOPT_LD_AUGLAG_EQ = nlopt::LD_AUGLAG_EQ;
static int gswig_const_NLOPT_LN_BOBYQA = nlopt::LN_BOBYQA;
static int gswig_const_NLOPT_GN_ISRES = nlopt::GN_ISRES;
static int gswig_const_NLOPT_AUGLAG = nlopt::AUGLAG;
static int gswig_const_NLOPT_AUGLAG_EQ = nlopt::AUGLAG_EQ;
static int gswig_const_NLOPT_G_MLSL = nlopt::G_MLSL;
static int gswig_const_NLOPT_G_MLSL_LDS = nlopt::G_MLSL_LDS;
static int gswig_const_NLOPT_LD_SLSQP = nlopt::LD_SLSQP;
static int gswig_const_NLOPT_LD_CCSAQ = nlopt::LD_CCSAQ;
static int gswig_const_NLOPT_GN_ESCH = nlopt::GN_ESCH;
static int gswig_const_NLOPT_NUM_ALGORITHMS = nlopt::NUM_ALGORITHMS;
static int gswig_const_NLOPT_FAILURE = nlopt::FAILURE;
static int gswig_const_NLOPT_INVALID_ARGS = nlopt::INVALID_ARGS;
static int gswig_const_NLOPT_OUT_OF_MEMORY = nlopt::OUT_OF_MEMORY;
static int gswig_const_NLOPT_ROUNDOFF_LIMITED = nlopt::ROUNDOFF_LIMITED;
static int gswig_const_NLOPT_FORCED_STOP = nlopt::FORCED_STOP;
static int gswig_const_NLOPT_SUCCESS = nlopt::SUCCESS;
static int gswig_const_NLOPT_STOPVAL_REACHED = nlopt::STOPVAL_REACHED;
static int gswig_const_NLOPT_FTOL_REACHED = nlopt::FTOL_REACHED;
static int gswig_const_NLOPT_XTOL_REACHED = nlopt::XTOL_REACHED;
static int gswig_const_NLOPT_MAXEVAL_REACHED = nlopt::MAXEVAL_REACHED;
static int gswig_const_NLOPT_MAXTIME_REACHED = nlopt::MAXTIME_REACHED;
static SCM
_wrap_new_nlopt_doublevector__SWIG_0 (int argc, SCM *argv)
{
#define FUNC_NAME "new-nlopt-doublevector"
  unsigned int arg1 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  std::vector< double > *result = 0 ;
  
  {
    arg1 = (unsigned int) scm_to_uint(argv[0]);
  }
  result = (std::vector< double > *)new std::vector< double >(arg1);
  {
    gswig_result = SWIG_NewPointerObj (result, SWIGTYPE_p_std__vectorT_double_t, 1);
  }
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_new_nlopt_doublevector__SWIG_1 (int argc, SCM *argv)
{
#define FUNC_NAME "new-nlopt-doublevector"
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  std::vector< double > *result = 0 ;
  
  result = (std::vector< double > *)new std::vector< double >();
  {
    gswig_result = SWIG_NewPointerObj (result, SWIGTYPE_p_std__vectorT_double_t, 1);
  }
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_new_nlopt_doublevector__SWIG_2 (int argc, SCM *argv)
{
#define FUNC_NAME "new-nlopt-doublevector"
  unsigned int arg1 ;
  double *arg2 = 0 ;
  double temp2 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  std::vector< double > *result = 0 ;
  
  {
    arg1 = (unsigned int) scm_to_uint(argv[0]);
  }
  {
    temp2 = scm_to_double(argv[1]);
    arg2 = (double *) &temp2;
  }
  result = (std::vector< double > *)new std::vector< double >(arg1,(double const &)*arg2);
  {
    gswig_result = SWIG_NewPointerObj (result, SWIGTYPE_p_std__vectorT_double_t, 1);
  }
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_new_nlopt_doublevector__SWIG_3 (int argc, SCM *argv)
{
#define FUNC_NAME "new-nlopt-doublevector"
  std::vector< double > *arg1 = 0 ;
  std::vector< double > temp1 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  std::vector< double > *result = 0 ;
  
  {
    if (scm_is_vector(argv[0])) {
      unsigned long size = scm_c_vector_length(argv[0]);
      temp1 = std::vector<double >(size);
      arg1 = &temp1;
      for (unsigned long i=0; i<size; i++) {
        SCM o = scm_vector_ref(argv[0],scm_from_ulong(i));
        if (scm_is_number(o))
        temp1[i] = (double)(scm_to_double(o));
        else
        scm_wrong_type_arg(FUNC_NAME, 1, argv[0]);
      }
    } else if (scm_is_null(argv[0])) {
      temp1 = std::vector<double >();
      arg1 = &temp1;
    } else if (scm_is_pair(argv[0])) {
      SCM v = scm_vector(argv[0]);
      unsigned long size = scm_c_vector_length(v);
      temp1 = std::vector<double >(size);
      arg1 = &temp1;
      for (unsigned long i=0; i<size; i++) {
        SCM o = scm_vector_ref(v,scm_from_ulong(i));
        if (scm_is_number(o))
        temp1[i] = (double)(scm_to_double(o));
        else
        scm_wrong_type_arg(FUNC_NAME, 1, argv[0]);
      }
    } else {
      arg1 = (std::vector< double > *) SWIG_MustGetPtr(argv[0],SWIGTYPE_p_std__vectorT_double_t,1, 0);
    }
  }
  result = (std::vector< double > *)new std::vector< double >((std::vector< double > const &)*arg1);
  {
    gswig_result = SWIG_NewPointerObj (result, SWIGTYPE_p_std__vectorT_double_t, 1);
  }
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_new_nlopt_doublevector(SCM rest)
{
#define FUNC_NAME "new-nlopt-doublevector"
  SCM argv[2];
  int argc = SWIG_Guile_GetArgs (argv, rest, 0, 2, "new-nlopt-doublevector");
  if (argc == 0) {
    return _wrap_new_nlopt_doublevector__SWIG_1(argc,argv);
  }
  if (argc == 1) {
    int _v;
    {
      _v = scm_is_true(scm_integer_p(argv[0])) && scm_is_true(scm_exact_p(argv[0]))? 1 : 0;
    }
    if (_v) {
      return _wrap_new_nlopt_doublevector__SWIG_0(argc,argv);
    }
  }
  if (argc == 1) {
    int _v;
    {
      /* native sequence? */
      if (scm_is_vector(argv[0])) {
        unsigned int size = scm_c_vector_length(argv[0]);
        if (size == 0) {
          /* an empty sequence can be of any type */
          _v = 1;
        } else {
          /* check the first element only */
          double* x;
          SCM o = scm_vector_ref(argv[0],scm_from_ulong(0));
          _v = scm_is_number(o) ? 1 : 0;
        }
      } else if (scm_is_null(argv[0])) {
        /* again, an empty sequence can be of any type */
        _v = 1;
      } else if (scm_is_pair(argv[0])) {
        /* check the first element only */
        double* x;
        SCM head = SCM_CAR(argv[0]);
        _v = scm_is_number(head) ? 1 : 0;
      } else {
        /* wrapped vector? */
        std::vector<double >* v;
        _v = (SWIG_ConvertPtr(argv[0],(void **) &v, 
            SWIGTYPE_p_std__vectorT_double_t, 0) != -1) ? 1 : 0;
      }
    }
    if (_v) {
      return _wrap_new_nlopt_doublevector__SWIG_3(argc,argv);
    }
  }
  if (argc == 2) {
    int _v;
    {
      _v = scm_is_true(scm_integer_p(argv[0])) && scm_is_true(scm_exact_p(argv[0]))? 1 : 0;
    }
    if (_v) {
      {
        _v = scm_is_true(scm_real_p(argv[1])) ? 1 : 0;
      }
      if (_v) {
        return _wrap_new_nlopt_doublevector__SWIG_2(argc,argv);
      }
    }
  }
  
  scm_misc_error("new-nlopt-doublevector", "No matching method for generic function `new_nlopt_doublevector'", SCM_EOL);
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_doublevector_length (SCM s_0)
{
#define FUNC_NAME "nlopt-doublevector-length"
  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
  std::vector< double > temp1 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  unsigned int result;
  
  {
    if (scm_is_vector(s_0)) {
      unsigned long size = scm_c_vector_length(s_0);
      temp1 = std::vector<double >(size);
      arg1 = &temp1;
      for (unsigned long i=0; i<size; i++) {
        SCM o = scm_vector_ref(s_0,scm_from_ulong(i));
        if (scm_is_number(o))
        temp1[i] = (double)(scm_to_double(o));
        else
        scm_wrong_type_arg(FUNC_NAME, 1, s_0);
      }
    } else if (scm_is_null(s_0)) {
      temp1 = std::vector<double >();
      arg1 = &temp1;
    } else if (scm_is_pair(s_0)) {
      SCM v = scm_vector(s_0);
      unsigned long size = scm_c_vector_length(v);
      temp1 = std::vector<double >(size);
      arg1 = &temp1;
      for (unsigned long i=0; i<size; i++) {
        SCM o = scm_vector_ref(v,scm_from_ulong(i));
        if (scm_is_number(o))
        temp1[i] = (double)(scm_to_double(o));
        else
        scm_wrong_type_arg(FUNC_NAME, 1, s_0);
      }
    } else {
      arg1 = (std::vector< double > *) SWIG_MustGetPtr(s_0,SWIGTYPE_p_std__vectorT_double_t,1, 0);
    }
  }
  result = (unsigned int)((std::vector< double > const *)arg1)->size();
  {
    gswig_result = scm_from_ulong(result);
  }
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_doublevector_emptyq___ (SCM s_0)
{
#define FUNC_NAME "nlopt-doublevector-empty?"
  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
  std::vector< double > temp1 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  bool result;
  
  {
    if (scm_is_vector(s_0)) {
      unsigned long size = scm_c_vector_length(s_0);
      temp1 = std::vector<double >(size);
      arg1 = &temp1;
      for (unsigned long i=0; i<size; i++) {
        SCM o = scm_vector_ref(s_0,scm_from_ulong(i));
        if (scm_is_number(o))
        temp1[i] = (double)(scm_to_double(o));
        else
        scm_wrong_type_arg(FUNC_NAME, 1, s_0);
      }
    } else if (scm_is_null(s_0)) {
      temp1 = std::vector<double >();
      arg1 = &temp1;
    } else if (scm_is_pair(s_0)) {
      SCM v = scm_vector(s_0);
      unsigned long size = scm_c_vector_length(v);
      temp1 = std::vector<double >(size);
      arg1 = &temp1;
      for (unsigned long i=0; i<size; i++) {
        SCM o = scm_vector_ref(v,scm_from_ulong(i));
        if (scm_is_number(o))
        temp1[i] = (double)(scm_to_double(o));
        else
        scm_wrong_type_arg(FUNC_NAME, 1, s_0);
      }
    } else {
      arg1 = (std::vector< double > *) SWIG_MustGetPtr(s_0,SWIGTYPE_p_std__vectorT_double_t,1, 0);
    }
  }
  result = (bool)((std::vector< double > const *)arg1)->empty();
  {
    gswig_result = scm_from_bool(result);
  }
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_doublevector_clearN___ (SCM s_0)
{
#define FUNC_NAME "nlopt-doublevector-clear!"
  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  
  {
    arg1 = (std::vector< double > *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_std__vectorT_double_t, 1, 0);
  }
  (arg1)->clear();
  gswig_result = SCM_UNSPECIFIED;
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_doublevector_pushN___ (SCM s_0, SCM s_1)
{
#define FUNC_NAME "nlopt-doublevector-push!"
  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
  double arg2 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  
  {
    arg1 = (std::vector< double > *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_std__vectorT_double_t, 1, 0);
  }
  {
    arg2 = (double) scm_to_double(s_1);
  }
  (arg1)->push_back(arg2);
  gswig_result = SCM_UNSPECIFIED;
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_doublevector_popN___ (SCM s_0)
{
#define FUNC_NAME "nlopt-doublevector-pop!"
  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  double result;
  
  {
    arg1 = (std::vector< double > *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_std__vectorT_double_t, 1, 0);
  }
  try {
    result = (double)std_vector_Sl_double_Sg__pop(arg1);
  }
  catch(std::out_of_range &_e) {
    {
      std::out_of_range * temp = new std::out_of_range(_e);
      scm_throw(scm_from_locale_symbol((char *) "swig-exception"),
        scm_listify(SWIG_NewPointerObj(temp, SWIGTYPE_p_std__out_of_range, 1),
          SCM_UNDEFINED));
    }
  }
  
  {
    gswig_result = scm_from_double(result);
  }
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_doublevector_ref (SCM s_0, SCM s_1)
{
#define FUNC_NAME "nlopt-doublevector-ref"
  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
  int arg2 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  double result;
  
  {
    arg1 = (std::vector< double > *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_std__vectorT_double_t, 1, 0);
  }
  {
    arg2 = (int) scm_to_int(s_1);
  }
  try {
    result = (double)std_vector_Sl_double_Sg__ref(arg1,arg2);
  }
  catch(std::out_of_range &_e) {
    {
      std::out_of_range * temp = new std::out_of_range(_e);
      scm_throw(scm_from_locale_symbol((char *) "swig-exception"),
        scm_listify(SWIG_NewPointerObj(temp, SWIGTYPE_p_std__out_of_range, 1),
          SCM_UNDEFINED));
    }
  }
  
  {
    gswig_result = scm_from_double(result);
  }
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_doublevector_setN___ (SCM s_0, SCM s_1, SCM s_2)
{
#define FUNC_NAME "nlopt-doublevector-set!"
  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
  int arg2 ;
  double arg3 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  
  {
    arg1 = (std::vector< double > *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_std__vectorT_double_t, 1, 0);
  }
  {
    arg2 = (int) scm_to_int(s_1);
  }
  {
    arg3 = (double) scm_to_double(s_2);
  }
  try {
    std_vector_Sl_double_Sg__set(arg1,arg2,arg3);
  }
  catch(std::out_of_range &_e) {
    {
      std::out_of_range * temp = new std::out_of_range(_e);
      scm_throw(scm_from_locale_symbol((char *) "swig-exception"),
        scm_listify(SWIG_NewPointerObj(temp, SWIGTYPE_p_std__out_of_range, 1),
          SCM_UNDEFINED));
    }
  }
  
  gswig_result = SCM_UNSPECIFIED;
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_delete_nlopt_doublevector (SCM s_0)
{
#define FUNC_NAME "delete-nlopt-doublevector"
  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  
  {
    arg1 = (std::vector< double > *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_std__vectorT_double_t, 1, 0);
  }
  delete arg1;
  gswig_result = SCM_UNSPECIFIED;
  
  SWIG_Guile_MarkPointerDestroyed(s_0);
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_get_initial_step (SCM s_0, SCM s_1)
{
#define FUNC_NAME "nlopt-get-initial-step"
  nlopt_opt arg1 ;
  double *arg2 = (double *) 0 ;
  nlopt_opt *argp1 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  nlopt_result result;
  
  {
    argp1 = (nlopt_opt *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_nlopt_opt, 1, 0);
    arg1 = *argp1;
  }
  {
    arg2 = (double *)SWIG_MustGetPtr(s_1, SWIGTYPE_p_double, 2, 0);
  }
  result = nlopt_get_initial_step(arg1,arg2);
  {
    nlopt_result * resultptr;
    resultptr = new nlopt_result((const nlopt_result &) result);
    gswig_result =  SWIG_NewPointerObj (resultptr, SWIGTYPE_p_nlopt_result, 1);
  }
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_NLOPT_GN_DIRECT(SCM s_0)
{
#define FUNC_NAME "NLOPT-GN-DIRECT"
  SCM gswig_result;
  
  {
    gswig_result = scm_from_long(gswig_const_NLOPT_GN_DIRECT);
  }
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_NLOPT_GN_DIRECT_L(SCM s_0)
{
#define FUNC_NAME "NLOPT-GN-DIRECT-L"
  SCM gswig_result;
  
  {
    gswig_result = scm_from_long(gswig_const_NLOPT_GN_DIRECT_L);
  }
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_NLOPT_GN_DIRECT_L_RAND(SCM s_0)
{
#define FUNC_NAME "NLOPT-GN-DIRECT-L-RAND"
  SCM gswig_result;
  
  {
    gswig_result = scm_from_long(gswig_const_NLOPT_GN_DIRECT_L_RAND);
  }
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_NLOPT_GN_DIRECT_NOSCAL(SCM s_0)
{
#define FUNC_NAME "NLOPT-GN-DIRECT-NOSCAL"
  SCM gswig_result;
  
  {
    gswig_result = scm_from_long(gswig_const_NLOPT_GN_DIRECT_NOSCAL);
  }
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_NLOPT_GN_DIRECT_L_NOSCAL(SCM s_0)
{
#define FUNC_NAME "NLOPT-GN-DIRECT-L-NOSCAL"
  SCM gswig_result;
  
  {
    gswig_result = scm_from_long(gswig_const_NLOPT_GN_DIRECT_L_NOSCAL);
  }
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_NLOPT_GN_DIRECT_L_RAND_NOSCAL(SCM s_0)
{
#define FUNC_NAME "NLOPT-GN-DIRECT-L-RAND-NOSCAL"
  SCM gswig_result;
  
  {
    gswig_result = scm_from_long(gswig_const_NLOPT_GN_DIRECT_L_RAND_NOSCAL);
  }
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_NLOPT_GN_ORIG_DIRECT(SCM s_0)
{
#define FUNC_NAME "NLOPT-GN-ORIG-DIRECT"
  SCM gswig_result;
  
  {
    gswig_result = scm_from_long(gswig_const_NLOPT_GN_ORIG_DIRECT);
  }
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_NLOPT_GN_ORIG_DIRECT_L(SCM s_0)
{
#define FUNC_NAME "NLOPT-GN-ORIG-DIRECT-L"
  SCM gswig_result;
  
  {
    gswig_result = scm_from_long(gswig_const_NLOPT_GN_ORIG_DIRECT_L);
  }
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_NLOPT_GD_STOGO(SCM s_0)
{
#define FUNC_NAME "NLOPT-GD-STOGO"
  SCM gswig_result;
  
  {
    gswig_result = scm_from_long(gswig_const_NLOPT_GD_STOGO);
  }
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_NLOPT_GD_STOGO_RAND(SCM s_0)
{
#define FUNC_NAME "NLOPT-GD-STOGO-RAND"
  SCM gswig_result;
  
  {
    gswig_result = scm_from_long(gswig_const_NLOPT_GD_STOGO_RAND);
  }
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_NLOPT_LD_LBFGS_NOCEDAL(SCM s_0)
{
#define FUNC_NAME "NLOPT-LD-LBFGS-NOCEDAL"
  SCM gswig_result;
  
  {
    gswig_result = scm_from_long(gswig_const_NLOPT_LD_LBFGS_NOCEDAL);
  }
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_NLOPT_LD_LBFGS(SCM s_0)
{
#define FUNC_NAME "NLOPT-LD-LBFGS"
  SCM gswig_result;
  
  {
    gswig_result = scm_from_long(gswig_const_NLOPT_LD_LBFGS);
  }
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_NLOPT_LN_PRAXIS(SCM s_0)
{
#define FUNC_NAME "NLOPT-LN-PRAXIS"
  SCM gswig_result;
  
  {
    gswig_result = scm_from_long(gswig_const_NLOPT_LN_PRAXIS);
  }
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_NLOPT_LD_VAR1(SCM s_0)
{
#define FUNC_NAME "NLOPT-LD-VAR1"
  SCM gswig_result;
  
  {
    gswig_result = scm_from_long(gswig_const_NLOPT_LD_VAR1);
  }
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_NLOPT_LD_VAR2(SCM s_0)
{
#define FUNC_NAME "NLOPT-LD-VAR2"
  SCM gswig_result;
  
  {
    gswig_result = scm_from_long(gswig_const_NLOPT_LD_VAR2);
  }
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_NLOPT_LD_TNEWTON(SCM s_0)
{
#define FUNC_NAME "NLOPT-LD-TNEWTON"
  SCM gswig_result;
  
  {
    gswig_result = scm_from_long(gswig_const_NLOPT_LD_TNEWTON);
  }
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_NLOPT_LD_TNEWTON_RESTART(SCM s_0)
{
#define FUNC_NAME "NLOPT-LD-TNEWTON-RESTART"
  SCM gswig_result;
  
  {
    gswig_result = scm_from_long(gswig_const_NLOPT_LD_TNEWTON_RESTART);
  }
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_NLOPT_LD_TNEWTON_PRECOND(SCM s_0)
{
#define FUNC_NAME "NLOPT-LD-TNEWTON-PRECOND"
  SCM gswig_result;
  
  {
    gswig_result = scm_from_long(gswig_const_NLOPT_LD_TNEWTON_PRECOND);
  }
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_NLOPT_LD_TNEWTON_PRECOND_RESTART(SCM s_0)
{
#define FUNC_NAME "NLOPT-LD-TNEWTON-PRECOND-RESTART"
  SCM gswig_result;
  
  {
    gswig_result = scm_from_long(gswig_const_NLOPT_LD_TNEWTON_PRECOND_RESTART);
  }
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_NLOPT_GN_CRS2_LM(SCM s_0)
{
#define FUNC_NAME "NLOPT-GN-CRS2-LM"
  SCM gswig_result;
  
  {
    gswig_result = scm_from_long(gswig_const_NLOPT_GN_CRS2_LM);
  }
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_NLOPT_GN_MLSL(SCM s_0)
{
#define FUNC_NAME "NLOPT-GN-MLSL"
  SCM gswig_result;
  
  {
    gswig_result = scm_from_long(gswig_const_NLOPT_GN_MLSL);
  }
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_NLOPT_GD_MLSL(SCM s_0)
{
#define FUNC_NAME "NLOPT-GD-MLSL"
  SCM gswig_result;
  
  {
    gswig_result = scm_from_long(gswig_const_NLOPT_GD_MLSL);
  }
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_NLOPT_GN_MLSL_LDS(SCM s_0)
{
#define FUNC_NAME "NLOPT-GN-MLSL-LDS"
  SCM gswig_result;
  
  {
    gswig_result = scm_from_long(gswig_const_NLOPT_GN_MLSL_LDS);
  }
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_NLOPT_GD_MLSL_LDS(SCM s_0)
{
#define FUNC_NAME "NLOPT-GD-MLSL-LDS"
  SCM gswig_result;
  
  {
    gswig_result = scm_from_long(gswig_const_NLOPT_GD_MLSL_LDS);
  }
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_NLOPT_LD_MMA(SCM s_0)
{
#define FUNC_NAME "NLOPT-LD-MMA"
  SCM gswig_result;
  
  {
    gswig_result = scm_from_long(gswig_const_NLOPT_LD_MMA);
  }
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_NLOPT_LN_COBYLA(SCM s_0)
{
#define FUNC_NAME "NLOPT-LN-COBYLA"
  SCM gswig_result;
  
  {
    gswig_result = scm_from_long(gswig_const_NLOPT_LN_COBYLA);
  }
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_NLOPT_LN_NEWUOA(SCM s_0)
{
#define FUNC_NAME "NLOPT-LN-NEWUOA"
  SCM gswig_result;
  
  {
    gswig_result = scm_from_long(gswig_const_NLOPT_LN_NEWUOA);
  }
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_NLOPT_LN_NEWUOA_BOUND(SCM s_0)
{
#define FUNC_NAME "NLOPT-LN-NEWUOA-BOUND"
  SCM gswig_result;
  
  {
    gswig_result = scm_from_long(gswig_const_NLOPT_LN_NEWUOA_BOUND);
  }
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_NLOPT_LN_NELDERMEAD(SCM s_0)
{
#define FUNC_NAME "NLOPT-LN-NELDERMEAD"
  SCM gswig_result;
  
  {
    gswig_result = scm_from_long(gswig_const_NLOPT_LN_NELDERMEAD);
  }
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_NLOPT_LN_SBPLX(SCM s_0)
{
#define FUNC_NAME "NLOPT-LN-SBPLX"
  SCM gswig_result;
  
  {
    gswig_result = scm_from_long(gswig_const_NLOPT_LN_SBPLX);
  }
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_NLOPT_LN_AUGLAG(SCM s_0)
{
#define FUNC_NAME "NLOPT-LN-AUGLAG"
  SCM gswig_result;
  
  {
    gswig_result = scm_from_long(gswig_const_NLOPT_LN_AUGLAG);
  }
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_NLOPT_LD_AUGLAG(SCM s_0)
{
#define FUNC_NAME "NLOPT-LD-AUGLAG"
  SCM gswig_result;
  
  {
    gswig_result = scm_from_long(gswig_const_NLOPT_LD_AUGLAG);
  }
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_NLOPT_LN_AUGLAG_EQ(SCM s_0)
{
#define FUNC_NAME "NLOPT-LN-AUGLAG-EQ"
  SCM gswig_result;
  
  {
    gswig_result = scm_from_long(gswig_const_NLOPT_LN_AUGLAG_EQ);
  }
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_NLOPT_LD_AUGLAG_EQ(SCM s_0)
{
#define FUNC_NAME "NLOPT-LD-AUGLAG-EQ"
  SCM gswig_result;
  
  {
    gswig_result = scm_from_long(gswig_const_NLOPT_LD_AUGLAG_EQ);
  }
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_NLOPT_LN_BOBYQA(SCM s_0)
{
#define FUNC_NAME "NLOPT-LN-BOBYQA"
  SCM gswig_result;
  
  {
    gswig_result = scm_from_long(gswig_const_NLOPT_LN_BOBYQA);
  }
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_NLOPT_GN_ISRES(SCM s_0)
{
#define FUNC_NAME "NLOPT-GN-ISRES"
  SCM gswig_result;
  
  {
    gswig_result = scm_from_long(gswig_const_NLOPT_GN_ISRES);
  }
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_NLOPT_AUGLAG(SCM s_0)
{
#define FUNC_NAME "NLOPT-AUGLAG"
  SCM gswig_result;
  
  {
    gswig_result = scm_from_long(gswig_const_NLOPT_AUGLAG);
  }
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_NLOPT_AUGLAG_EQ(SCM s_0)
{
#define FUNC_NAME "NLOPT-AUGLAG-EQ"
  SCM gswig_result;
  
  {
    gswig_result = scm_from_long(gswig_const_NLOPT_AUGLAG_EQ);
  }
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_NLOPT_G_MLSL(SCM s_0)
{
#define FUNC_NAME "NLOPT-G-MLSL"
  SCM gswig_result;
  
  {
    gswig_result = scm_from_long(gswig_const_NLOPT_G_MLSL);
  }
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_NLOPT_G_MLSL_LDS(SCM s_0)
{
#define FUNC_NAME "NLOPT-G-MLSL-LDS"
  SCM gswig_result;
  
  {
    gswig_result = scm_from_long(gswig_const_NLOPT_G_MLSL_LDS);
  }
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_NLOPT_LD_SLSQP(SCM s_0)
{
#define FUNC_NAME "NLOPT-LD-SLSQP"
  SCM gswig_result;
  
  {
    gswig_result = scm_from_long(gswig_const_NLOPT_LD_SLSQP);
  }
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_NLOPT_LD_CCSAQ(SCM s_0)
{
#define FUNC_NAME "NLOPT-LD-CCSAQ"
  SCM gswig_result;
  
  {
    gswig_result = scm_from_long(gswig_const_NLOPT_LD_CCSAQ);
  }
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_NLOPT_GN_ESCH(SCM s_0)
{
#define FUNC_NAME "NLOPT-GN-ESCH"
  SCM gswig_result;
  
  {
    gswig_result = scm_from_long(gswig_const_NLOPT_GN_ESCH);
  }
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_NLOPT_NUM_ALGORITHMS(SCM s_0)
{
#define FUNC_NAME "NLOPT-NUM-ALGORITHMS"
  SCM gswig_result;
  
  {
    gswig_result = scm_from_long(gswig_const_NLOPT_NUM_ALGORITHMS);
  }
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_NLOPT_FAILURE(SCM s_0)
{
#define FUNC_NAME "NLOPT-FAILURE"
  SCM gswig_result;
  
  {
    gswig_result = scm_from_long(gswig_const_NLOPT_FAILURE);
  }
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_NLOPT_INVALID_ARGS(SCM s_0)
{
#define FUNC_NAME "NLOPT-INVALID-ARGS"
  SCM gswig_result;
  
  {
    gswig_result = scm_from_long(gswig_const_NLOPT_INVALID_ARGS);
  }
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_NLOPT_OUT_OF_MEMORY(SCM s_0)
{
#define FUNC_NAME "NLOPT-OUT-OF-MEMORY"
  SCM gswig_result;
  
  {
    gswig_result = scm_from_long(gswig_const_NLOPT_OUT_OF_MEMORY);
  }
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_NLOPT_ROUNDOFF_LIMITED(SCM s_0)
{
#define FUNC_NAME "NLOPT-ROUNDOFF-LIMITED"
  SCM gswig_result;
  
  {
    gswig_result = scm_from_long(gswig_const_NLOPT_ROUNDOFF_LIMITED);
  }
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_NLOPT_FORCED_STOP(SCM s_0)
{
#define FUNC_NAME "NLOPT-FORCED-STOP"
  SCM gswig_result;
  
  {
    gswig_result = scm_from_long(gswig_const_NLOPT_FORCED_STOP);
  }
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_NLOPT_SUCCESS(SCM s_0)
{
#define FUNC_NAME "NLOPT-SUCCESS"
  SCM gswig_result;
  
  {
    gswig_result = scm_from_long(gswig_const_NLOPT_SUCCESS);
  }
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_NLOPT_STOPVAL_REACHED(SCM s_0)
{
#define FUNC_NAME "NLOPT-STOPVAL-REACHED"
  SCM gswig_result;
  
  {
    gswig_result = scm_from_long(gswig_const_NLOPT_STOPVAL_REACHED);
  }
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_NLOPT_FTOL_REACHED(SCM s_0)
{
#define FUNC_NAME "NLOPT-FTOL-REACHED"
  SCM gswig_result;
  
  {
    gswig_result = scm_from_long(gswig_const_NLOPT_FTOL_REACHED);
  }
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_NLOPT_XTOL_REACHED(SCM s_0)
{
#define FUNC_NAME "NLOPT-XTOL-REACHED"
  SCM gswig_result;
  
  {
    gswig_result = scm_from_long(gswig_const_NLOPT_XTOL_REACHED);
  }
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_NLOPT_MAXEVAL_REACHED(SCM s_0)
{
#define FUNC_NAME "NLOPT-MAXEVAL-REACHED"
  SCM gswig_result;
  
  {
    gswig_result = scm_from_long(gswig_const_NLOPT_MAXEVAL_REACHED);
  }
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_NLOPT_MAXTIME_REACHED(SCM s_0)
{
#define FUNC_NAME "NLOPT-MAXTIME-REACHED"
  SCM gswig_result;
  
  {
    gswig_result = scm_from_long(gswig_const_NLOPT_MAXTIME_REACHED);
  }
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_new_nlopt_roundoff_limited ()
{
#define FUNC_NAME "new-nlopt-roundoff-limited"
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  nlopt::roundoff_limited *result = 0 ;
  
  result = (nlopt::roundoff_limited *)new nlopt::roundoff_limited();
  {
    gswig_result = SWIG_NewPointerObj (result, SWIGTYPE_p_nlopt__roundoff_limited, 1);
  }
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_delete_nlopt_roundoff_limited (SCM s_0)
{
#define FUNC_NAME "delete-nlopt-roundoff-limited"
  nlopt::roundoff_limited *arg1 = (nlopt::roundoff_limited *) 0 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  
  {
    arg1 = (nlopt::roundoff_limited *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_nlopt__roundoff_limited, 1, 0);
  }
  delete arg1;
  gswig_result = SCM_UNSPECIFIED;
  
  SWIG_Guile_MarkPointerDestroyed(s_0);
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_new_nlopt_forced_stop ()
{
#define FUNC_NAME "new-nlopt-forced-stop"
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  nlopt::forced_stop *result = 0 ;
  
  result = (nlopt::forced_stop *)new nlopt::forced_stop();
  {
    gswig_result = SWIG_NewPointerObj (result, SWIGTYPE_p_nlopt__forced_stop, 1);
  }
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_delete_nlopt_forced_stop (SCM s_0)
{
#define FUNC_NAME "delete-nlopt-forced-stop"
  nlopt::forced_stop *arg1 = (nlopt::forced_stop *) 0 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  
  {
    arg1 = (nlopt::forced_stop *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_nlopt__forced_stop, 1, 0);
  }
  delete arg1;
  gswig_result = SCM_UNSPECIFIED;
  
  SWIG_Guile_MarkPointerDestroyed(s_0);
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_new_nlopt_opt__SWIG_0 (int argc, SCM *argv)
{
#define FUNC_NAME "new-nlopt-opt"
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  nlopt::opt *result = 0 ;
  
  try {
    result = (nlopt::opt *)new nlopt::opt();
  }
  catch(std::bad_alloc &_e) {
    scm_throw(gh_symbol2scm("bad-alloc"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  
  {
    gswig_result = SWIG_NewPointerObj (result, SWIGTYPE_p_nlopt__opt, 1);
  }
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_delete_nlopt_opt (SCM s_0)
{
#define FUNC_NAME "delete-nlopt-opt"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  delete arg1;
  gswig_result = SCM_UNSPECIFIED;
  
  SWIG_Guile_MarkPointerDestroyed(s_0);
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_new_nlopt_opt__SWIG_1 (int argc, SCM *argv)
{
#define FUNC_NAME "new-nlopt-opt"
  nlopt::algorithm arg1 ;
  unsigned int arg2 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  nlopt::opt *result = 0 ;
  
  {
    arg1 = (nlopt::algorithm) scm_to_int(argv[0]); 
  }
  {
    arg2 = (unsigned int) scm_to_uint(argv[1]);
  }
  try {
    result = (nlopt::opt *)new nlopt::opt(arg1,arg2);
  }
  catch(std::bad_alloc &_e) {
    scm_throw(gh_symbol2scm("bad-alloc"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  
  {
    gswig_result = SWIG_NewPointerObj (result, SWIGTYPE_p_nlopt__opt, 1);
  }
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_new_nlopt_opt__SWIG_2 (int argc, SCM *argv)
{
#define FUNC_NAME "new-nlopt-opt"
  nlopt::opt *arg1 = 0 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  nlopt::opt *result = 0 ;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  try {
    result = (nlopt::opt *)new nlopt::opt((nlopt::opt const &)*arg1);
  }
  catch(std::bad_alloc &_e) {
    scm_throw(gh_symbol2scm("bad-alloc"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  
  {
    gswig_result = SWIG_NewPointerObj (result, SWIGTYPE_p_nlopt__opt, 1);
  }
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_new_nlopt_opt(SCM rest)
{
#define FUNC_NAME "new-nlopt-opt"
  SCM argv[2];
  int argc = SWIG_Guile_GetArgs (argv, rest, 0, 2, "new-nlopt-opt");
  if (argc == 0) {
    return _wrap_new_nlopt_opt__SWIG_0(argc,argv);
  }
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      return _wrap_new_nlopt_opt__SWIG_2(argc,argv);
    }
  }
  if (argc == 2) {
    int _v;
    {
      _v = scm_is_true(scm_integer_p(argv[0])) && scm_is_true(scm_exact_p(argv[0]))? 1 : 0;
    }
    if (_v) {
      {
        _v = scm_is_true(scm_integer_p(argv[1])) && scm_is_true(scm_exact_p(argv[1]))? 1 : 0;
      }
      if (_v) {
        return _wrap_new_nlopt_opt__SWIG_1(argc,argv);
      }
    }
  }
  
  scm_misc_error("new-nlopt-opt", "No matching method for generic function `new_nlopt_opt'", SCM_EOL);
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_optimize__SWIG_0 (int argc, SCM *argv)
{
#define FUNC_NAME "nlopt-opt-optimize"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  std::vector< double > *arg2 = 0 ;
  double *arg3 = 0 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  nlopt::result result;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  {
    arg2 = (std::vector< double > *)SWIG_MustGetPtr(argv[1], SWIGTYPE_p_std__vectorT_double_t, 2, 0);
  }
  {
    arg3 = (double *)SWIG_MustGetPtr(argv[2], SWIGTYPE_p_double, 3, 0);
  }
  try {
    result = (nlopt::result)(arg1)->optimize(*arg2,*arg3);
  }
  catch(nlopt::roundoff_limited &_e) {
    scm_throw(gh_symbol2scm("roundoff-limited"), SCM_EOL);
    
  }
  catch(nlopt::forced_stop &_e) {
    scm_throw(gh_symbol2scm("forced-stop"), SCM_EOL);
    
  }
  catch(std::runtime_error &_e) {
    scm_throw(gh_symbol2scm("runtime-error"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  catch(std::bad_alloc &_e) {
    scm_throw(gh_symbol2scm("bad-alloc"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  catch(std::invalid_argument &_e) {
    scm_throw(gh_symbol2scm("invalid-argument"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  
  {
    gswig_result = scm_from_long(result); 
  }
  
  
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_optimize__SWIG_1 (int argc, SCM *argv)
{
#define FUNC_NAME "nlopt-opt-optimize"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  std::vector< double > *arg2 = 0 ;
  std::vector< double > temp2 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  std::vector< double > result;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  {
    if (scm_is_vector(argv[1])) {
      unsigned long size = scm_c_vector_length(argv[1]);
      temp2 = std::vector<double >(size);
      arg2 = &temp2;
      for (unsigned long i=0; i<size; i++) {
        SCM o = scm_vector_ref(argv[1],scm_from_ulong(i));
        if (scm_is_number(o))
        temp2[i] = (double)(scm_to_double(o));
        else
        scm_wrong_type_arg(FUNC_NAME, 2, argv[1]);
      }
    } else if (scm_is_null(argv[1])) {
      temp2 = std::vector<double >();
      arg2 = &temp2;
    } else if (scm_is_pair(argv[1])) {
      SCM v = scm_vector(argv[1]);
      unsigned long size = scm_c_vector_length(v);
      temp2 = std::vector<double >(size);
      arg2 = &temp2;
      for (unsigned long i=0; i<size; i++) {
        SCM o = scm_vector_ref(v,scm_from_ulong(i));
        if (scm_is_number(o))
        temp2[i] = (double)(scm_to_double(o));
        else
        scm_wrong_type_arg(FUNC_NAME, 2, argv[1]);
      }
    } else {
      arg2 = (std::vector< double > *) SWIG_MustGetPtr(argv[1],SWIGTYPE_p_std__vectorT_double_t,2, 0);
    }
  }
  try {
    result = (arg1)->optimize((std::vector< double > const &)*arg2);
  }
  catch(nlopt::roundoff_limited &_e) {
    scm_throw(gh_symbol2scm("roundoff-limited"), SCM_EOL);
    
  }
  catch(nlopt::forced_stop &_e) {
    scm_throw(gh_symbol2scm("forced-stop"), SCM_EOL);
    
  }
  catch(std::runtime_error &_e) {
    scm_throw(gh_symbol2scm("runtime-error"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  catch(std::bad_alloc &_e) {
    scm_throw(gh_symbol2scm("bad-alloc"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  catch(std::invalid_argument &_e) {
    scm_throw(gh_symbol2scm("invalid-argument"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  
  {
    gswig_result = scm_make_vector(scm_from_long((&result)->size()),SCM_UNSPECIFIED);
    for (unsigned int i=0; i<(&result)->size(); i++) {
      SCM x = scm_from_double(((std::vector< double > &)result)[i]);
      scm_vector_set_x(gswig_result,scm_from_long(i),x);
    }
  }
  
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_optimize(SCM rest)
{
#define FUNC_NAME "nlopt-opt-optimize"
  SCM argv[3];
  int argc = SWIG_Guile_GetArgs (argv, rest, 0, 3, "nlopt-opt-optimize");
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      {
        /* native sequence? */
        if (scm_is_vector(argv[1])) {
          unsigned int size = scm_c_vector_length(argv[1]);
          if (size == 0) {
            /* an empty sequence can be of any type */
            _v = 1;
          } else {
            /* check the first element only */
            double* x;
            SCM o = scm_vector_ref(argv[1],scm_from_ulong(0));
            _v = scm_is_number(o) ? 1 : 0;
          }
        } else if (scm_is_null(argv[1])) {
          /* again, an empty sequence can be of any type */
          _v = 1;
        } else if (scm_is_pair(argv[1])) {
          /* check the first element only */
          double* x;
          SCM head = SCM_CAR(argv[1]);
          _v = scm_is_number(head) ? 1 : 0;
        } else {
          /* wrapped vector? */
          std::vector<double >* v;
          _v = (SWIG_ConvertPtr(argv[1],(void **) &v, 
              SWIGTYPE_p_std__vectorT_double_t, 0) != -1) ? 1 : 0;
        }
      }
      if (_v) {
        return _wrap_nlopt_opt_optimize__SWIG_1(argc,argv);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      void *ptr;
      int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      {
        void *ptr;
        int res = SWIG_ConvertPtr(argv[1], &ptr, SWIGTYPE_p_std__vectorT_double_t, 0);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        {
          void *ptr;
          int res = SWIG_ConvertPtr(argv[2], &ptr, SWIGTYPE_p_double, 0);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_nlopt_opt_optimize__SWIG_0(argc,argv);
        }
      }
    }
  }
  
  scm_misc_error("nlopt-opt-optimize", "No matching method for generic function `nlopt_opt_optimize'", SCM_EOL);
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_last_optimize_result (SCM s_0)
{
#define FUNC_NAME "nlopt-opt-last-optimize-result"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  nlopt::result result;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  result = (nlopt::result)((nlopt::opt const *)arg1)->last_optimize_result();
  {
    gswig_result = scm_from_long(result); 
  }
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_last_optimum_value (SCM s_0)
{
#define FUNC_NAME "nlopt-opt-last-optimum-value"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  double result;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  result = (double)((nlopt::opt const *)arg1)->last_optimum_value();
  {
    gswig_result = scm_from_double(result);
  }
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_get_algorithm (SCM s_0)
{
#define FUNC_NAME "nlopt-opt-get-algorithm"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  nlopt::algorithm result;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  result = (nlopt::algorithm)((nlopt::opt const *)arg1)->get_algorithm();
  {
    gswig_result = scm_from_long(result); 
  }
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_get_algorithm_name (SCM s_0)
{
#define FUNC_NAME "nlopt-opt-get-algorithm-name"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  char *result = 0 ;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  result = (char *)((nlopt::opt const *)arg1)->get_algorithm_name();
  {
    gswig_result = SWIG_str02scm((const char *)result);
  }
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_get_dimension (SCM s_0)
{
#define FUNC_NAME "nlopt-opt-get-dimension"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  unsigned int result;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  result = (unsigned int)((nlopt::opt const *)arg1)->get_dimension();
  {
    gswig_result = scm_from_ulong(result);
  }
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_set_min_objective__SWIG_0 (int argc, SCM *argv)
{
#define FUNC_NAME "nlopt-opt-set-min-objective"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  nlopt::func arg2 ;
  void *arg3 = (void *) 0 ;
  nlopt::func *argp2 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  {
    argp2 = (nlopt::func *)SWIG_MustGetPtr(argv[1], SWIGTYPE_p_nlopt_func, 2, 0);
    arg2 = *argp2;
  }
  {
    arg3 = (void *)SWIG_MustGetPtr(argv[2], NULL, 3, 0);
  }
  try {
    (arg1)->set_min_objective(arg2,arg3);
  }
  catch(std::bad_alloc &_e) {
    scm_throw(gh_symbol2scm("bad-alloc"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  catch(std::invalid_argument &_e) {
    scm_throw(gh_symbol2scm("invalid-argument"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  
  gswig_result = SCM_UNSPECIFIED;
  
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_set_min_objective__SWIG_1 (int argc, SCM *argv)
{
#define FUNC_NAME "nlopt-opt-set-min-objective"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  nlopt::vfunc arg2 = (nlopt::vfunc) 0 ;
  void *arg3 = (void *) 0 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  {
    arg2 = (nlopt::vfunc)SWIG_MustGetPtr(argv[1], SWIGTYPE_p_f_r_q_const__std__vector__double___r_std__vector__double___p_void__double, 2, 0);
  }
  {
    arg3 = (void *)SWIG_MustGetPtr(argv[2], NULL, 3, 0);
  }
  try {
    (arg1)->set_min_objective(arg2,arg3);
  }
  catch(std::bad_alloc &_e) {
    scm_throw(gh_symbol2scm("bad-alloc"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  catch(std::invalid_argument &_e) {
    scm_throw(gh_symbol2scm("invalid-argument"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  
  gswig_result = SCM_UNSPECIFIED;
  
  
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_set_max_objective__SWIG_0 (int argc, SCM *argv)
{
#define FUNC_NAME "nlopt-opt-set-max-objective"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  nlopt::func arg2 ;
  void *arg3 = (void *) 0 ;
  nlopt::func *argp2 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  {
    argp2 = (nlopt::func *)SWIG_MustGetPtr(argv[1], SWIGTYPE_p_nlopt_func, 2, 0);
    arg2 = *argp2;
  }
  {
    arg3 = (void *)SWIG_MustGetPtr(argv[2], NULL, 3, 0);
  }
  try {
    (arg1)->set_max_objective(arg2,arg3);
  }
  catch(std::bad_alloc &_e) {
    scm_throw(gh_symbol2scm("bad-alloc"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  catch(std::invalid_argument &_e) {
    scm_throw(gh_symbol2scm("invalid-argument"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  
  gswig_result = SCM_UNSPECIFIED;
  
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_set_max_objective__SWIG_1 (int argc, SCM *argv)
{
#define FUNC_NAME "nlopt-opt-set-max-objective"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  nlopt::vfunc arg2 = (nlopt::vfunc) 0 ;
  void *arg3 = (void *) 0 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  {
    arg2 = (nlopt::vfunc)SWIG_MustGetPtr(argv[1], SWIGTYPE_p_f_r_q_const__std__vector__double___r_std__vector__double___p_void__double, 2, 0);
  }
  {
    arg3 = (void *)SWIG_MustGetPtr(argv[2], NULL, 3, 0);
  }
  try {
    (arg1)->set_max_objective(arg2,arg3);
  }
  catch(std::bad_alloc &_e) {
    scm_throw(gh_symbol2scm("bad-alloc"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  catch(std::invalid_argument &_e) {
    scm_throw(gh_symbol2scm("invalid-argument"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  
  gswig_result = SCM_UNSPECIFIED;
  
  
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_set_min_objective__SWIG_2 (int argc, SCM *argv)
{
#define FUNC_NAME "nlopt-opt-set-min-objective"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  nlopt::func arg2 ;
  void *arg3 = (void *) 0 ;
  nlopt_munge arg4 ;
  nlopt_munge arg5 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  {
    arg2 = func_guile;
    arg3 = dup_guilefunc((void*) argv[1]); // input = SCM pointer to Scheme function
    arg4 = free_guilefunc;
    arg5 = dup_guilefunc;
  }
  try {
    (arg1)->set_min_objective(arg2,arg3,arg4,arg5);
  }
  catch(std::bad_alloc &_e) {
    scm_throw(gh_symbol2scm("bad-alloc"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  catch(std::invalid_argument &_e) {
    scm_throw(gh_symbol2scm("invalid-argument"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  
  gswig_result = SCM_UNSPECIFIED;
  
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_set_min_objective(SCM rest)
{
#define FUNC_NAME "nlopt-opt-set-min-objective"
  SCM argv[3];
  int argc = SWIG_Guile_GetArgs (argv, rest, 0, 3, "nlopt-opt-set-min-objective");
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      {
        _v = SCM_NFALSEP(scm_procedure_p(argv[1]));
      }
      if (_v) {
        if (argc <= 2) {
          return _wrap_nlopt_opt_set_min_objective__SWIG_2(argc,argv);
        }
        if (argc <= 3) {
          return _wrap_nlopt_opt_set_min_objective__SWIG_2(argc,argv);
        }
        if (argc <= 4) {
          return _wrap_nlopt_opt_set_min_objective__SWIG_2(argc,argv);
        }
        return _wrap_nlopt_opt_set_min_objective__SWIG_2(argc,argv);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      void *ptr;
      int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      {
        void *ptr;
        int res = SWIG_ConvertPtr(argv[1], &ptr, SWIGTYPE_p_f_r_q_const__std__vector__double___r_std__vector__double___p_void__double, 0);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        {
          void *ptr;
          int res = SWIG_ConvertPtr(argv[2], &ptr, 0, 0);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_nlopt_opt_set_min_objective__SWIG_1(argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      void *ptr;
      int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      {
        void *ptr;
        int res = SWIG_ConvertPtr(argv[1], &ptr, SWIGTYPE_p_nlopt_func, 0);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        {
          void *ptr;
          int res = SWIG_ConvertPtr(argv[2], &ptr, 0, 0);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_nlopt_opt_set_min_objective__SWIG_0(argc,argv);
        }
      }
    }
  }
  
  scm_misc_error("nlopt-opt-set-min-objective", "No matching method for generic function `nlopt_opt_set_min_objective'", SCM_EOL);
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_set_max_objective__SWIG_2 (int argc, SCM *argv)
{
#define FUNC_NAME "nlopt-opt-set-max-objective"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  nlopt::func arg2 ;
  void *arg3 = (void *) 0 ;
  nlopt_munge arg4 ;
  nlopt_munge arg5 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  {
    arg2 = func_guile;
    arg3 = dup_guilefunc((void*) argv[1]); // input = SCM pointer to Scheme function
    arg4 = free_guilefunc;
    arg5 = dup_guilefunc;
  }
  try {
    (arg1)->set_max_objective(arg2,arg3,arg4,arg5);
  }
  catch(std::bad_alloc &_e) {
    scm_throw(gh_symbol2scm("bad-alloc"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  catch(std::invalid_argument &_e) {
    scm_throw(gh_symbol2scm("invalid-argument"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  
  gswig_result = SCM_UNSPECIFIED;
  
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_set_max_objective(SCM rest)
{
#define FUNC_NAME "nlopt-opt-set-max-objective"
  SCM argv[3];
  int argc = SWIG_Guile_GetArgs (argv, rest, 0, 3, "nlopt-opt-set-max-objective");
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      {
        _v = SCM_NFALSEP(scm_procedure_p(argv[1]));
      }
      if (_v) {
        if (argc <= 2) {
          return _wrap_nlopt_opt_set_max_objective__SWIG_2(argc,argv);
        }
        if (argc <= 3) {
          return _wrap_nlopt_opt_set_max_objective__SWIG_2(argc,argv);
        }
        if (argc <= 4) {
          return _wrap_nlopt_opt_set_max_objective__SWIG_2(argc,argv);
        }
        return _wrap_nlopt_opt_set_max_objective__SWIG_2(argc,argv);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      void *ptr;
      int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      {
        void *ptr;
        int res = SWIG_ConvertPtr(argv[1], &ptr, SWIGTYPE_p_f_r_q_const__std__vector__double___r_std__vector__double___p_void__double, 0);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        {
          void *ptr;
          int res = SWIG_ConvertPtr(argv[2], &ptr, 0, 0);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_nlopt_opt_set_max_objective__SWIG_1(argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      void *ptr;
      int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      {
        void *ptr;
        int res = SWIG_ConvertPtr(argv[1], &ptr, SWIGTYPE_p_nlopt_func, 0);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        {
          void *ptr;
          int res = SWIG_ConvertPtr(argv[2], &ptr, 0, 0);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_nlopt_opt_set_max_objective__SWIG_0(argc,argv);
        }
      }
    }
  }
  
  scm_misc_error("nlopt-opt-set-max-objective", "No matching method for generic function `nlopt_opt_set_max_objective'", SCM_EOL);
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_remove_inequality_constraints (SCM s_0)
{
#define FUNC_NAME "nlopt-opt-remove-inequality-constraints"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  try {
    (arg1)->remove_inequality_constraints();
  }
  catch(std::invalid_argument &_e) {
    scm_throw(gh_symbol2scm("invalid-argument"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  
  gswig_result = SCM_UNSPECIFIED;
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_add_inequality_constraint__SWIG_0 (int argc, SCM *argv)
{
#define FUNC_NAME "nlopt-opt-add-inequality-constraint"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  nlopt::func arg2 ;
  void *arg3 = (void *) 0 ;
  double arg4 ;
  nlopt::func *argp2 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  {
    argp2 = (nlopt::func *)SWIG_MustGetPtr(argv[1], SWIGTYPE_p_nlopt_func, 2, 0);
    arg2 = *argp2;
  }
  {
    arg3 = (void *)SWIG_MustGetPtr(argv[2], NULL, 3, 0);
  }
  {
    arg4 = (double) scm_to_double(argv[3]);
  }
  try {
    (arg1)->add_inequality_constraint(arg2,arg3,arg4);
  }
  catch(std::bad_alloc &_e) {
    scm_throw(gh_symbol2scm("bad-alloc"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  catch(std::invalid_argument &_e) {
    scm_throw(gh_symbol2scm("invalid-argument"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  
  gswig_result = SCM_UNSPECIFIED;
  
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_add_inequality_constraint__SWIG_1 (int argc, SCM *argv)
{
#define FUNC_NAME "nlopt-opt-add-inequality-constraint"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  nlopt::func arg2 ;
  void *arg3 = (void *) 0 ;
  nlopt::func *argp2 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  {
    argp2 = (nlopt::func *)SWIG_MustGetPtr(argv[1], SWIGTYPE_p_nlopt_func, 2, 0);
    arg2 = *argp2;
  }
  {
    arg3 = (void *)SWIG_MustGetPtr(argv[2], NULL, 3, 0);
  }
  try {
    (arg1)->add_inequality_constraint(arg2,arg3);
  }
  catch(std::bad_alloc &_e) {
    scm_throw(gh_symbol2scm("bad-alloc"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  catch(std::invalid_argument &_e) {
    scm_throw(gh_symbol2scm("invalid-argument"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  
  gswig_result = SCM_UNSPECIFIED;
  
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_add_inequality_constraint__SWIG_2 (int argc, SCM *argv)
{
#define FUNC_NAME "nlopt-opt-add-inequality-constraint"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  nlopt::vfunc arg2 = (nlopt::vfunc) 0 ;
  void *arg3 = (void *) 0 ;
  double arg4 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  {
    arg2 = (nlopt::vfunc)SWIG_MustGetPtr(argv[1], SWIGTYPE_p_f_r_q_const__std__vector__double___r_std__vector__double___p_void__double, 2, 0);
  }
  {
    arg3 = (void *)SWIG_MustGetPtr(argv[2], NULL, 3, 0);
  }
  {
    arg4 = (double) scm_to_double(argv[3]);
  }
  try {
    (arg1)->add_inequality_constraint(arg2,arg3,arg4);
  }
  catch(std::bad_alloc &_e) {
    scm_throw(gh_symbol2scm("bad-alloc"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  catch(std::invalid_argument &_e) {
    scm_throw(gh_symbol2scm("invalid-argument"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  
  gswig_result = SCM_UNSPECIFIED;
  
  
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_add_inequality_constraint__SWIG_3 (int argc, SCM *argv)
{
#define FUNC_NAME "nlopt-opt-add-inequality-constraint"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  nlopt::vfunc arg2 = (nlopt::vfunc) 0 ;
  void *arg3 = (void *) 0 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  {
    arg2 = (nlopt::vfunc)SWIG_MustGetPtr(argv[1], SWIGTYPE_p_f_r_q_const__std__vector__double___r_std__vector__double___p_void__double, 2, 0);
  }
  {
    arg3 = (void *)SWIG_MustGetPtr(argv[2], NULL, 3, 0);
  }
  try {
    (arg1)->add_inequality_constraint(arg2,arg3);
  }
  catch(std::bad_alloc &_e) {
    scm_throw(gh_symbol2scm("bad-alloc"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  catch(std::invalid_argument &_e) {
    scm_throw(gh_symbol2scm("invalid-argument"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  
  gswig_result = SCM_UNSPECIFIED;
  
  
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_add_inequality_mconstraint__SWIG_0 (int argc, SCM *argv)
{
#define FUNC_NAME "nlopt-opt-add-inequality-mconstraint"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  nlopt::mfunc arg2 ;
  void *arg3 = (void *) 0 ;
  std::vector< double > *arg4 = 0 ;
  nlopt::mfunc *argp2 ;
  std::vector< double > temp4 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  {
    argp2 = (nlopt::mfunc *)SWIG_MustGetPtr(argv[1], SWIGTYPE_p_nlopt_mfunc, 2, 0);
    arg2 = *argp2;
  }
  {
    arg3 = (void *)SWIG_MustGetPtr(argv[2], NULL, 3, 0);
  }
  {
    if (scm_is_vector(argv[3])) {
      unsigned long size = scm_c_vector_length(argv[3]);
      temp4 = std::vector<double >(size);
      arg4 = &temp4;
      for (unsigned long i=0; i<size; i++) {
        SCM o = scm_vector_ref(argv[3],scm_from_ulong(i));
        if (scm_is_number(o))
        temp4[i] = (double)(scm_to_double(o));
        else
        scm_wrong_type_arg(FUNC_NAME, 4, argv[3]);
      }
    } else if (scm_is_null(argv[3])) {
      temp4 = std::vector<double >();
      arg4 = &temp4;
    } else if (scm_is_pair(argv[3])) {
      SCM v = scm_vector(argv[3]);
      unsigned long size = scm_c_vector_length(v);
      temp4 = std::vector<double >(size);
      arg4 = &temp4;
      for (unsigned long i=0; i<size; i++) {
        SCM o = scm_vector_ref(v,scm_from_ulong(i));
        if (scm_is_number(o))
        temp4[i] = (double)(scm_to_double(o));
        else
        scm_wrong_type_arg(FUNC_NAME, 4, argv[3]);
      }
    } else {
      arg4 = (std::vector< double > *) SWIG_MustGetPtr(argv[3],SWIGTYPE_p_std__vectorT_double_t,4, 0);
    }
  }
  try {
    (arg1)->add_inequality_mconstraint(arg2,arg3,(std::vector< double > const &)*arg4);
  }
  catch(std::bad_alloc &_e) {
    scm_throw(gh_symbol2scm("bad-alloc"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  catch(std::invalid_argument &_e) {
    scm_throw(gh_symbol2scm("invalid-argument"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  
  gswig_result = SCM_UNSPECIFIED;
  
  
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_remove_equality_constraints (SCM s_0)
{
#define FUNC_NAME "nlopt-opt-remove-equality-constraints"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  try {
    (arg1)->remove_equality_constraints();
  }
  catch(std::invalid_argument &_e) {
    scm_throw(gh_symbol2scm("invalid-argument"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  
  gswig_result = SCM_UNSPECIFIED;
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_add_equality_constraint__SWIG_0 (int argc, SCM *argv)
{
#define FUNC_NAME "nlopt-opt-add-equality-constraint"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  nlopt::func arg2 ;
  void *arg3 = (void *) 0 ;
  double arg4 ;
  nlopt::func *argp2 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  {
    argp2 = (nlopt::func *)SWIG_MustGetPtr(argv[1], SWIGTYPE_p_nlopt_func, 2, 0);
    arg2 = *argp2;
  }
  {
    arg3 = (void *)SWIG_MustGetPtr(argv[2], NULL, 3, 0);
  }
  {
    arg4 = (double) scm_to_double(argv[3]);
  }
  try {
    (arg1)->add_equality_constraint(arg2,arg3,arg4);
  }
  catch(std::bad_alloc &_e) {
    scm_throw(gh_symbol2scm("bad-alloc"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  catch(std::invalid_argument &_e) {
    scm_throw(gh_symbol2scm("invalid-argument"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  
  gswig_result = SCM_UNSPECIFIED;
  
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_add_equality_constraint__SWIG_1 (int argc, SCM *argv)
{
#define FUNC_NAME "nlopt-opt-add-equality-constraint"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  nlopt::func arg2 ;
  void *arg3 = (void *) 0 ;
  nlopt::func *argp2 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  {
    argp2 = (nlopt::func *)SWIG_MustGetPtr(argv[1], SWIGTYPE_p_nlopt_func, 2, 0);
    arg2 = *argp2;
  }
  {
    arg3 = (void *)SWIG_MustGetPtr(argv[2], NULL, 3, 0);
  }
  try {
    (arg1)->add_equality_constraint(arg2,arg3);
  }
  catch(std::bad_alloc &_e) {
    scm_throw(gh_symbol2scm("bad-alloc"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  catch(std::invalid_argument &_e) {
    scm_throw(gh_symbol2scm("invalid-argument"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  
  gswig_result = SCM_UNSPECIFIED;
  
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_add_equality_constraint__SWIG_2 (int argc, SCM *argv)
{
#define FUNC_NAME "nlopt-opt-add-equality-constraint"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  nlopt::vfunc arg2 = (nlopt::vfunc) 0 ;
  void *arg3 = (void *) 0 ;
  double arg4 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  {
    arg2 = (nlopt::vfunc)SWIG_MustGetPtr(argv[1], SWIGTYPE_p_f_r_q_const__std__vector__double___r_std__vector__double___p_void__double, 2, 0);
  }
  {
    arg3 = (void *)SWIG_MustGetPtr(argv[2], NULL, 3, 0);
  }
  {
    arg4 = (double) scm_to_double(argv[3]);
  }
  try {
    (arg1)->add_equality_constraint(arg2,arg3,arg4);
  }
  catch(std::bad_alloc &_e) {
    scm_throw(gh_symbol2scm("bad-alloc"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  catch(std::invalid_argument &_e) {
    scm_throw(gh_symbol2scm("invalid-argument"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  
  gswig_result = SCM_UNSPECIFIED;
  
  
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_add_equality_constraint__SWIG_3 (int argc, SCM *argv)
{
#define FUNC_NAME "nlopt-opt-add-equality-constraint"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  nlopt::vfunc arg2 = (nlopt::vfunc) 0 ;
  void *arg3 = (void *) 0 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  {
    arg2 = (nlopt::vfunc)SWIG_MustGetPtr(argv[1], SWIGTYPE_p_f_r_q_const__std__vector__double___r_std__vector__double___p_void__double, 2, 0);
  }
  {
    arg3 = (void *)SWIG_MustGetPtr(argv[2], NULL, 3, 0);
  }
  try {
    (arg1)->add_equality_constraint(arg2,arg3);
  }
  catch(std::bad_alloc &_e) {
    scm_throw(gh_symbol2scm("bad-alloc"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  catch(std::invalid_argument &_e) {
    scm_throw(gh_symbol2scm("invalid-argument"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  
  gswig_result = SCM_UNSPECIFIED;
  
  
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_add_equality_mconstraint__SWIG_0 (int argc, SCM *argv)
{
#define FUNC_NAME "nlopt-opt-add-equality-mconstraint"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  nlopt::mfunc arg2 ;
  void *arg3 = (void *) 0 ;
  std::vector< double > *arg4 = 0 ;
  nlopt::mfunc *argp2 ;
  std::vector< double > temp4 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  {
    argp2 = (nlopt::mfunc *)SWIG_MustGetPtr(argv[1], SWIGTYPE_p_nlopt_mfunc, 2, 0);
    arg2 = *argp2;
  }
  {
    arg3 = (void *)SWIG_MustGetPtr(argv[2], NULL, 3, 0);
  }
  {
    if (scm_is_vector(argv[3])) {
      unsigned long size = scm_c_vector_length(argv[3]);
      temp4 = std::vector<double >(size);
      arg4 = &temp4;
      for (unsigned long i=0; i<size; i++) {
        SCM o = scm_vector_ref(argv[3],scm_from_ulong(i));
        if (scm_is_number(o))
        temp4[i] = (double)(scm_to_double(o));
        else
        scm_wrong_type_arg(FUNC_NAME, 4, argv[3]);
      }
    } else if (scm_is_null(argv[3])) {
      temp4 = std::vector<double >();
      arg4 = &temp4;
    } else if (scm_is_pair(argv[3])) {
      SCM v = scm_vector(argv[3]);
      unsigned long size = scm_c_vector_length(v);
      temp4 = std::vector<double >(size);
      arg4 = &temp4;
      for (unsigned long i=0; i<size; i++) {
        SCM o = scm_vector_ref(v,scm_from_ulong(i));
        if (scm_is_number(o))
        temp4[i] = (double)(scm_to_double(o));
        else
        scm_wrong_type_arg(FUNC_NAME, 4, argv[3]);
      }
    } else {
      arg4 = (std::vector< double > *) SWIG_MustGetPtr(argv[3],SWIGTYPE_p_std__vectorT_double_t,4, 0);
    }
  }
  try {
    (arg1)->add_equality_mconstraint(arg2,arg3,(std::vector< double > const &)*arg4);
  }
  catch(std::bad_alloc &_e) {
    scm_throw(gh_symbol2scm("bad-alloc"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  catch(std::invalid_argument &_e) {
    scm_throw(gh_symbol2scm("invalid-argument"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  
  gswig_result = SCM_UNSPECIFIED;
  
  
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_add_inequality_constraint__SWIG_4 (int argc, SCM *argv)
{
#define FUNC_NAME "nlopt-opt-add-inequality-constraint"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  nlopt::func arg2 ;
  void *arg3 = (void *) 0 ;
  nlopt_munge arg4 ;
  nlopt_munge arg5 ;
  double arg6 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  {
    arg2 = func_guile;
    arg3 = dup_guilefunc((void*) argv[1]); // input = SCM pointer to Scheme function
    arg4 = free_guilefunc;
    arg5 = dup_guilefunc;
  }
  {
    arg6 = (double) scm_to_double(argv[2]);
  }
  try {
    (arg1)->add_inequality_constraint(arg2,arg3,arg4,arg5,arg6);
  }
  catch(std::bad_alloc &_e) {
    scm_throw(gh_symbol2scm("bad-alloc"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  catch(std::invalid_argument &_e) {
    scm_throw(gh_symbol2scm("invalid-argument"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  
  gswig_result = SCM_UNSPECIFIED;
  
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_add_inequality_constraint__SWIG_5 (int argc, SCM *argv)
{
#define FUNC_NAME "nlopt-opt-add-inequality-constraint"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  nlopt::func arg2 ;
  void *arg3 = (void *) 0 ;
  nlopt_munge arg4 ;
  nlopt_munge arg5 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  {
    arg2 = func_guile;
    arg3 = dup_guilefunc((void*) argv[1]); // input = SCM pointer to Scheme function
    arg4 = free_guilefunc;
    arg5 = dup_guilefunc;
  }
  try {
    (arg1)->add_inequality_constraint(arg2,arg3,arg4,arg5);
  }
  catch(std::bad_alloc &_e) {
    scm_throw(gh_symbol2scm("bad-alloc"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  catch(std::invalid_argument &_e) {
    scm_throw(gh_symbol2scm("invalid-argument"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  
  gswig_result = SCM_UNSPECIFIED;
  
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_add_inequality_constraint(SCM rest)
{
#define FUNC_NAME "nlopt-opt-add-inequality-constraint"
  SCM argv[4];
  int argc = SWIG_Guile_GetArgs (argv, rest, 0, 4, "nlopt-opt-add-inequality-constraint");
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      {
        _v = SCM_NFALSEP(scm_procedure_p(argv[1]));
      }
      if (_v) {
        if (argc <= 2) {
          return _wrap_nlopt_opt_add_inequality_constraint__SWIG_5(argc,argv);
        }
        if (argc <= 3) {
          return _wrap_nlopt_opt_add_inequality_constraint__SWIG_5(argc,argv);
        }
        if (argc <= 4) {
          return _wrap_nlopt_opt_add_inequality_constraint__SWIG_5(argc,argv);
        }
        return _wrap_nlopt_opt_add_inequality_constraint__SWIG_5(argc,argv);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      void *ptr;
      int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      {
        void *ptr;
        int res = SWIG_ConvertPtr(argv[1], &ptr, SWIGTYPE_p_f_r_q_const__std__vector__double___r_std__vector__double___p_void__double, 0);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        {
          void *ptr;
          int res = SWIG_ConvertPtr(argv[2], &ptr, 0, 0);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_nlopt_opt_add_inequality_constraint__SWIG_3(argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      void *ptr;
      int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      {
        _v = SCM_NFALSEP(scm_procedure_p(argv[1]));
      }
      if (_v) {
        {
          _v = scm_is_true(scm_real_p(argv[2])) ? 1 : 0;
        }
        if (_v) {
          return _wrap_nlopt_opt_add_inequality_constraint__SWIG_4(argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      void *ptr;
      int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      {
        void *ptr;
        int res = SWIG_ConvertPtr(argv[1], &ptr, SWIGTYPE_p_nlopt_func, 0);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        {
          void *ptr;
          int res = SWIG_ConvertPtr(argv[2], &ptr, 0, 0);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_nlopt_opt_add_inequality_constraint__SWIG_1(argc,argv);
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    {
      void *ptr;
      int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      {
        void *ptr;
        int res = SWIG_ConvertPtr(argv[1], &ptr, SWIGTYPE_p_f_r_q_const__std__vector__double___r_std__vector__double___p_void__double, 0);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        {
          void *ptr;
          int res = SWIG_ConvertPtr(argv[2], &ptr, 0, 0);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          {
            _v = scm_is_true(scm_real_p(argv[3])) ? 1 : 0;
          }
          if (_v) {
            return _wrap_nlopt_opt_add_inequality_constraint__SWIG_2(argc,argv);
          }
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    {
      void *ptr;
      int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      {
        void *ptr;
        int res = SWIG_ConvertPtr(argv[1], &ptr, SWIGTYPE_p_nlopt_func, 0);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        {
          void *ptr;
          int res = SWIG_ConvertPtr(argv[2], &ptr, 0, 0);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          {
            _v = scm_is_true(scm_real_p(argv[3])) ? 1 : 0;
          }
          if (_v) {
            return _wrap_nlopt_opt_add_inequality_constraint__SWIG_0(argc,argv);
          }
        }
      }
    }
  }
  
  scm_misc_error("nlopt-opt-add-inequality-constraint", "No matching method for generic function `nlopt_opt_add_inequality_constraint'", SCM_EOL);
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_add_equality_constraint__SWIG_4 (int argc, SCM *argv)
{
#define FUNC_NAME "nlopt-opt-add-equality-constraint"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  nlopt::func arg2 ;
  void *arg3 = (void *) 0 ;
  nlopt_munge arg4 ;
  nlopt_munge arg5 ;
  double arg6 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  {
    arg2 = func_guile;
    arg3 = dup_guilefunc((void*) argv[1]); // input = SCM pointer to Scheme function
    arg4 = free_guilefunc;
    arg5 = dup_guilefunc;
  }
  {
    arg6 = (double) scm_to_double(argv[2]);
  }
  try {
    (arg1)->add_equality_constraint(arg2,arg3,arg4,arg5,arg6);
  }
  catch(std::bad_alloc &_e) {
    scm_throw(gh_symbol2scm("bad-alloc"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  catch(std::invalid_argument &_e) {
    scm_throw(gh_symbol2scm("invalid-argument"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  
  gswig_result = SCM_UNSPECIFIED;
  
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_add_equality_constraint__SWIG_5 (int argc, SCM *argv)
{
#define FUNC_NAME "nlopt-opt-add-equality-constraint"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  nlopt::func arg2 ;
  void *arg3 = (void *) 0 ;
  nlopt_munge arg4 ;
  nlopt_munge arg5 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  {
    arg2 = func_guile;
    arg3 = dup_guilefunc((void*) argv[1]); // input = SCM pointer to Scheme function
    arg4 = free_guilefunc;
    arg5 = dup_guilefunc;
  }
  try {
    (arg1)->add_equality_constraint(arg2,arg3,arg4,arg5);
  }
  catch(std::bad_alloc &_e) {
    scm_throw(gh_symbol2scm("bad-alloc"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  catch(std::invalid_argument &_e) {
    scm_throw(gh_symbol2scm("invalid-argument"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  
  gswig_result = SCM_UNSPECIFIED;
  
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_add_equality_constraint(SCM rest)
{
#define FUNC_NAME "nlopt-opt-add-equality-constraint"
  SCM argv[4];
  int argc = SWIG_Guile_GetArgs (argv, rest, 0, 4, "nlopt-opt-add-equality-constraint");
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      {
        _v = SCM_NFALSEP(scm_procedure_p(argv[1]));
      }
      if (_v) {
        if (argc <= 2) {
          return _wrap_nlopt_opt_add_equality_constraint__SWIG_5(argc,argv);
        }
        if (argc <= 3) {
          return _wrap_nlopt_opt_add_equality_constraint__SWIG_5(argc,argv);
        }
        if (argc <= 4) {
          return _wrap_nlopt_opt_add_equality_constraint__SWIG_5(argc,argv);
        }
        return _wrap_nlopt_opt_add_equality_constraint__SWIG_5(argc,argv);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      void *ptr;
      int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      {
        void *ptr;
        int res = SWIG_ConvertPtr(argv[1], &ptr, SWIGTYPE_p_f_r_q_const__std__vector__double___r_std__vector__double___p_void__double, 0);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        {
          void *ptr;
          int res = SWIG_ConvertPtr(argv[2], &ptr, 0, 0);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_nlopt_opt_add_equality_constraint__SWIG_3(argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      void *ptr;
      int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      {
        _v = SCM_NFALSEP(scm_procedure_p(argv[1]));
      }
      if (_v) {
        {
          _v = scm_is_true(scm_real_p(argv[2])) ? 1 : 0;
        }
        if (_v) {
          return _wrap_nlopt_opt_add_equality_constraint__SWIG_4(argc,argv);
        }
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      void *ptr;
      int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      {
        void *ptr;
        int res = SWIG_ConvertPtr(argv[1], &ptr, SWIGTYPE_p_nlopt_func, 0);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        {
          void *ptr;
          int res = SWIG_ConvertPtr(argv[2], &ptr, 0, 0);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_nlopt_opt_add_equality_constraint__SWIG_1(argc,argv);
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    {
      void *ptr;
      int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      {
        void *ptr;
        int res = SWIG_ConvertPtr(argv[1], &ptr, SWIGTYPE_p_f_r_q_const__std__vector__double___r_std__vector__double___p_void__double, 0);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        {
          void *ptr;
          int res = SWIG_ConvertPtr(argv[2], &ptr, 0, 0);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          {
            _v = scm_is_true(scm_real_p(argv[3])) ? 1 : 0;
          }
          if (_v) {
            return _wrap_nlopt_opt_add_equality_constraint__SWIG_2(argc,argv);
          }
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    {
      void *ptr;
      int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      {
        void *ptr;
        int res = SWIG_ConvertPtr(argv[1], &ptr, SWIGTYPE_p_nlopt_func, 0);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        {
          void *ptr;
          int res = SWIG_ConvertPtr(argv[2], &ptr, 0, 0);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          {
            _v = scm_is_true(scm_real_p(argv[3])) ? 1 : 0;
          }
          if (_v) {
            return _wrap_nlopt_opt_add_equality_constraint__SWIG_0(argc,argv);
          }
        }
      }
    }
  }
  
  scm_misc_error("nlopt-opt-add-equality-constraint", "No matching method for generic function `nlopt_opt_add_equality_constraint'", SCM_EOL);
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_add_inequality_mconstraint__SWIG_1 (int argc, SCM *argv)
{
#define FUNC_NAME "nlopt-opt-add-inequality-mconstraint"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  nlopt::mfunc arg2 ;
  void *arg3 = (void *) 0 ;
  nlopt_munge arg4 ;
  nlopt_munge arg5 ;
  std::vector< double > *arg6 = 0 ;
  nlopt::mfunc *argp2 ;
  nlopt_munge *argp4 ;
  nlopt_munge *argp5 ;
  std::vector< double > temp6 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  {
    argp2 = (nlopt::mfunc *)SWIG_MustGetPtr(argv[1], SWIGTYPE_p_nlopt_mfunc, 2, 0);
    arg2 = *argp2;
  }
  {
    arg3 = (void *)SWIG_MustGetPtr(argv[2], NULL, 3, 0);
  }
  {
    argp4 = (nlopt_munge *)SWIG_MustGetPtr(argv[3], SWIGTYPE_p_nlopt_munge, 4, 0);
    arg4 = *argp4;
  }
  {
    argp5 = (nlopt_munge *)SWIG_MustGetPtr(argv[4], SWIGTYPE_p_nlopt_munge, 5, 0);
    arg5 = *argp5;
  }
  {
    if (scm_is_vector(argv[5])) {
      unsigned long size = scm_c_vector_length(argv[5]);
      temp6 = std::vector<double >(size);
      arg6 = &temp6;
      for (unsigned long i=0; i<size; i++) {
        SCM o = scm_vector_ref(argv[5],scm_from_ulong(i));
        if (scm_is_number(o))
        temp6[i] = (double)(scm_to_double(o));
        else
        scm_wrong_type_arg(FUNC_NAME, 6, argv[5]);
      }
    } else if (scm_is_null(argv[5])) {
      temp6 = std::vector<double >();
      arg6 = &temp6;
    } else if (scm_is_pair(argv[5])) {
      SCM v = scm_vector(argv[5]);
      unsigned long size = scm_c_vector_length(v);
      temp6 = std::vector<double >(size);
      arg6 = &temp6;
      for (unsigned long i=0; i<size; i++) {
        SCM o = scm_vector_ref(v,scm_from_ulong(i));
        if (scm_is_number(o))
        temp6[i] = (double)(scm_to_double(o));
        else
        scm_wrong_type_arg(FUNC_NAME, 6, argv[5]);
      }
    } else {
      arg6 = (std::vector< double > *) SWIG_MustGetPtr(argv[5],SWIGTYPE_p_std__vectorT_double_t,6, 0);
    }
  }
  try {
    (arg1)->add_inequality_mconstraint(arg2,arg3,arg4,arg5,(std::vector< double > const &)*arg6);
  }
  catch(std::bad_alloc &_e) {
    scm_throw(gh_symbol2scm("bad-alloc"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  catch(std::invalid_argument &_e) {
    scm_throw(gh_symbol2scm("invalid-argument"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  
  gswig_result = SCM_UNSPECIFIED;
  
  
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_add_inequality_mconstraint(SCM rest)
{
#define FUNC_NAME "nlopt-opt-add-inequality-mconstraint"
  SCM argv[6];
  int argc = SWIG_Guile_GetArgs (argv, rest, 0, 6, "nlopt-opt-add-inequality-mconstraint");
  if (argc == 4) {
    int _v;
    {
      void *ptr;
      int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      {
        void *ptr;
        int res = SWIG_ConvertPtr(argv[1], &ptr, SWIGTYPE_p_nlopt_mfunc, 0);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        {
          void *ptr;
          int res = SWIG_ConvertPtr(argv[2], &ptr, 0, 0);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          {
            /* native sequence? */
            if (scm_is_vector(argv[3])) {
              unsigned int size = scm_c_vector_length(argv[3]);
              if (size == 0) {
                /* an empty sequence can be of any type */
                _v = 1;
              } else {
                /* check the first element only */
                double* x;
                SCM o = scm_vector_ref(argv[3],scm_from_ulong(0));
                _v = scm_is_number(o) ? 1 : 0;
              }
            } else if (scm_is_null(argv[3])) {
              /* again, an empty sequence can be of any type */
              _v = 1;
            } else if (scm_is_pair(argv[3])) {
              /* check the first element only */
              double* x;
              SCM head = SCM_CAR(argv[3]);
              _v = scm_is_number(head) ? 1 : 0;
            } else {
              /* wrapped vector? */
              std::vector<double >* v;
              _v = (SWIG_ConvertPtr(argv[3],(void **) &v, 
                  SWIGTYPE_p_std__vectorT_double_t, 0) != -1) ? 1 : 0;
            }
          }
          if (_v) {
            return _wrap_nlopt_opt_add_inequality_mconstraint__SWIG_0(argc,argv);
          }
        }
      }
    }
  }
  if (argc == 6) {
    int _v;
    {
      void *ptr;
      int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      {
        void *ptr;
        int res = SWIG_ConvertPtr(argv[1], &ptr, SWIGTYPE_p_nlopt_mfunc, 0);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        {
          void *ptr;
          int res = SWIG_ConvertPtr(argv[2], &ptr, 0, 0);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          {
            void *ptr;
            int res = SWIG_ConvertPtr(argv[3], &ptr, SWIGTYPE_p_nlopt_munge, 0);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            {
              void *ptr;
              int res = SWIG_ConvertPtr(argv[4], &ptr, SWIGTYPE_p_nlopt_munge, 0);
              _v = SWIG_CheckState(res);
            }
            if (_v) {
              {
                /* native sequence? */
                if (scm_is_vector(argv[5])) {
                  unsigned int size = scm_c_vector_length(argv[5]);
                  if (size == 0) {
                    /* an empty sequence can be of any type */
                    _v = 1;
                  } else {
                    /* check the first element only */
                    double* x;
                    SCM o = scm_vector_ref(argv[5],scm_from_ulong(0));
                    _v = scm_is_number(o) ? 1 : 0;
                  }
                } else if (scm_is_null(argv[5])) {
                  /* again, an empty sequence can be of any type */
                  _v = 1;
                } else if (scm_is_pair(argv[5])) {
                  /* check the first element only */
                  double* x;
                  SCM head = SCM_CAR(argv[5]);
                  _v = scm_is_number(head) ? 1 : 0;
                } else {
                  /* wrapped vector? */
                  std::vector<double >* v;
                  _v = (SWIG_ConvertPtr(argv[5],(void **) &v, 
                      SWIGTYPE_p_std__vectorT_double_t, 0) != -1) ? 1 : 0;
                }
              }
              if (_v) {
                return _wrap_nlopt_opt_add_inequality_mconstraint__SWIG_1(argc,argv);
              }
            }
          }
        }
      }
    }
  }
  
  scm_misc_error("nlopt-opt-add-inequality-mconstraint", "No matching method for generic function `nlopt_opt_add_inequality_mconstraint'", SCM_EOL);
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_add_equality_mconstraint__SWIG_1 (int argc, SCM *argv)
{
#define FUNC_NAME "nlopt-opt-add-equality-mconstraint"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  nlopt::mfunc arg2 ;
  void *arg3 = (void *) 0 ;
  nlopt_munge arg4 ;
  nlopt_munge arg5 ;
  std::vector< double > *arg6 = 0 ;
  nlopt::mfunc *argp2 ;
  nlopt_munge *argp4 ;
  nlopt_munge *argp5 ;
  std::vector< double > temp6 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  {
    argp2 = (nlopt::mfunc *)SWIG_MustGetPtr(argv[1], SWIGTYPE_p_nlopt_mfunc, 2, 0);
    arg2 = *argp2;
  }
  {
    arg3 = (void *)SWIG_MustGetPtr(argv[2], NULL, 3, 0);
  }
  {
    argp4 = (nlopt_munge *)SWIG_MustGetPtr(argv[3], SWIGTYPE_p_nlopt_munge, 4, 0);
    arg4 = *argp4;
  }
  {
    argp5 = (nlopt_munge *)SWIG_MustGetPtr(argv[4], SWIGTYPE_p_nlopt_munge, 5, 0);
    arg5 = *argp5;
  }
  {
    if (scm_is_vector(argv[5])) {
      unsigned long size = scm_c_vector_length(argv[5]);
      temp6 = std::vector<double >(size);
      arg6 = &temp6;
      for (unsigned long i=0; i<size; i++) {
        SCM o = scm_vector_ref(argv[5],scm_from_ulong(i));
        if (scm_is_number(o))
        temp6[i] = (double)(scm_to_double(o));
        else
        scm_wrong_type_arg(FUNC_NAME, 6, argv[5]);
      }
    } else if (scm_is_null(argv[5])) {
      temp6 = std::vector<double >();
      arg6 = &temp6;
    } else if (scm_is_pair(argv[5])) {
      SCM v = scm_vector(argv[5]);
      unsigned long size = scm_c_vector_length(v);
      temp6 = std::vector<double >(size);
      arg6 = &temp6;
      for (unsigned long i=0; i<size; i++) {
        SCM o = scm_vector_ref(v,scm_from_ulong(i));
        if (scm_is_number(o))
        temp6[i] = (double)(scm_to_double(o));
        else
        scm_wrong_type_arg(FUNC_NAME, 6, argv[5]);
      }
    } else {
      arg6 = (std::vector< double > *) SWIG_MustGetPtr(argv[5],SWIGTYPE_p_std__vectorT_double_t,6, 0);
    }
  }
  try {
    (arg1)->add_equality_mconstraint(arg2,arg3,arg4,arg5,(std::vector< double > const &)*arg6);
  }
  catch(std::bad_alloc &_e) {
    scm_throw(gh_symbol2scm("bad-alloc"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  catch(std::invalid_argument &_e) {
    scm_throw(gh_symbol2scm("invalid-argument"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  
  gswig_result = SCM_UNSPECIFIED;
  
  
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_add_equality_mconstraint(SCM rest)
{
#define FUNC_NAME "nlopt-opt-add-equality-mconstraint"
  SCM argv[6];
  int argc = SWIG_Guile_GetArgs (argv, rest, 0, 6, "nlopt-opt-add-equality-mconstraint");
  if (argc == 4) {
    int _v;
    {
      void *ptr;
      int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      {
        void *ptr;
        int res = SWIG_ConvertPtr(argv[1], &ptr, SWIGTYPE_p_nlopt_mfunc, 0);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        {
          void *ptr;
          int res = SWIG_ConvertPtr(argv[2], &ptr, 0, 0);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          {
            /* native sequence? */
            if (scm_is_vector(argv[3])) {
              unsigned int size = scm_c_vector_length(argv[3]);
              if (size == 0) {
                /* an empty sequence can be of any type */
                _v = 1;
              } else {
                /* check the first element only */
                double* x;
                SCM o = scm_vector_ref(argv[3],scm_from_ulong(0));
                _v = scm_is_number(o) ? 1 : 0;
              }
            } else if (scm_is_null(argv[3])) {
              /* again, an empty sequence can be of any type */
              _v = 1;
            } else if (scm_is_pair(argv[3])) {
              /* check the first element only */
              double* x;
              SCM head = SCM_CAR(argv[3]);
              _v = scm_is_number(head) ? 1 : 0;
            } else {
              /* wrapped vector? */
              std::vector<double >* v;
              _v = (SWIG_ConvertPtr(argv[3],(void **) &v, 
                  SWIGTYPE_p_std__vectorT_double_t, 0) != -1) ? 1 : 0;
            }
          }
          if (_v) {
            return _wrap_nlopt_opt_add_equality_mconstraint__SWIG_0(argc,argv);
          }
        }
      }
    }
  }
  if (argc == 6) {
    int _v;
    {
      void *ptr;
      int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      {
        void *ptr;
        int res = SWIG_ConvertPtr(argv[1], &ptr, SWIGTYPE_p_nlopt_mfunc, 0);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        {
          void *ptr;
          int res = SWIG_ConvertPtr(argv[2], &ptr, 0, 0);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          {
            void *ptr;
            int res = SWIG_ConvertPtr(argv[3], &ptr, SWIGTYPE_p_nlopt_munge, 0);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            {
              void *ptr;
              int res = SWIG_ConvertPtr(argv[4], &ptr, SWIGTYPE_p_nlopt_munge, 0);
              _v = SWIG_CheckState(res);
            }
            if (_v) {
              {
                /* native sequence? */
                if (scm_is_vector(argv[5])) {
                  unsigned int size = scm_c_vector_length(argv[5]);
                  if (size == 0) {
                    /* an empty sequence can be of any type */
                    _v = 1;
                  } else {
                    /* check the first element only */
                    double* x;
                    SCM o = scm_vector_ref(argv[5],scm_from_ulong(0));
                    _v = scm_is_number(o) ? 1 : 0;
                  }
                } else if (scm_is_null(argv[5])) {
                  /* again, an empty sequence can be of any type */
                  _v = 1;
                } else if (scm_is_pair(argv[5])) {
                  /* check the first element only */
                  double* x;
                  SCM head = SCM_CAR(argv[5]);
                  _v = scm_is_number(head) ? 1 : 0;
                } else {
                  /* wrapped vector? */
                  std::vector<double >* v;
                  _v = (SWIG_ConvertPtr(argv[5],(void **) &v, 
                      SWIGTYPE_p_std__vectorT_double_t, 0) != -1) ? 1 : 0;
                }
              }
              if (_v) {
                return _wrap_nlopt_opt_add_equality_mconstraint__SWIG_1(argc,argv);
              }
            }
          }
        }
      }
    }
  }
  
  scm_misc_error("nlopt-opt-add-equality-mconstraint", "No matching method for generic function `nlopt_opt_add_equality_mconstraint'", SCM_EOL);
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_set_lower_bounds__SWIG_0 (int argc, SCM *argv)
{
#define FUNC_NAME "nlopt-opt-set-lower-bounds"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  double arg2 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  {
    arg2 = (double) scm_to_double(argv[1]);
  }
  try {
    (arg1)->set_lower_bounds(arg2);
  }
  catch(std::invalid_argument &_e) {
    scm_throw(gh_symbol2scm("invalid-argument"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  
  gswig_result = SCM_UNSPECIFIED;
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_get_lower_bounds__SWIG_0 (int argc, SCM *argv)
{
#define FUNC_NAME "nlopt-opt-get-lower-bounds"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  std::vector< double > *arg2 = 0 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  {
    arg2 = (std::vector< double > *)SWIG_MustGetPtr(argv[1], SWIGTYPE_p_std__vectorT_double_t, 2, 0);
  }
  ((nlopt::opt const *)arg1)->get_lower_bounds(*arg2);
  gswig_result = SCM_UNSPECIFIED;
  
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_get_lower_bounds__SWIG_1 (int argc, SCM *argv)
{
#define FUNC_NAME "nlopt-opt-get-lower-bounds"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  std::vector< double > result;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  result = ((nlopt::opt const *)arg1)->get_lower_bounds();
  {
    gswig_result = scm_make_vector(scm_from_long((&result)->size()),SCM_UNSPECIFIED);
    for (unsigned int i=0; i<(&result)->size(); i++) {
      SCM x = scm_from_double(((std::vector< double > &)result)[i]);
      scm_vector_set_x(gswig_result,scm_from_long(i),x);
    }
  }
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_get_lower_bounds(SCM rest)
{
#define FUNC_NAME "nlopt-opt-get-lower-bounds"
  SCM argv[2];
  int argc = SWIG_Guile_GetArgs (argv, rest, 0, 2, "nlopt-opt-get-lower-bounds");
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      return _wrap_nlopt_opt_get_lower_bounds__SWIG_1(argc,argv);
    }
  }
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      {
        void *ptr;
        int res = SWIG_ConvertPtr(argv[1], &ptr, SWIGTYPE_p_std__vectorT_double_t, 0);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_nlopt_opt_get_lower_bounds__SWIG_0(argc,argv);
      }
    }
  }
  
  scm_misc_error("nlopt-opt-get-lower-bounds", "No matching method for generic function `nlopt_opt_get_lower_bounds'", SCM_EOL);
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_set_lower_bounds__SWIG_1 (int argc, SCM *argv)
{
#define FUNC_NAME "nlopt-opt-set-lower-bounds"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  std::vector< double > *arg2 = 0 ;
  std::vector< double > temp2 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  {
    if (scm_is_vector(argv[1])) {
      unsigned long size = scm_c_vector_length(argv[1]);
      temp2 = std::vector<double >(size);
      arg2 = &temp2;
      for (unsigned long i=0; i<size; i++) {
        SCM o = scm_vector_ref(argv[1],scm_from_ulong(i));
        if (scm_is_number(o))
        temp2[i] = (double)(scm_to_double(o));
        else
        scm_wrong_type_arg(FUNC_NAME, 2, argv[1]);
      }
    } else if (scm_is_null(argv[1])) {
      temp2 = std::vector<double >();
      arg2 = &temp2;
    } else if (scm_is_pair(argv[1])) {
      SCM v = scm_vector(argv[1]);
      unsigned long size = scm_c_vector_length(v);
      temp2 = std::vector<double >(size);
      arg2 = &temp2;
      for (unsigned long i=0; i<size; i++) {
        SCM o = scm_vector_ref(v,scm_from_ulong(i));
        if (scm_is_number(o))
        temp2[i] = (double)(scm_to_double(o));
        else
        scm_wrong_type_arg(FUNC_NAME, 2, argv[1]);
      }
    } else {
      arg2 = (std::vector< double > *) SWIG_MustGetPtr(argv[1],SWIGTYPE_p_std__vectorT_double_t,2, 0);
    }
  }
  try {
    (arg1)->set_lower_bounds((std::vector< double > const &)*arg2);
  }
  catch(std::invalid_argument &_e) {
    scm_throw(gh_symbol2scm("invalid-argument"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  
  gswig_result = SCM_UNSPECIFIED;
  
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_set_lower_bounds(SCM rest)
{
#define FUNC_NAME "nlopt-opt-set-lower-bounds"
  SCM argv[2];
  int argc = SWIG_Guile_GetArgs (argv, rest, 0, 2, "nlopt-opt-set-lower-bounds");
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      {
        _v = scm_is_true(scm_real_p(argv[1])) ? 1 : 0;
      }
      if (_v) {
        return _wrap_nlopt_opt_set_lower_bounds__SWIG_0(argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      {
        /* native sequence? */
        if (scm_is_vector(argv[1])) {
          unsigned int size = scm_c_vector_length(argv[1]);
          if (size == 0) {
            /* an empty sequence can be of any type */
            _v = 1;
          } else {
            /* check the first element only */
            double* x;
            SCM o = scm_vector_ref(argv[1],scm_from_ulong(0));
            _v = scm_is_number(o) ? 1 : 0;
          }
        } else if (scm_is_null(argv[1])) {
          /* again, an empty sequence can be of any type */
          _v = 1;
        } else if (scm_is_pair(argv[1])) {
          /* check the first element only */
          double* x;
          SCM head = SCM_CAR(argv[1]);
          _v = scm_is_number(head) ? 1 : 0;
        } else {
          /* wrapped vector? */
          std::vector<double >* v;
          _v = (SWIG_ConvertPtr(argv[1],(void **) &v, 
              SWIGTYPE_p_std__vectorT_double_t, 0) != -1) ? 1 : 0;
        }
      }
      if (_v) {
        return _wrap_nlopt_opt_set_lower_bounds__SWIG_1(argc,argv);
      }
    }
  }
  
  scm_misc_error("nlopt-opt-set-lower-bounds", "No matching method for generic function `nlopt_opt_set_lower_bounds'", SCM_EOL);
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_set_upper_bounds__SWIG_0 (int argc, SCM *argv)
{
#define FUNC_NAME "nlopt-opt-set-upper-bounds"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  double arg2 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  {
    arg2 = (double) scm_to_double(argv[1]);
  }
  try {
    (arg1)->set_upper_bounds(arg2);
  }
  catch(std::invalid_argument &_e) {
    scm_throw(gh_symbol2scm("invalid-argument"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  
  gswig_result = SCM_UNSPECIFIED;
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_get_upper_bounds__SWIG_0 (int argc, SCM *argv)
{
#define FUNC_NAME "nlopt-opt-get-upper-bounds"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  std::vector< double > *arg2 = 0 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  {
    arg2 = (std::vector< double > *)SWIG_MustGetPtr(argv[1], SWIGTYPE_p_std__vectorT_double_t, 2, 0);
  }
  ((nlopt::opt const *)arg1)->get_upper_bounds(*arg2);
  gswig_result = SCM_UNSPECIFIED;
  
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_get_upper_bounds__SWIG_1 (int argc, SCM *argv)
{
#define FUNC_NAME "nlopt-opt-get-upper-bounds"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  std::vector< double > result;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  result = ((nlopt::opt const *)arg1)->get_upper_bounds();
  {
    gswig_result = scm_make_vector(scm_from_long((&result)->size()),SCM_UNSPECIFIED);
    for (unsigned int i=0; i<(&result)->size(); i++) {
      SCM x = scm_from_double(((std::vector< double > &)result)[i]);
      scm_vector_set_x(gswig_result,scm_from_long(i),x);
    }
  }
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_get_upper_bounds(SCM rest)
{
#define FUNC_NAME "nlopt-opt-get-upper-bounds"
  SCM argv[2];
  int argc = SWIG_Guile_GetArgs (argv, rest, 0, 2, "nlopt-opt-get-upper-bounds");
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      return _wrap_nlopt_opt_get_upper_bounds__SWIG_1(argc,argv);
    }
  }
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      {
        void *ptr;
        int res = SWIG_ConvertPtr(argv[1], &ptr, SWIGTYPE_p_std__vectorT_double_t, 0);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_nlopt_opt_get_upper_bounds__SWIG_0(argc,argv);
      }
    }
  }
  
  scm_misc_error("nlopt-opt-get-upper-bounds", "No matching method for generic function `nlopt_opt_get_upper_bounds'", SCM_EOL);
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_set_upper_bounds__SWIG_1 (int argc, SCM *argv)
{
#define FUNC_NAME "nlopt-opt-set-upper-bounds"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  std::vector< double > *arg2 = 0 ;
  std::vector< double > temp2 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  {
    if (scm_is_vector(argv[1])) {
      unsigned long size = scm_c_vector_length(argv[1]);
      temp2 = std::vector<double >(size);
      arg2 = &temp2;
      for (unsigned long i=0; i<size; i++) {
        SCM o = scm_vector_ref(argv[1],scm_from_ulong(i));
        if (scm_is_number(o))
        temp2[i] = (double)(scm_to_double(o));
        else
        scm_wrong_type_arg(FUNC_NAME, 2, argv[1]);
      }
    } else if (scm_is_null(argv[1])) {
      temp2 = std::vector<double >();
      arg2 = &temp2;
    } else if (scm_is_pair(argv[1])) {
      SCM v = scm_vector(argv[1]);
      unsigned long size = scm_c_vector_length(v);
      temp2 = std::vector<double >(size);
      arg2 = &temp2;
      for (unsigned long i=0; i<size; i++) {
        SCM o = scm_vector_ref(v,scm_from_ulong(i));
        if (scm_is_number(o))
        temp2[i] = (double)(scm_to_double(o));
        else
        scm_wrong_type_arg(FUNC_NAME, 2, argv[1]);
      }
    } else {
      arg2 = (std::vector< double > *) SWIG_MustGetPtr(argv[1],SWIGTYPE_p_std__vectorT_double_t,2, 0);
    }
  }
  try {
    (arg1)->set_upper_bounds((std::vector< double > const &)*arg2);
  }
  catch(std::invalid_argument &_e) {
    scm_throw(gh_symbol2scm("invalid-argument"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  
  gswig_result = SCM_UNSPECIFIED;
  
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_set_upper_bounds(SCM rest)
{
#define FUNC_NAME "nlopt-opt-set-upper-bounds"
  SCM argv[2];
  int argc = SWIG_Guile_GetArgs (argv, rest, 0, 2, "nlopt-opt-set-upper-bounds");
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      {
        _v = scm_is_true(scm_real_p(argv[1])) ? 1 : 0;
      }
      if (_v) {
        return _wrap_nlopt_opt_set_upper_bounds__SWIG_0(argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      {
        /* native sequence? */
        if (scm_is_vector(argv[1])) {
          unsigned int size = scm_c_vector_length(argv[1]);
          if (size == 0) {
            /* an empty sequence can be of any type */
            _v = 1;
          } else {
            /* check the first element only */
            double* x;
            SCM o = scm_vector_ref(argv[1],scm_from_ulong(0));
            _v = scm_is_number(o) ? 1 : 0;
          }
        } else if (scm_is_null(argv[1])) {
          /* again, an empty sequence can be of any type */
          _v = 1;
        } else if (scm_is_pair(argv[1])) {
          /* check the first element only */
          double* x;
          SCM head = SCM_CAR(argv[1]);
          _v = scm_is_number(head) ? 1 : 0;
        } else {
          /* wrapped vector? */
          std::vector<double >* v;
          _v = (SWIG_ConvertPtr(argv[1],(void **) &v, 
              SWIGTYPE_p_std__vectorT_double_t, 0) != -1) ? 1 : 0;
        }
      }
      if (_v) {
        return _wrap_nlopt_opt_set_upper_bounds__SWIG_1(argc,argv);
      }
    }
  }
  
  scm_misc_error("nlopt-opt-set-upper-bounds", "No matching method for generic function `nlopt_opt_set_upper_bounds'", SCM_EOL);
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_get_stopval (SCM s_0)
{
#define FUNC_NAME "nlopt-opt-get-stopval"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  double result;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  result = (double)((nlopt::opt const *)arg1)->get_stopval();
  {
    gswig_result = scm_from_double(result);
  }
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_set_stopval (SCM s_0, SCM s_1)
{
#define FUNC_NAME "nlopt-opt-set-stopval"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  double arg2 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  {
    arg2 = (double) scm_to_double(s_1);
  }
  try {
    (arg1)->set_stopval(arg2);
  }
  catch(std::invalid_argument &_e) {
    scm_throw(gh_symbol2scm("invalid-argument"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  
  gswig_result = SCM_UNSPECIFIED;
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_get_ftol_rel (SCM s_0)
{
#define FUNC_NAME "nlopt-opt-get-ftol-rel"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  double result;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  result = (double)((nlopt::opt const *)arg1)->get_ftol_rel();
  {
    gswig_result = scm_from_double(result);
  }
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_set_ftol_rel (SCM s_0, SCM s_1)
{
#define FUNC_NAME "nlopt-opt-set-ftol-rel"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  double arg2 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  {
    arg2 = (double) scm_to_double(s_1);
  }
  try {
    (arg1)->set_ftol_rel(arg2);
  }
  catch(std::invalid_argument &_e) {
    scm_throw(gh_symbol2scm("invalid-argument"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  
  gswig_result = SCM_UNSPECIFIED;
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_get_ftol_abs (SCM s_0)
{
#define FUNC_NAME "nlopt-opt-get-ftol-abs"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  double result;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  result = (double)((nlopt::opt const *)arg1)->get_ftol_abs();
  {
    gswig_result = scm_from_double(result);
  }
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_set_ftol_abs (SCM s_0, SCM s_1)
{
#define FUNC_NAME "nlopt-opt-set-ftol-abs"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  double arg2 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  {
    arg2 = (double) scm_to_double(s_1);
  }
  try {
    (arg1)->set_ftol_abs(arg2);
  }
  catch(std::invalid_argument &_e) {
    scm_throw(gh_symbol2scm("invalid-argument"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  
  gswig_result = SCM_UNSPECIFIED;
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_get_xtol_rel (SCM s_0)
{
#define FUNC_NAME "nlopt-opt-get-xtol-rel"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  double result;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  result = (double)((nlopt::opt const *)arg1)->get_xtol_rel();
  {
    gswig_result = scm_from_double(result);
  }
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_set_xtol_rel (SCM s_0, SCM s_1)
{
#define FUNC_NAME "nlopt-opt-set-xtol-rel"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  double arg2 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  {
    arg2 = (double) scm_to_double(s_1);
  }
  try {
    (arg1)->set_xtol_rel(arg2);
  }
  catch(std::invalid_argument &_e) {
    scm_throw(gh_symbol2scm("invalid-argument"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  
  gswig_result = SCM_UNSPECIFIED;
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_set_xtol_abs__SWIG_0 (int argc, SCM *argv)
{
#define FUNC_NAME "nlopt-opt-set-xtol-abs"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  double arg2 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  {
    arg2 = (double) scm_to_double(argv[1]);
  }
  try {
    (arg1)->set_xtol_abs(arg2);
  }
  catch(std::invalid_argument &_e) {
    scm_throw(gh_symbol2scm("invalid-argument"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  
  gswig_result = SCM_UNSPECIFIED;
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_get_xtol_abs__SWIG_0 (int argc, SCM *argv)
{
#define FUNC_NAME "nlopt-opt-get-xtol-abs"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  std::vector< double > *arg2 = 0 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  {
    arg2 = (std::vector< double > *)SWIG_MustGetPtr(argv[1], SWIGTYPE_p_std__vectorT_double_t, 2, 0);
  }
  ((nlopt::opt const *)arg1)->get_xtol_abs(*arg2);
  gswig_result = SCM_UNSPECIFIED;
  
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_get_xtol_abs__SWIG_1 (int argc, SCM *argv)
{
#define FUNC_NAME "nlopt-opt-get-xtol-abs"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  std::vector< double > result;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  result = ((nlopt::opt const *)arg1)->get_xtol_abs();
  {
    gswig_result = scm_make_vector(scm_from_long((&result)->size()),SCM_UNSPECIFIED);
    for (unsigned int i=0; i<(&result)->size(); i++) {
      SCM x = scm_from_double(((std::vector< double > &)result)[i]);
      scm_vector_set_x(gswig_result,scm_from_long(i),x);
    }
  }
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_get_xtol_abs(SCM rest)
{
#define FUNC_NAME "nlopt-opt-get-xtol-abs"
  SCM argv[2];
  int argc = SWIG_Guile_GetArgs (argv, rest, 0, 2, "nlopt-opt-get-xtol-abs");
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      return _wrap_nlopt_opt_get_xtol_abs__SWIG_1(argc,argv);
    }
  }
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      {
        void *ptr;
        int res = SWIG_ConvertPtr(argv[1], &ptr, SWIGTYPE_p_std__vectorT_double_t, 0);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_nlopt_opt_get_xtol_abs__SWIG_0(argc,argv);
      }
    }
  }
  
  scm_misc_error("nlopt-opt-get-xtol-abs", "No matching method for generic function `nlopt_opt_get_xtol_abs'", SCM_EOL);
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_set_xtol_abs__SWIG_1 (int argc, SCM *argv)
{
#define FUNC_NAME "nlopt-opt-set-xtol-abs"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  std::vector< double > *arg2 = 0 ;
  std::vector< double > temp2 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  {
    if (scm_is_vector(argv[1])) {
      unsigned long size = scm_c_vector_length(argv[1]);
      temp2 = std::vector<double >(size);
      arg2 = &temp2;
      for (unsigned long i=0; i<size; i++) {
        SCM o = scm_vector_ref(argv[1],scm_from_ulong(i));
        if (scm_is_number(o))
        temp2[i] = (double)(scm_to_double(o));
        else
        scm_wrong_type_arg(FUNC_NAME, 2, argv[1]);
      }
    } else if (scm_is_null(argv[1])) {
      temp2 = std::vector<double >();
      arg2 = &temp2;
    } else if (scm_is_pair(argv[1])) {
      SCM v = scm_vector(argv[1]);
      unsigned long size = scm_c_vector_length(v);
      temp2 = std::vector<double >(size);
      arg2 = &temp2;
      for (unsigned long i=0; i<size; i++) {
        SCM o = scm_vector_ref(v,scm_from_ulong(i));
        if (scm_is_number(o))
        temp2[i] = (double)(scm_to_double(o));
        else
        scm_wrong_type_arg(FUNC_NAME, 2, argv[1]);
      }
    } else {
      arg2 = (std::vector< double > *) SWIG_MustGetPtr(argv[1],SWIGTYPE_p_std__vectorT_double_t,2, 0);
    }
  }
  try {
    (arg1)->set_xtol_abs((std::vector< double > const &)*arg2);
  }
  catch(std::invalid_argument &_e) {
    scm_throw(gh_symbol2scm("invalid-argument"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  
  gswig_result = SCM_UNSPECIFIED;
  
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_set_xtol_abs(SCM rest)
{
#define FUNC_NAME "nlopt-opt-set-xtol-abs"
  SCM argv[2];
  int argc = SWIG_Guile_GetArgs (argv, rest, 0, 2, "nlopt-opt-set-xtol-abs");
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      {
        _v = scm_is_true(scm_real_p(argv[1])) ? 1 : 0;
      }
      if (_v) {
        return _wrap_nlopt_opt_set_xtol_abs__SWIG_0(argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      {
        /* native sequence? */
        if (scm_is_vector(argv[1])) {
          unsigned int size = scm_c_vector_length(argv[1]);
          if (size == 0) {
            /* an empty sequence can be of any type */
            _v = 1;
          } else {
            /* check the first element only */
            double* x;
            SCM o = scm_vector_ref(argv[1],scm_from_ulong(0));
            _v = scm_is_number(o) ? 1 : 0;
          }
        } else if (scm_is_null(argv[1])) {
          /* again, an empty sequence can be of any type */
          _v = 1;
        } else if (scm_is_pair(argv[1])) {
          /* check the first element only */
          double* x;
          SCM head = SCM_CAR(argv[1]);
          _v = scm_is_number(head) ? 1 : 0;
        } else {
          /* wrapped vector? */
          std::vector<double >* v;
          _v = (SWIG_ConvertPtr(argv[1],(void **) &v, 
              SWIGTYPE_p_std__vectorT_double_t, 0) != -1) ? 1 : 0;
        }
      }
      if (_v) {
        return _wrap_nlopt_opt_set_xtol_abs__SWIG_1(argc,argv);
      }
    }
  }
  
  scm_misc_error("nlopt-opt-set-xtol-abs", "No matching method for generic function `nlopt_opt_set_xtol_abs'", SCM_EOL);
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_get_maxeval (SCM s_0)
{
#define FUNC_NAME "nlopt-opt-get-maxeval"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  int result;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  result = (int)((nlopt::opt const *)arg1)->get_maxeval();
  {
    gswig_result = scm_from_long(result);
  }
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_set_maxeval (SCM s_0, SCM s_1)
{
#define FUNC_NAME "nlopt-opt-set-maxeval"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  int arg2 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  {
    arg2 = (int) scm_to_int(s_1);
  }
  try {
    (arg1)->set_maxeval(arg2);
  }
  catch(std::invalid_argument &_e) {
    scm_throw(gh_symbol2scm("invalid-argument"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  
  gswig_result = SCM_UNSPECIFIED;
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_get_maxtime (SCM s_0)
{
#define FUNC_NAME "nlopt-opt-get-maxtime"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  double result;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  result = (double)((nlopt::opt const *)arg1)->get_maxtime();
  {
    gswig_result = scm_from_double(result);
  }
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_set_maxtime (SCM s_0, SCM s_1)
{
#define FUNC_NAME "nlopt-opt-set-maxtime"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  double arg2 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  {
    arg2 = (double) scm_to_double(s_1);
  }
  try {
    (arg1)->set_maxtime(arg2);
  }
  catch(std::invalid_argument &_e) {
    scm_throw(gh_symbol2scm("invalid-argument"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  
  gswig_result = SCM_UNSPECIFIED;
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_get_force_stop (SCM s_0)
{
#define FUNC_NAME "nlopt-opt-get-force-stop"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  int result;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  result = (int)((nlopt::opt const *)arg1)->get_force_stop();
  {
    gswig_result = scm_from_long(result);
  }
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_set_force_stop (SCM s_0, SCM s_1)
{
#define FUNC_NAME "nlopt-opt-set-force-stop"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  int arg2 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  {
    arg2 = (int) scm_to_int(s_1);
  }
  try {
    (arg1)->set_force_stop(arg2);
  }
  catch(std::invalid_argument &_e) {
    scm_throw(gh_symbol2scm("invalid-argument"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  
  gswig_result = SCM_UNSPECIFIED;
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_force_stop (SCM s_0)
{
#define FUNC_NAME "nlopt-opt-force-stop"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  try {
    (arg1)->force_stop();
  }
  catch(std::invalid_argument &_e) {
    scm_throw(gh_symbol2scm("invalid-argument"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  
  gswig_result = SCM_UNSPECIFIED;
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_set_local_optimizer (SCM s_0, SCM s_1)
{
#define FUNC_NAME "nlopt-opt-set-local-optimizer"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  nlopt::opt *arg2 = 0 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  {
    arg2 = (nlopt::opt *)SWIG_MustGetPtr(s_1, SWIGTYPE_p_nlopt__opt, 2, 0);
  }
  try {
    (arg1)->set_local_optimizer((nlopt::opt const &)*arg2);
  }
  catch(std::bad_alloc &_e) {
    scm_throw(gh_symbol2scm("bad-alloc"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  catch(std::invalid_argument &_e) {
    scm_throw(gh_symbol2scm("invalid-argument"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  
  gswig_result = SCM_UNSPECIFIED;
  
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_get_population (SCM s_0)
{
#define FUNC_NAME "nlopt-opt-get-population"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  unsigned int result;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  result = (unsigned int)((nlopt::opt const *)arg1)->get_population();
  {
    gswig_result = scm_from_ulong(result);
  }
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_set_population (SCM s_0, SCM s_1)
{
#define FUNC_NAME "nlopt-opt-set-population"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  unsigned int arg2 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  {
    arg2 = (unsigned int) scm_to_uint(s_1);
  }
  try {
    (arg1)->set_population(arg2);
  }
  catch(std::invalid_argument &_e) {
    scm_throw(gh_symbol2scm("invalid-argument"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  
  gswig_result = SCM_UNSPECIFIED;
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_get_vector_storage (SCM s_0)
{
#define FUNC_NAME "nlopt-opt-get-vector-storage"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  unsigned int result;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  result = (unsigned int)((nlopt::opt const *)arg1)->get_vector_storage();
  {
    gswig_result = scm_from_ulong(result);
  }
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_set_vector_storage (SCM s_0, SCM s_1)
{
#define FUNC_NAME "nlopt-opt-set-vector-storage"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  unsigned int arg2 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  {
    arg2 = (unsigned int) scm_to_uint(s_1);
  }
  try {
    (arg1)->set_vector_storage(arg2);
  }
  catch(std::invalid_argument &_e) {
    scm_throw(gh_symbol2scm("invalid-argument"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  
  gswig_result = SCM_UNSPECIFIED;
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_set_initial_step__SWIG_0 (int argc, SCM *argv)
{
#define FUNC_NAME "nlopt-opt-set-initial-step"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  double arg2 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  {
    arg2 = (double) scm_to_double(argv[1]);
  }
  try {
    (arg1)->set_initial_step(arg2);
  }
  catch(std::invalid_argument &_e) {
    scm_throw(gh_symbol2scm("invalid-argument"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  
  gswig_result = SCM_UNSPECIFIED;
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_get_initial_step__SWIG_0 (int argc, SCM *argv)
{
#define FUNC_NAME "nlopt-opt-get-initial-step"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  std::vector< double > *arg2 = 0 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  {
    arg2 = (std::vector< double > *)SWIG_MustGetPtr(argv[1], SWIGTYPE_p_std__vectorT_double_t, 2, 0);
  }
  ((nlopt::opt const *)arg1)->get_initial_step(*arg2);
  gswig_result = SCM_UNSPECIFIED;
  
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_get_initial_step__SWIG_1 (int argc, SCM *argv)
{
#define FUNC_NAME "nlopt-opt-get-initial-step"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  std::vector< double > result;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  result = ((nlopt::opt const *)arg1)->get_initial_step();
  {
    gswig_result = scm_make_vector(scm_from_long((&result)->size()),SCM_UNSPECIFIED);
    for (unsigned int i=0; i<(&result)->size(); i++) {
      SCM x = scm_from_double(((std::vector< double > &)result)[i]);
      scm_vector_set_x(gswig_result,scm_from_long(i),x);
    }
  }
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_set_initial_step__SWIG_1 (int argc, SCM *argv)
{
#define FUNC_NAME "nlopt-opt-set-initial-step"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  std::vector< double > *arg2 = 0 ;
  std::vector< double > temp2 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  {
    if (scm_is_vector(argv[1])) {
      unsigned long size = scm_c_vector_length(argv[1]);
      temp2 = std::vector<double >(size);
      arg2 = &temp2;
      for (unsigned long i=0; i<size; i++) {
        SCM o = scm_vector_ref(argv[1],scm_from_ulong(i));
        if (scm_is_number(o))
        temp2[i] = (double)(scm_to_double(o));
        else
        scm_wrong_type_arg(FUNC_NAME, 2, argv[1]);
      }
    } else if (scm_is_null(argv[1])) {
      temp2 = std::vector<double >();
      arg2 = &temp2;
    } else if (scm_is_pair(argv[1])) {
      SCM v = scm_vector(argv[1]);
      unsigned long size = scm_c_vector_length(v);
      temp2 = std::vector<double >(size);
      arg2 = &temp2;
      for (unsigned long i=0; i<size; i++) {
        SCM o = scm_vector_ref(v,scm_from_ulong(i));
        if (scm_is_number(o))
        temp2[i] = (double)(scm_to_double(o));
        else
        scm_wrong_type_arg(FUNC_NAME, 2, argv[1]);
      }
    } else {
      arg2 = (std::vector< double > *) SWIG_MustGetPtr(argv[1],SWIGTYPE_p_std__vectorT_double_t,2, 0);
    }
  }
  try {
    (arg1)->set_initial_step((std::vector< double > const &)*arg2);
  }
  catch(std::invalid_argument &_e) {
    scm_throw(gh_symbol2scm("invalid-argument"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  
  gswig_result = SCM_UNSPECIFIED;
  
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_set_initial_step(SCM rest)
{
#define FUNC_NAME "nlopt-opt-set-initial-step"
  SCM argv[2];
  int argc = SWIG_Guile_GetArgs (argv, rest, 0, 2, "nlopt-opt-set-initial-step");
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      {
        _v = scm_is_true(scm_real_p(argv[1])) ? 1 : 0;
      }
      if (_v) {
        return _wrap_nlopt_opt_set_initial_step__SWIG_0(argc,argv);
      }
    }
  }
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      {
        /* native sequence? */
        if (scm_is_vector(argv[1])) {
          unsigned int size = scm_c_vector_length(argv[1]);
          if (size == 0) {
            /* an empty sequence can be of any type */
            _v = 1;
          } else {
            /* check the first element only */
            double* x;
            SCM o = scm_vector_ref(argv[1],scm_from_ulong(0));
            _v = scm_is_number(o) ? 1 : 0;
          }
        } else if (scm_is_null(argv[1])) {
          /* again, an empty sequence can be of any type */
          _v = 1;
        } else if (scm_is_pair(argv[1])) {
          /* check the first element only */
          double* x;
          SCM head = SCM_CAR(argv[1]);
          _v = scm_is_number(head) ? 1 : 0;
        } else {
          /* wrapped vector? */
          std::vector<double >* v;
          _v = (SWIG_ConvertPtr(argv[1],(void **) &v, 
              SWIGTYPE_p_std__vectorT_double_t, 0) != -1) ? 1 : 0;
        }
      }
      if (_v) {
        return _wrap_nlopt_opt_set_initial_step__SWIG_1(argc,argv);
      }
    }
  }
  
  scm_misc_error("nlopt-opt-set-initial-step", "No matching method for generic function `nlopt_opt_set_initial_step'", SCM_EOL);
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_set_default_initial_step (SCM s_0, SCM s_1)
{
#define FUNC_NAME "nlopt-opt-set-default-initial-step"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  std::vector< double > *arg2 = 0 ;
  std::vector< double > temp2 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  {
    if (scm_is_vector(s_1)) {
      unsigned long size = scm_c_vector_length(s_1);
      temp2 = std::vector<double >(size);
      arg2 = &temp2;
      for (unsigned long i=0; i<size; i++) {
        SCM o = scm_vector_ref(s_1,scm_from_ulong(i));
        if (scm_is_number(o))
        temp2[i] = (double)(scm_to_double(o));
        else
        scm_wrong_type_arg(FUNC_NAME, 2, s_1);
      }
    } else if (scm_is_null(s_1)) {
      temp2 = std::vector<double >();
      arg2 = &temp2;
    } else if (scm_is_pair(s_1)) {
      SCM v = scm_vector(s_1);
      unsigned long size = scm_c_vector_length(v);
      temp2 = std::vector<double >(size);
      arg2 = &temp2;
      for (unsigned long i=0; i<size; i++) {
        SCM o = scm_vector_ref(v,scm_from_ulong(i));
        if (scm_is_number(o))
        temp2[i] = (double)(scm_to_double(o));
        else
        scm_wrong_type_arg(FUNC_NAME, 2, s_1);
      }
    } else {
      arg2 = (std::vector< double > *) SWIG_MustGetPtr(s_1,SWIGTYPE_p_std__vectorT_double_t,2, 0);
    }
  }
  try {
    (arg1)->set_default_initial_step((std::vector< double > const &)*arg2);
  }
  catch(std::bad_alloc &_e) {
    scm_throw(gh_symbol2scm("bad-alloc"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  catch(std::invalid_argument &_e) {
    scm_throw(gh_symbol2scm("invalid-argument"), 
      scm_list_1(scm_from_locale_string((_e).what())));
    
  }
  
  gswig_result = SCM_UNSPECIFIED;
  
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_get_initial_step__SWIG_2 (int argc, SCM *argv)
{
#define FUNC_NAME "nlopt-opt-get-initial-step"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  std::vector< double > *arg2 = 0 ;
  std::vector< double > *arg3 = 0 ;
  std::vector< double > temp2 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  {
    if (scm_is_vector(argv[1])) {
      unsigned long size = scm_c_vector_length(argv[1]);
      temp2 = std::vector<double >(size);
      arg2 = &temp2;
      for (unsigned long i=0; i<size; i++) {
        SCM o = scm_vector_ref(argv[1],scm_from_ulong(i));
        if (scm_is_number(o))
        temp2[i] = (double)(scm_to_double(o));
        else
        scm_wrong_type_arg(FUNC_NAME, 2, argv[1]);
      }
    } else if (scm_is_null(argv[1])) {
      temp2 = std::vector<double >();
      arg2 = &temp2;
    } else if (scm_is_pair(argv[1])) {
      SCM v = scm_vector(argv[1]);
      unsigned long size = scm_c_vector_length(v);
      temp2 = std::vector<double >(size);
      arg2 = &temp2;
      for (unsigned long i=0; i<size; i++) {
        SCM o = scm_vector_ref(v,scm_from_ulong(i));
        if (scm_is_number(o))
        temp2[i] = (double)(scm_to_double(o));
        else
        scm_wrong_type_arg(FUNC_NAME, 2, argv[1]);
      }
    } else {
      arg2 = (std::vector< double > *) SWIG_MustGetPtr(argv[1],SWIGTYPE_p_std__vectorT_double_t,2, 0);
    }
  }
  {
    arg3 = (std::vector< double > *)SWIG_MustGetPtr(argv[2], SWIGTYPE_p_std__vectorT_double_t, 3, 0);
  }
  ((nlopt::opt const *)arg1)->get_initial_step((std::vector< double > const &)*arg2,*arg3);
  gswig_result = SCM_UNSPECIFIED;
  
  
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_get_initial_step(SCM rest)
{
#define FUNC_NAME "nlopt-opt-get-initial-step"
  SCM argv[3];
  int argc = SWIG_Guile_GetArgs (argv, rest, 0, 3, "nlopt-opt-get-initial-step");
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      return _wrap_nlopt_opt_get_initial_step__SWIG_1(argc,argv);
    }
  }
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      {
        void *ptr;
        int res = SWIG_ConvertPtr(argv[1], &ptr, SWIGTYPE_p_std__vectorT_double_t, 0);
        _v = SWIG_CheckState(res);
      }
      if (_v) {
        return _wrap_nlopt_opt_get_initial_step__SWIG_0(argc,argv);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      void *ptr;
      int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
      _v = SWIG_CheckState(res);
    }
    if (_v) {
      {
        /* native sequence? */
        if (scm_is_vector(argv[1])) {
          unsigned int size = scm_c_vector_length(argv[1]);
          if (size == 0) {
            /* an empty sequence can be of any type */
            _v = 1;
          } else {
            /* check the first element only */
            double* x;
            SCM o = scm_vector_ref(argv[1],scm_from_ulong(0));
            _v = scm_is_number(o) ? 1 : 0;
          }
        } else if (scm_is_null(argv[1])) {
          /* again, an empty sequence can be of any type */
          _v = 1;
        } else if (scm_is_pair(argv[1])) {
          /* check the first element only */
          double* x;
          SCM head = SCM_CAR(argv[1]);
          _v = scm_is_number(head) ? 1 : 0;
        } else {
          /* wrapped vector? */
          std::vector<double >* v;
          _v = (SWIG_ConvertPtr(argv[1],(void **) &v, 
              SWIGTYPE_p_std__vectorT_double_t, 0) != -1) ? 1 : 0;
        }
      }
      if (_v) {
        {
          void *ptr;
          int res = SWIG_ConvertPtr(argv[2], &ptr, SWIGTYPE_p_std__vectorT_double_t, 0);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_nlopt_opt_get_initial_step__SWIG_2(argc,argv);
        }
      }
    }
  }
  
  scm_misc_error("nlopt-opt-get-initial-step", "No matching method for generic function `nlopt_opt_get_initial_step'", SCM_EOL);
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_opt_get_initial_step_ (SCM s_0, SCM s_1)
{
#define FUNC_NAME "nlopt-opt-get-initial-step-"
  nlopt::opt *arg1 = (nlopt::opt *) 0 ;
  std::vector< double > *arg2 = 0 ;
  std::vector< double > temp2 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  std::vector< double > result;
  
  {
    arg1 = (nlopt::opt *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_nlopt__opt, 1, 0);
  }
  {
    if (scm_is_vector(s_1)) {
      unsigned long size = scm_c_vector_length(s_1);
      temp2 = std::vector<double >(size);
      arg2 = &temp2;
      for (unsigned long i=0; i<size; i++) {
        SCM o = scm_vector_ref(s_1,scm_from_ulong(i));
        if (scm_is_number(o))
        temp2[i] = (double)(scm_to_double(o));
        else
        scm_wrong_type_arg(FUNC_NAME, 2, s_1);
      }
    } else if (scm_is_null(s_1)) {
      temp2 = std::vector<double >();
      arg2 = &temp2;
    } else if (scm_is_pair(s_1)) {
      SCM v = scm_vector(s_1);
      unsigned long size = scm_c_vector_length(v);
      temp2 = std::vector<double >(size);
      arg2 = &temp2;
      for (unsigned long i=0; i<size; i++) {
        SCM o = scm_vector_ref(v,scm_from_ulong(i));
        if (scm_is_number(o))
        temp2[i] = (double)(scm_to_double(o));
        else
        scm_wrong_type_arg(FUNC_NAME, 2, s_1);
      }
    } else {
      arg2 = (std::vector< double > *) SWIG_MustGetPtr(s_1,SWIGTYPE_p_std__vectorT_double_t,2, 0);
    }
  }
  result = ((nlopt::opt const *)arg1)->get_initial_step_((std::vector< double > const &)*arg2);
  {
    gswig_result = scm_make_vector(scm_from_long((&result)->size()),SCM_UNSPECIFIED);
    for (unsigned int i=0; i<(&result)->size(); i++) {
      SCM x = scm_from_double(((std::vector< double > &)result)[i]);
      scm_vector_set_x(gswig_result,scm_from_long(i),x);
    }
  }
  
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_srand (SCM s_0)
{
#define FUNC_NAME "nlopt-srand"
  unsigned long arg1 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  
  {
    arg1 = (unsigned long) scm_to_ulong(s_0);
  }
  nlopt::srand(arg1);
  gswig_result = SCM_UNSPECIFIED;
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_srand_time ()
{
#define FUNC_NAME "nlopt-srand-time"
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  
  nlopt::srand_time();
  gswig_result = SCM_UNSPECIFIED;
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_version (SCM s_0, SCM s_1, SCM s_2)
{
#define FUNC_NAME "nlopt-version"
  int *arg1 = 0 ;
  int *arg2 = 0 ;
  int *arg3 = 0 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  
  {
    arg1 = (int *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_int, 1, 0);
  }
  {
    arg2 = (int *)SWIG_MustGetPtr(s_1, SWIGTYPE_p_int, 2, 0);
  }
  {
    arg3 = (int *)SWIG_MustGetPtr(s_2, SWIGTYPE_p_int, 3, 0);
  }
  nlopt::version(*arg1,*arg2,*arg3);
  gswig_result = SCM_UNSPECIFIED;
  
  
  
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_version_major ()
{
#define FUNC_NAME "nlopt-version-major"
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  int result;
  
  result = (int)nlopt::version_major();
  {
    gswig_result = scm_from_long(result);
  }
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_version_minor ()
{
#define FUNC_NAME "nlopt-version-minor"
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  int result;
  
  result = (int)nlopt::version_minor();
  {
    gswig_result = scm_from_long(result);
  }
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_version_bugfix ()
{
#define FUNC_NAME "nlopt-version-bugfix"
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  int result;
  
  result = (int)nlopt::version_bugfix();
  {
    gswig_result = scm_from_long(result);
  }
  
  return gswig_result;
#undef FUNC_NAME
}


static SCM
_wrap_nlopt_algorithm_name (SCM s_0)
{
#define FUNC_NAME "nlopt-algorithm-name"
  nlopt::algorithm arg1 ;
  SCM gswig_result;
  SWIGUNUSED int gswig_list_p = 0;
  char *result = 0 ;
  
  {
    arg1 = (nlopt::algorithm) scm_to_int(s_0); 
  }
  result = (char *)nlopt::algorithm_name(arg1);
  {
    gswig_result = SWIG_str02scm((const char *)result);
  }
  
  return gswig_result;
#undef FUNC_NAME
}


#ifdef __cplusplus
extern "C" {
#endif

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

static swig_type_info _swigt__p_double = {"_p_double", "double *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_f_r_q_const__std__vector__double___r_std__vector__double___p_void__double = {"_p_f_r_q_const__std__vector__double___r_std__vector__double___p_void__double", "nlopt::vfunc|double (*)(std::vector< double > const &,std::vector< double > &,void *)", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_int = {"_p_int", "int *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_nlopt__forced_stop = {"_p_nlopt__forced_stop", "nlopt::forced_stop *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_nlopt__opt = {"_p_nlopt__opt", "nlopt::opt *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_nlopt__roundoff_limited = {"_p_nlopt__roundoff_limited", "nlopt::roundoff_limited *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_nlopt_func = {"_p_nlopt_func", "nlopt::func *|nlopt_func *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_nlopt_mfunc = {"_p_nlopt_mfunc", "nlopt_mfunc *|nlopt::mfunc *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_nlopt_munge = {"_p_nlopt_munge", "nlopt_munge *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_nlopt_opt = {"_p_nlopt_opt", "nlopt_opt *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_nlopt_result = {"_p_nlopt_result", "nlopt_result *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_std__out_of_range = {"_p_std__out_of_range", "std::out_of_range *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_std__vectorT_double_t = {"_p_std__vectorT_double_t", "std::vector< double > *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_unsigned_long = {"_p_unsigned_long", "SCM *|unsigned long *", 0, 0, (void*)0, 0};

static swig_type_info *swig_type_initial[] = {
  &_swigt__p_double,
  &_swigt__p_f_r_q_const__std__vector__double___r_std__vector__double___p_void__double,
  &_swigt__p_int,
  &_swigt__p_nlopt__forced_stop,
  &_swigt__p_nlopt__opt,
  &_swigt__p_nlopt__roundoff_limited,
  &_swigt__p_nlopt_func,
  &_swigt__p_nlopt_mfunc,
  &_swigt__p_nlopt_munge,
  &_swigt__p_nlopt_opt,
  &_swigt__p_nlopt_result,
  &_swigt__p_std__out_of_range,
  &_swigt__p_std__vectorT_double_t,
  &_swigt__p_unsigned_long,
};

static swig_cast_info _swigc__p_double[] = {  {&_swigt__p_double, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_f_r_q_const__std__vector__double___r_std__vector__double___p_void__double[] = {  {&_swigt__p_f_r_q_const__std__vector__double___r_std__vector__double___p_void__double, 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_nlopt__forced_stop[] = {  {&_swigt__p_nlopt__forced_stop, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_nlopt__opt[] = {  {&_swigt__p_nlopt__opt, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_nlopt__roundoff_limited[] = {  {&_swigt__p_nlopt__roundoff_limited, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_nlopt_func[] = {  {&_swigt__p_nlopt_func, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_nlopt_mfunc[] = {  {&_swigt__p_nlopt_mfunc, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_nlopt_munge[] = {  {&_swigt__p_nlopt_munge, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_nlopt_opt[] = {  {&_swigt__p_nlopt_opt, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_nlopt_result[] = {  {&_swigt__p_nlopt_result, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_std__out_of_range[] = {  {&_swigt__p_std__out_of_range, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_std__vectorT_double_t[] = {  {&_swigt__p_std__vectorT_double_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_unsigned_long[] = {  {&_swigt__p_unsigned_long, 0, 0, 0},{0, 0, 0, 0}};

static swig_cast_info *swig_cast_initial[] = {
  _swigc__p_double,
  _swigc__p_f_r_q_const__std__vector__double___r_std__vector__double___p_void__double,
  _swigc__p_int,
  _swigc__p_nlopt__forced_stop,
  _swigc__p_nlopt__opt,
  _swigc__p_nlopt__roundoff_limited,
  _swigc__p_nlopt_func,
  _swigc__p_nlopt_mfunc,
  _swigc__p_nlopt_munge,
  _swigc__p_nlopt_opt,
  _swigc__p_nlopt_result,
  _swigc__p_std__out_of_range,
  _swigc__p_std__vectorT_double_t,
  _swigc__p_unsigned_long,
};


/* -------- 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 staticly 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 found, 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);
    module_head = &swig_module;
  } else {
    /* the interpreter has loaded a SWIG module, but has it loaded this one? */
    found=0;
    iter=module_head;
    do {
      if (iter==&swig_module) {
        found=1;
        break;
      }
      iter=iter->next;
    } while (iter!= module_head);
    
    /* if the is found in the list, then all is done and we may leave */
    if (found) return;
    /* otherwise we must add out 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


SWIG_GUILE_INIT_STATIC void
SWIG_init(void)
{
  SWIG_InitializeModule(0);
  SWIG_PropagateClientData();
  
  SWIG_TypeClientData(SWIGTYPE_p_std__vectorT_double_t, (void *) &_swig_guile_clientdatanlopt_doublevector);
  scm_c_define_gsubr("new-nlopt-doublevector", 0, 0, 1, (swig_guile_proc) _wrap_new_nlopt_doublevector);
  scm_c_define_gsubr("nlopt-doublevector-length", 1, 0, 0, (swig_guile_proc) _wrap_nlopt_doublevector_length);
  scm_c_define_gsubr("nlopt-doublevector-empty?", 1, 0, 0, (swig_guile_proc) _wrap_nlopt_doublevector_emptyq___);
  scm_c_define_gsubr("nlopt-doublevector-clear!", 1, 0, 0, (swig_guile_proc) _wrap_nlopt_doublevector_clearN___);
  scm_c_define_gsubr("nlopt-doublevector-push!", 2, 0, 0, (swig_guile_proc) _wrap_nlopt_doublevector_pushN___);
  scm_c_define_gsubr("nlopt-doublevector-pop!", 1, 0, 0, (swig_guile_proc) _wrap_nlopt_doublevector_popN___);
  scm_c_define_gsubr("nlopt-doublevector-ref", 2, 0, 0, (swig_guile_proc) _wrap_nlopt_doublevector_ref);
  scm_c_define_gsubr("nlopt-doublevector-set!", 3, 0, 0, (swig_guile_proc) _wrap_nlopt_doublevector_setN___);
  ((swig_guile_clientdata *)(SWIGTYPE_p_std__vectorT_double_t->clientdata))->destroy = (guile_destructor) _wrap_delete_nlopt_doublevector;
  scm_c_define_gsubr("delete-nlopt-doublevector", 1, 0, 0, (swig_guile_proc) _wrap_delete_nlopt_doublevector);
  scm_c_define_gsubr("nlopt-get-initial-step", 2, 0, 0, (swig_guile_proc) _wrap_nlopt_get_initial_step);
  scm_c_define_gsubr("NLOPT-GN-DIRECT", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_GN_DIRECT);
  scm_c_define_gsubr("NLOPT-GN-DIRECT-L", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_GN_DIRECT_L);
  scm_c_define_gsubr("NLOPT-GN-DIRECT-L-RAND", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_GN_DIRECT_L_RAND);
  scm_c_define_gsubr("NLOPT-GN-DIRECT-NOSCAL", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_GN_DIRECT_NOSCAL);
  scm_c_define_gsubr("NLOPT-GN-DIRECT-L-NOSCAL", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_GN_DIRECT_L_NOSCAL);
  scm_c_define_gsubr("NLOPT-GN-DIRECT-L-RAND-NOSCAL", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_GN_DIRECT_L_RAND_NOSCAL);
  scm_c_define_gsubr("NLOPT-GN-ORIG-DIRECT", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_GN_ORIG_DIRECT);
  scm_c_define_gsubr("NLOPT-GN-ORIG-DIRECT-L", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_GN_ORIG_DIRECT_L);
  scm_c_define_gsubr("NLOPT-GD-STOGO", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_GD_STOGO);
  scm_c_define_gsubr("NLOPT-GD-STOGO-RAND", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_GD_STOGO_RAND);
  scm_c_define_gsubr("NLOPT-LD-LBFGS-NOCEDAL", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_LD_LBFGS_NOCEDAL);
  scm_c_define_gsubr("NLOPT-LD-LBFGS", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_LD_LBFGS);
  scm_c_define_gsubr("NLOPT-LN-PRAXIS", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_LN_PRAXIS);
  scm_c_define_gsubr("NLOPT-LD-VAR1", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_LD_VAR1);
  scm_c_define_gsubr("NLOPT-LD-VAR2", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_LD_VAR2);
  scm_c_define_gsubr("NLOPT-LD-TNEWTON", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_LD_TNEWTON);
  scm_c_define_gsubr("NLOPT-LD-TNEWTON-RESTART", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_LD_TNEWTON_RESTART);
  scm_c_define_gsubr("NLOPT-LD-TNEWTON-PRECOND", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_LD_TNEWTON_PRECOND);
  scm_c_define_gsubr("NLOPT-LD-TNEWTON-PRECOND-RESTART", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_LD_TNEWTON_PRECOND_RESTART);
  scm_c_define_gsubr("NLOPT-GN-CRS2-LM", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_GN_CRS2_LM);
  scm_c_define_gsubr("NLOPT-GN-MLSL", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_GN_MLSL);
  scm_c_define_gsubr("NLOPT-GD-MLSL", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_GD_MLSL);
  scm_c_define_gsubr("NLOPT-GN-MLSL-LDS", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_GN_MLSL_LDS);
  scm_c_define_gsubr("NLOPT-GD-MLSL-LDS", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_GD_MLSL_LDS);
  scm_c_define_gsubr("NLOPT-LD-MMA", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_LD_MMA);
  scm_c_define_gsubr("NLOPT-LN-COBYLA", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_LN_COBYLA);
  scm_c_define_gsubr("NLOPT-LN-NEWUOA", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_LN_NEWUOA);
  scm_c_define_gsubr("NLOPT-LN-NEWUOA-BOUND", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_LN_NEWUOA_BOUND);
  scm_c_define_gsubr("NLOPT-LN-NELDERMEAD", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_LN_NELDERMEAD);
  scm_c_define_gsubr("NLOPT-LN-SBPLX", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_LN_SBPLX);
  scm_c_define_gsubr("NLOPT-LN-AUGLAG", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_LN_AUGLAG);
  scm_c_define_gsubr("NLOPT-LD-AUGLAG", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_LD_AUGLAG);
  scm_c_define_gsubr("NLOPT-LN-AUGLAG-EQ", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_LN_AUGLAG_EQ);
  scm_c_define_gsubr("NLOPT-LD-AUGLAG-EQ", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_LD_AUGLAG_EQ);
  scm_c_define_gsubr("NLOPT-LN-BOBYQA", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_LN_BOBYQA);
  scm_c_define_gsubr("NLOPT-GN-ISRES", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_GN_ISRES);
  scm_c_define_gsubr("NLOPT-AUGLAG", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_AUGLAG);
  scm_c_define_gsubr("NLOPT-AUGLAG-EQ", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_AUGLAG_EQ);
  scm_c_define_gsubr("NLOPT-G-MLSL", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_G_MLSL);
  scm_c_define_gsubr("NLOPT-G-MLSL-LDS", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_G_MLSL_LDS);
  scm_c_define_gsubr("NLOPT-LD-SLSQP", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_LD_SLSQP);
  scm_c_define_gsubr("NLOPT-LD-CCSAQ", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_LD_CCSAQ);
  scm_c_define_gsubr("NLOPT-GN-ESCH", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_GN_ESCH);
  scm_c_define_gsubr("NLOPT-NUM-ALGORITHMS", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_NUM_ALGORITHMS);
  scm_c_define_gsubr("NLOPT-FAILURE", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_FAILURE);
  scm_c_define_gsubr("NLOPT-INVALID-ARGS", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_INVALID_ARGS);
  scm_c_define_gsubr("NLOPT-OUT-OF-MEMORY", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_OUT_OF_MEMORY);
  scm_c_define_gsubr("NLOPT-ROUNDOFF-LIMITED", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_ROUNDOFF_LIMITED);
  scm_c_define_gsubr("NLOPT-FORCED-STOP", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_FORCED_STOP);
  scm_c_define_gsubr("NLOPT-SUCCESS", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_SUCCESS);
  scm_c_define_gsubr("NLOPT-STOPVAL-REACHED", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_STOPVAL_REACHED);
  scm_c_define_gsubr("NLOPT-FTOL-REACHED", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_FTOL_REACHED);
  scm_c_define_gsubr("NLOPT-XTOL-REACHED", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_XTOL_REACHED);
  scm_c_define_gsubr("NLOPT-MAXEVAL-REACHED", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_MAXEVAL_REACHED);
  scm_c_define_gsubr("NLOPT-MAXTIME-REACHED", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_MAXTIME_REACHED);
  SWIG_TypeClientData(SWIGTYPE_p_nlopt__roundoff_limited, (void *) &_swig_guile_clientdatanlopt_roundoff_limited);
  scm_c_define_gsubr("new-nlopt-roundoff-limited", 0, 0, 0, (swig_guile_proc) _wrap_new_nlopt_roundoff_limited);
  ((swig_guile_clientdata *)(SWIGTYPE_p_nlopt__roundoff_limited->clientdata))->destroy = (guile_destructor) _wrap_delete_nlopt_roundoff_limited;
  scm_c_define_gsubr("delete-nlopt-roundoff-limited", 1, 0, 0, (swig_guile_proc) _wrap_delete_nlopt_roundoff_limited);
  SWIG_TypeClientData(SWIGTYPE_p_nlopt__forced_stop, (void *) &_swig_guile_clientdatanlopt_forced_stop);
  scm_c_define_gsubr("new-nlopt-forced-stop", 0, 0, 0, (swig_guile_proc) _wrap_new_nlopt_forced_stop);
  ((swig_guile_clientdata *)(SWIGTYPE_p_nlopt__forced_stop->clientdata))->destroy = (guile_destructor) _wrap_delete_nlopt_forced_stop;
  scm_c_define_gsubr("delete-nlopt-forced-stop", 1, 0, 0, (swig_guile_proc) _wrap_delete_nlopt_forced_stop);
  SWIG_TypeClientData(SWIGTYPE_p_nlopt__opt, (void *) &_swig_guile_clientdatanlopt_opt);
  ((swig_guile_clientdata *)(SWIGTYPE_p_nlopt__opt->clientdata))->destroy = (guile_destructor) _wrap_delete_nlopt_opt;
  scm_c_define_gsubr("delete-nlopt-opt", 1, 0, 0, (swig_guile_proc) _wrap_delete_nlopt_opt);
  scm_c_define_gsubr("new-nlopt-opt", 0, 0, 1, (swig_guile_proc) _wrap_new_nlopt_opt);
  scm_c_define_gsubr("nlopt-opt-optimize", 0, 0, 1, (swig_guile_proc) _wrap_nlopt_opt_optimize);
  scm_c_define_gsubr("nlopt-opt-last-optimize-result", 1, 0, 0, (swig_guile_proc) _wrap_nlopt_opt_last_optimize_result);
  scm_c_define_gsubr("nlopt-opt-last-optimum-value", 1, 0, 0, (swig_guile_proc) _wrap_nlopt_opt_last_optimum_value);
  scm_c_define_gsubr("nlopt-opt-get-algorithm", 1, 0, 0, (swig_guile_proc) _wrap_nlopt_opt_get_algorithm);
  scm_c_define_gsubr("nlopt-opt-get-algorithm-name", 1, 0, 0, (swig_guile_proc) _wrap_nlopt_opt_get_algorithm_name);
  scm_c_define_gsubr("nlopt-opt-get-dimension", 1, 0, 0, (swig_guile_proc) _wrap_nlopt_opt_get_dimension);
  scm_c_define_gsubr("nlopt-opt-set-min-objective", 0, 0, 1, (swig_guile_proc) _wrap_nlopt_opt_set_min_objective);
  scm_c_define_gsubr("nlopt-opt-set-max-objective", 0, 0, 1, (swig_guile_proc) _wrap_nlopt_opt_set_max_objective);
  scm_c_define_gsubr("nlopt-opt-remove-inequality-constraints", 1, 0, 0, (swig_guile_proc) _wrap_nlopt_opt_remove_inequality_constraints);
  scm_c_define_gsubr("nlopt-opt-remove-equality-constraints", 1, 0, 0, (swig_guile_proc) _wrap_nlopt_opt_remove_equality_constraints);
  scm_c_define_gsubr("nlopt-opt-add-inequality-constraint", 0, 0, 1, (swig_guile_proc) _wrap_nlopt_opt_add_inequality_constraint);
  scm_c_define_gsubr("nlopt-opt-add-equality-constraint", 0, 0, 1, (swig_guile_proc) _wrap_nlopt_opt_add_equality_constraint);
  scm_c_define_gsubr("nlopt-opt-add-inequality-mconstraint", 0, 0, 1, (swig_guile_proc) _wrap_nlopt_opt_add_inequality_mconstraint);
  scm_c_define_gsubr("nlopt-opt-add-equality-mconstraint", 0, 0, 1, (swig_guile_proc) _wrap_nlopt_opt_add_equality_mconstraint);
  scm_c_define_gsubr("nlopt-opt-get-lower-bounds", 0, 0, 1, (swig_guile_proc) _wrap_nlopt_opt_get_lower_bounds);
  scm_c_define_gsubr("nlopt-opt-set-lower-bounds", 0, 0, 1, (swig_guile_proc) _wrap_nlopt_opt_set_lower_bounds);
  scm_c_define_gsubr("nlopt-opt-get-upper-bounds", 0, 0, 1, (swig_guile_proc) _wrap_nlopt_opt_get_upper_bounds);
  scm_c_define_gsubr("nlopt-opt-set-upper-bounds", 0, 0, 1, (swig_guile_proc) _wrap_nlopt_opt_set_upper_bounds);
  scm_c_define_gsubr("nlopt-opt-get-stopval", 1, 0, 0, (swig_guile_proc) _wrap_nlopt_opt_get_stopval);
  scm_c_define_gsubr("nlopt-opt-set-stopval", 2, 0, 0, (swig_guile_proc) _wrap_nlopt_opt_set_stopval);
  scm_c_define_gsubr("nlopt-opt-get-ftol-rel", 1, 0, 0, (swig_guile_proc) _wrap_nlopt_opt_get_ftol_rel);
  scm_c_define_gsubr("nlopt-opt-set-ftol-rel", 2, 0, 0, (swig_guile_proc) _wrap_nlopt_opt_set_ftol_rel);
  scm_c_define_gsubr("nlopt-opt-get-ftol-abs", 1, 0, 0, (swig_guile_proc) _wrap_nlopt_opt_get_ftol_abs);
  scm_c_define_gsubr("nlopt-opt-set-ftol-abs", 2, 0, 0, (swig_guile_proc) _wrap_nlopt_opt_set_ftol_abs);
  scm_c_define_gsubr("nlopt-opt-get-xtol-rel", 1, 0, 0, (swig_guile_proc) _wrap_nlopt_opt_get_xtol_rel);
  scm_c_define_gsubr("nlopt-opt-set-xtol-rel", 2, 0, 0, (swig_guile_proc) _wrap_nlopt_opt_set_xtol_rel);
  scm_c_define_gsubr("nlopt-opt-get-xtol-abs", 0, 0, 1, (swig_guile_proc) _wrap_nlopt_opt_get_xtol_abs);
  scm_c_define_gsubr("nlopt-opt-set-xtol-abs", 0, 0, 1, (swig_guile_proc) _wrap_nlopt_opt_set_xtol_abs);
  scm_c_define_gsubr("nlopt-opt-get-maxeval", 1, 0, 0, (swig_guile_proc) _wrap_nlopt_opt_get_maxeval);
  scm_c_define_gsubr("nlopt-opt-set-maxeval", 2, 0, 0, (swig_guile_proc) _wrap_nlopt_opt_set_maxeval);
  scm_c_define_gsubr("nlopt-opt-get-maxtime", 1, 0, 0, (swig_guile_proc) _wrap_nlopt_opt_get_maxtime);
  scm_c_define_gsubr("nlopt-opt-set-maxtime", 2, 0, 0, (swig_guile_proc) _wrap_nlopt_opt_set_maxtime);
  scm_c_define_gsubr("nlopt-opt-get-force-stop", 1, 0, 0, (swig_guile_proc) _wrap_nlopt_opt_get_force_stop);
  scm_c_define_gsubr("nlopt-opt-set-force-stop", 2, 0, 0, (swig_guile_proc) _wrap_nlopt_opt_set_force_stop);
  scm_c_define_gsubr("nlopt-opt-force-stop", 1, 0, 0, (swig_guile_proc) _wrap_nlopt_opt_force_stop);
  scm_c_define_gsubr("nlopt-opt-set-local-optimizer", 2, 0, 0, (swig_guile_proc) _wrap_nlopt_opt_set_local_optimizer);
  scm_c_define_gsubr("nlopt-opt-get-population", 1, 0, 0, (swig_guile_proc) _wrap_nlopt_opt_get_population);
  scm_c_define_gsubr("nlopt-opt-set-population", 2, 0, 0, (swig_guile_proc) _wrap_nlopt_opt_set_population);
  scm_c_define_gsubr("nlopt-opt-get-vector-storage", 1, 0, 0, (swig_guile_proc) _wrap_nlopt_opt_get_vector_storage);
  scm_c_define_gsubr("nlopt-opt-set-vector-storage", 2, 0, 0, (swig_guile_proc) _wrap_nlopt_opt_set_vector_storage);
  scm_c_define_gsubr("nlopt-opt-set-initial-step", 0, 0, 1, (swig_guile_proc) _wrap_nlopt_opt_set_initial_step);
  scm_c_define_gsubr("nlopt-opt-set-default-initial-step", 2, 0, 0, (swig_guile_proc) _wrap_nlopt_opt_set_default_initial_step);
  scm_c_define_gsubr("nlopt-opt-get-initial-step", 0, 0, 1, (swig_guile_proc) _wrap_nlopt_opt_get_initial_step);
  scm_c_define_gsubr("nlopt-opt-get-initial-step-", 2, 0, 0, (swig_guile_proc) _wrap_nlopt_opt_get_initial_step_);
  scm_c_define_gsubr("nlopt-srand", 1, 0, 0, (swig_guile_proc) _wrap_nlopt_srand);
  scm_c_define_gsubr("nlopt-srand-time", 0, 0, 0, (swig_guile_proc) _wrap_nlopt_srand_time);
  scm_c_define_gsubr("nlopt-version", 3, 0, 0, (swig_guile_proc) _wrap_nlopt_version);
  scm_c_define_gsubr("nlopt-version-major", 0, 0, 0, (swig_guile_proc) _wrap_nlopt_version_major);
  scm_c_define_gsubr("nlopt-version-minor", 0, 0, 0, (swig_guile_proc) _wrap_nlopt_version_minor);
  scm_c_define_gsubr("nlopt-version-bugfix", 0, 0, 0, (swig_guile_proc) _wrap_nlopt_version_bugfix);
  scm_c_define_gsubr("nlopt-algorithm-name", 1, 0, 0, (swig_guile_proc) _wrap_nlopt_algorithm_name);
}

#ifdef __cplusplus
}
#endif
extern "C" {
/* Linkage: simple */

}

