1 /* ----------------------------------------------------------------------------
2 * This file was automatically generated by SWIG (http://www.swig.org).
5 * This file is not intended to be easily readable and contains a number of
6 * coding conventions designed to improve portability and efficiency. Do not make
7 * changes to this file unless you know what you are doing--modify the SWIG
8 * interface file instead.
9 * ----------------------------------------------------------------------------- */
12 #define SWIG_GUILE_INIT_STATIC extern
15 SWIG_GUILE_INIT_STATIC void
22 /* SwigValueWrapper is described in swig.swg */
23 template<typename T> class SwigValueWrapper {
24 struct SwigMovePointer {
26 SwigMovePointer(T *p) : ptr(p) { }
27 ~SwigMovePointer() { delete ptr; }
28 SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; }
30 SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
31 SwigValueWrapper(const SwigValueWrapper<T>& rhs);
33 SwigValueWrapper() : pointer(0) { }
34 SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; }
35 operator T&() const { return *pointer.ptr; }
36 T *operator&() { return pointer.ptr; }
39 template <typename T> T SwigValueInit() {
44 /* -----------------------------------------------------------------------------
45 * This section contains generic SWIG labels for method/variable
46 * declarations/attributes, and other compiler dependent labels.
47 * ----------------------------------------------------------------------------- */
49 /* template workaround for compilers that cannot correctly implement the C++ standard */
50 #ifndef SWIGTEMPLATEDISAMBIGUATOR
51 # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
52 # define SWIGTEMPLATEDISAMBIGUATOR template
53 # elif defined(__HP_aCC)
54 /* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
55 /* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
56 # define SWIGTEMPLATEDISAMBIGUATOR template
58 # define SWIGTEMPLATEDISAMBIGUATOR
62 /* inline attribute */
64 # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
65 # define SWIGINLINE inline
71 /* attribute recognised by some compilers to avoid 'unused' warnings */
73 # if defined(__GNUC__)
74 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
75 # define SWIGUNUSED __attribute__ ((__unused__))
80 # define SWIGUNUSED __attribute__ ((__unused__))
86 #ifndef SWIG_MSC_UNSUPPRESS_4505
87 # if defined(_MSC_VER)
88 # pragma warning(disable : 4505) /* unreferenced local function has been removed */
92 #ifndef SWIGUNUSEDPARM
94 # define SWIGUNUSEDPARM(p)
96 # define SWIGUNUSEDPARM(p) p SWIGUNUSED
100 /* internal SWIG method */
102 # define SWIGINTERN static SWIGUNUSED
105 /* internal inline SWIG method */
106 #ifndef SWIGINTERNINLINE
107 # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
110 /* exporting methods */
111 #if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
112 # ifndef GCC_HASCLASSVISIBILITY
113 # define GCC_HASCLASSVISIBILITY
118 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
119 # if defined(STATIC_LINKED)
122 # define SWIGEXPORT __declspec(dllexport)
125 # if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
126 # define SWIGEXPORT __attribute__ ((visibility("default")))
133 /* calling conventions for Windows */
135 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
136 # define SWIGSTDCALL __stdcall
142 /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
143 #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
144 # define _CRT_SECURE_NO_DEPRECATE
147 /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
148 #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
149 # define _SCL_SECURE_NO_DEPRECATE
153 /* -----------------------------------------------------------------------------
156 * This file contains generic C API SWIG runtime support for pointer
158 * ----------------------------------------------------------------------------- */
160 /* This should only be incremented when either the layout of swig_type_info changes,
161 or for whatever reason, the runtime changes incompatibly */
162 #define SWIG_RUNTIME_VERSION "4"
164 /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
165 #ifdef SWIG_TYPE_TABLE
166 # define SWIG_QUOTE_STRING(x) #x
167 # define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
168 # define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
170 # define SWIG_TYPE_TABLE_NAME
174 You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
175 creating a static or dynamic library from the SWIG runtime code.
176 In 99.9% of the cases, SWIG just needs to declare them as 'static'.
178 But only do this if strictly necessary, ie, if you have problems
179 with your compiler or suchlike.
183 # define SWIGRUNTIME SWIGINTERN
186 #ifndef SWIGRUNTIMEINLINE
187 # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
190 /* Generic buffer size */
191 #ifndef SWIG_BUFFER_SIZE
192 # define SWIG_BUFFER_SIZE 1024
195 /* Flags for pointer conversions */
196 #define SWIG_POINTER_DISOWN 0x1
197 #define SWIG_CAST_NEW_MEMORY 0x2
199 /* Flags for new pointer objects */
200 #define SWIG_POINTER_OWN 0x1
204 Flags/methods for returning states.
206 The SWIG conversion methods, as ConvertPtr, return an integer
207 that tells if the conversion was successful or not. And if not,
208 an error code can be returned (see swigerrors.swg for the codes).
210 Use the following macros/flags to set or process the returning
213 In old versions of SWIG, code such as the following was usually written:
215 if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
221 Now you can be more explicit:
223 int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
224 if (SWIG_IsOK(res)) {
230 which is the same really, but now you can also do
233 int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
234 if (SWIG_IsOK(res)) {
236 if (SWIG_IsNewObj(res) {
246 I.e., now SWIG_ConvertPtr can return new objects and you can
247 identify the case and take care of the deallocation. Of course that
248 also requires SWIG_ConvertPtr to return new result values, such as
250 int SWIG_ConvertPtr(obj, ptr,...) {
252 if (<need new object>) {
253 *ptr = <ptr to new allocated object>;
256 *ptr = <ptr to old object>;
264 Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
265 more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
268 Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
269 allows to return the 'cast rank', for example, if you have this
276 food(1) // cast rank '1' (1 -> 1.0)
277 fooi(1) // cast rank '0'
279 just use the SWIG_AddCast()/SWIG_CheckState()
283 #define SWIG_ERROR (-1)
284 #define SWIG_IsOK(r) (r >= 0)
285 #define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
287 /* The CastRankLimit says how many bits are used for the cast rank */
288 #define SWIG_CASTRANKLIMIT (1 << 8)
289 /* The NewMask denotes the object was created (using new/malloc) */
290 #define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1)
291 /* The TmpMask is for in/out typemaps that use temporal objects */
292 #define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1)
293 /* Simple returning values */
294 #define SWIG_BADOBJ (SWIG_ERROR)
295 #define SWIG_OLDOBJ (SWIG_OK)
296 #define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK)
297 #define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK)
298 /* Check, add and del mask methods */
299 #define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
300 #define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
301 #define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
302 #define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
303 #define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
304 #define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
307 #if defined(SWIG_CASTRANK_MODE)
308 # ifndef SWIG_TypeRank
309 # define SWIG_TypeRank unsigned long
311 # ifndef SWIG_MAXCASTRANK /* Default cast allowed */
312 # define SWIG_MAXCASTRANK (2)
314 # define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1)
315 # define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK)
316 SWIGINTERNINLINE int SWIG_AddCast(int r) {
317 return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
319 SWIGINTERNINLINE int SWIG_CheckState(int r) {
320 return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
322 #else /* no cast-rank mode */
323 # define SWIG_AddCast(r) (r)
324 # define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
334 typedef void *(*swig_converter_func)(void *, int *);
335 typedef struct swig_type_info *(*swig_dycast_func)(void **);
337 /* Structure to store information on one type */
338 typedef struct swig_type_info {
339 const char *name; /* mangled name of this type */
340 const char *str; /* human readable name of this type */
341 swig_dycast_func dcast; /* dynamic cast function down a hierarchy */
342 struct swig_cast_info *cast; /* linked list of types that can cast into this type */
343 void *clientdata; /* language specific type data */
344 int owndata; /* flag if the structure owns the clientdata */
347 /* Structure to store a type and conversion function used for casting */
348 typedef struct swig_cast_info {
349 swig_type_info *type; /* pointer to type that is equivalent to this type */
350 swig_converter_func converter; /* function to cast the void pointers */
351 struct swig_cast_info *next; /* pointer to next cast in linked list */
352 struct swig_cast_info *prev; /* pointer to the previous cast */
355 /* Structure used to store module information
356 * Each module generates one structure like this, and the runtime collects
357 * all of these structures and stores them in a circularly linked list.*/
358 typedef struct swig_module_info {
359 swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */
360 size_t size; /* Number of types in this module */
361 struct swig_module_info *next; /* Pointer to next element in circularly linked list */
362 swig_type_info **type_initial; /* Array of initially generated type structures */
363 swig_cast_info **cast_initial; /* Array of initially generated casting structures */
364 void *clientdata; /* Language specific module data */
368 Compare two type names skipping the space characters, therefore
369 "char*" == "char *" and "Class<int>" == "Class<int >", etc.
371 Return 0 when the two name types are equivalent, as in
372 strncmp, but skipping ' '.
375 SWIG_TypeNameComp(const char *f1, const char *l1,
376 const char *f2, const char *l2) {
377 for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
378 while ((*f1 == ' ') && (f1 != l1)) ++f1;
379 while ((*f2 == ' ') && (f2 != l2)) ++f2;
380 if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
382 return (int)((l1 - f1) - (l2 - f2));
386 Check type equivalence in a name list like <name1>|<name2>|...
387 Return 0 if equal, -1 if nb < tb, 1 if nb > tb
390 SWIG_TypeCmp(const char *nb, const char *tb) {
392 const char* te = tb + strlen(tb);
394 while (equiv != 0 && *ne) {
395 for (nb = ne; *ne; ++ne) {
396 if (*ne == '|') break;
398 equiv = SWIG_TypeNameComp(nb, ne, tb, te);
405 Check type equivalence in a name list like <name1>|<name2>|...
406 Return 0 if not equal, 1 if equal
409 SWIG_TypeEquiv(const char *nb, const char *tb) {
410 return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0;
416 SWIGRUNTIME swig_cast_info *
417 SWIG_TypeCheck(const char *c, swig_type_info *ty) {
419 swig_cast_info *iter = ty->cast;
421 if (strcmp(iter->type->name, c) == 0) {
422 if (iter == ty->cast)
424 /* Move iter to the top of the linked list */
425 iter->prev->next = iter->next;
427 iter->next->prev = iter->prev;
428 iter->next = ty->cast;
430 if (ty->cast) ty->cast->prev = iter;
441 Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
443 SWIGRUNTIME swig_cast_info *
444 SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
446 swig_cast_info *iter = ty->cast;
448 if (iter->type == from) {
449 if (iter == ty->cast)
451 /* Move iter to the top of the linked list */
452 iter->prev->next = iter->next;
454 iter->next->prev = iter->prev;
455 iter->next = ty->cast;
457 if (ty->cast) ty->cast->prev = iter;
468 Cast a pointer up an inheritance hierarchy
470 SWIGRUNTIMEINLINE void *
471 SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
472 return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
476 Dynamic pointer casting. Down an inheritance hierarchy
478 SWIGRUNTIME swig_type_info *
479 SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
480 swig_type_info *lastty = ty;
481 if (!ty || !ty->dcast) return ty;
482 while (ty && (ty->dcast)) {
483 ty = (*ty->dcast)(ptr);
490 Return the name associated with this type
492 SWIGRUNTIMEINLINE const char *
493 SWIG_TypeName(const swig_type_info *ty) {
498 Return the pretty name associated with this type,
499 that is an unmangled type name in a form presentable to the user.
501 SWIGRUNTIME const char *
502 SWIG_TypePrettyName(const swig_type_info *type) {
503 /* The "str" field contains the equivalent pretty names of the
504 type, separated by vertical-bar characters. We choose
505 to print the last name, as it is often (?) the most
507 if (!type) return NULL;
508 if (type->str != NULL) {
509 const char *last_name = type->str;
511 for (s = type->str; *s; s++)
512 if (*s == '|') last_name = s+1;
520 Set the clientdata field for a type
523 SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
524 swig_cast_info *cast = ti->cast;
525 /* if (ti->clientdata == clientdata) return; */
526 ti->clientdata = clientdata;
529 if (!cast->converter) {
530 swig_type_info *tc = cast->type;
531 if (!tc->clientdata) {
532 SWIG_TypeClientData(tc, clientdata);
539 SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
540 SWIG_TypeClientData(ti, clientdata);
545 Search for a swig_type_info structure only by mangled name
546 Search is a O(log #types)
548 We start searching at module start, and finish searching when start == end.
549 Note: if start == end at the beginning of the function, we go all the way around
552 SWIGRUNTIME swig_type_info *
553 SWIG_MangledTypeQueryModule(swig_module_info *start,
554 swig_module_info *end,
556 swig_module_info *iter = start;
559 register size_t l = 0;
560 register size_t r = iter->size - 1;
562 /* since l+r >= 0, we can (>> 1) instead (/ 2) */
563 register size_t i = (l + r) >> 1;
564 const char *iname = iter->types[i]->name;
566 register int compare = strcmp(name, iname);
568 return iter->types[i];
569 } else if (compare < 0) {
575 } else if (compare > 0) {
579 break; /* should never happen */
584 } while (iter != end);
589 Search for a swig_type_info structure for either a mangled name or a human readable name.
590 It first searches the mangled names of the types, which is a O(log #types)
591 If a type is not found it then searches the human readable names, which is O(#types).
593 We start searching at module start, and finish searching when start == end.
594 Note: if start == end at the beginning of the function, we go all the way around
597 SWIGRUNTIME swig_type_info *
598 SWIG_TypeQueryModule(swig_module_info *start,
599 swig_module_info *end,
601 /* STEP 1: Search the name field using binary search */
602 swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
606 /* STEP 2: If the type hasn't been found, do a complete search
607 of the str field (the human readable name) */
608 swig_module_info *iter = start;
610 register size_t i = 0;
611 for (; i < iter->size; ++i) {
612 if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
613 return iter->types[i];
616 } while (iter != end);
619 /* neither found a match */
624 Pack binary data into a string
627 SWIG_PackData(char *c, void *ptr, size_t sz) {
628 static const char hex[17] = "0123456789abcdef";
629 register const unsigned char *u = (unsigned char *) ptr;
630 register const unsigned char *eu = u + sz;
631 for (; u != eu; ++u) {
632 register unsigned char uu = *u;
633 *(c++) = hex[(uu & 0xf0) >> 4];
634 *(c++) = hex[uu & 0xf];
640 Unpack binary data from a string
642 SWIGRUNTIME const char *
643 SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
644 register unsigned char *u = (unsigned char *) ptr;
645 register const unsigned char *eu = u + sz;
646 for (; u != eu; ++u) {
647 register char d = *(c++);
648 register unsigned char uu;
649 if ((d >= '0') && (d <= '9'))
650 uu = ((d - '0') << 4);
651 else if ((d >= 'a') && (d <= 'f'))
652 uu = ((d - ('a'-10)) << 4);
656 if ((d >= '0') && (d <= '9'))
658 else if ((d >= 'a') && (d <= 'f'))
659 uu |= (d - ('a'-10));
668 Pack 'void *' into a string buffer.
671 SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
673 if ((2*sizeof(void *) + 2) > bsz) return 0;
675 r = SWIG_PackData(r,&ptr,sizeof(void *));
676 if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
681 SWIGRUNTIME const char *
682 SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
684 if (strcmp(c,"NULL") == 0) {
691 return SWIG_UnpackData(++c,ptr,sizeof(void *));
695 SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
697 size_t lname = (name ? strlen(name) : 0);
698 if ((2*sz + 2 + lname) > bsz) return 0;
700 r = SWIG_PackData(r,ptr,sz);
702 strncpy(r,name,lname+1);
709 SWIGRUNTIME const char *
710 SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
712 if (strcmp(c,"NULL") == 0) {
719 return SWIG_UnpackData(++c,ptr,sz);
726 /* -----------------------------------------------------------------------------
728 * ----------------------------------------------------------------------------- */
730 #include <libguile.h>
741 /* In the code below, use guile 2.0 compatible functions where possible.
742 Functions that don't exist in older versions will be mapped to
743 a deprecated equivalent for those versions only */
744 #if defined (SCM_MAJOR_VERSION) && (SCM_MAJOR_VERSION < 2)
747 scm_module_variable (SCM module, SCM sym)
749 return scm_sym2var (sym, scm_module_lookup_closure (module), SCM_BOOL_F);
754 #if SCM_MAJOR_VERSION >= 2
755 // scm_c_define_gsubr takes a different parameter type
756 // depending on the guile version
758 typedef scm_t_subr swig_guile_proc;
760 typedef SCM (*swig_guile_proc)();
762 typedef SCM (*guile_destructor)(SCM);
764 typedef struct swig_guile_clientdata {
765 guile_destructor destroy;
767 } swig_guile_clientdata;
769 #if SCM_MAJOR_VERSION <= 2
770 #define scm_to_utf8_string scm_to_locale_string
771 #define scm_from_utf8_string scm_from_locale_string
773 #define SWIG_scm2str(s) \
774 SWIG_Guile_scm2newstr(s, NULL)
775 #define SWIG_str02scm(str) \
776 str ? scm_from_utf8_string(str) : SCM_BOOL_F
777 # define SWIG_malloc(size) \
779 # define SWIG_free(mem) \
781 #define SWIG_ConvertPtr(s, result, type, flags) \
782 SWIG_Guile_ConvertPtr(s, result, type, flags)
783 #define SWIG_MustGetPtr(s, type, argnum, flags) \
784 SWIG_Guile_MustGetPtr(s, type, argnum, flags, FUNC_NAME)
785 #define SWIG_NewPointerObj(ptr, type, owner) \
786 SWIG_Guile_NewPointerObj((void*)ptr, type, owner)
787 #define SWIG_PointerAddress(object) \
788 SWIG_Guile_PointerAddress(object)
789 #define SWIG_PointerType(object) \
790 SWIG_Guile_PointerType(object)
791 #define SWIG_IsPointerOfType(object, type) \
792 SWIG_Guile_IsPointerOfType(object, type)
793 #define SWIG_IsPointer(object) \
794 SWIG_Guile_IsPointer(object)
795 #define SWIG_contract_assert(expr, msg) \
797 scm_error(scm_from_locale_symbol("swig-contract-assertion-failed"), \
798 (char *) FUNC_NAME, (char *) msg, \
799 SCM_EOL, SCM_BOOL_F); else
801 /* for C++ member pointers, ie, member methods */
802 #define SWIG_ConvertMember(obj, ptr, sz, ty) \
803 SWIG_Guile_ConvertMember(obj, ptr, sz, ty, FUNC_NAME)
804 #define SWIG_NewMemberObj(ptr, sz, type) \
805 SWIG_Guile_NewMemberObj(ptr, sz, type, FUNC_NAME)
808 static swig_module_info *SWIG_Guile_GetModule(void *SWIGUNUSEDPARM(clientdata));
809 #define SWIG_GetModule(clientdata) SWIG_Guile_GetModule(clientdata)
810 #define SWIG_SetModule(clientdata, pointer) SWIG_Guile_SetModule(pointer)
813 SWIG_Guile_scm2newstr(SCM str, size_t *len) {
814 #define FUNC_NAME "SWIG_Guile_scm2newstr"
817 SCM_ASSERT (scm_is_string(str), str, 1, FUNC_NAME);
819 ret = scm_to_utf8_string(str);
820 if (!ret) return NULL;
822 if (len) *len = strlen(ret) - 1;
827 static int swig_initialized = 0;
828 static scm_t_bits swig_tag = 0;
829 static scm_t_bits swig_collectable_tag = 0;
830 static scm_t_bits swig_destroyed_tag = 0;
831 static scm_t_bits swig_member_function_tag = 0;
832 static SCM swig_make_func = SCM_EOL;
833 static SCM swig_keyword = SCM_EOL;
834 static SCM swig_symbol = SCM_EOL;
836 #define SWIG_Guile_GetSmob(x) \
837 ( !scm_is_null(x) && SCM_INSTANCEP(x) && scm_is_true(scm_slot_exists_p(x, swig_symbol)) \
838 ? scm_slot_ref(x, swig_symbol) : (x) )
841 SWIG_Guile_NewPointerObj(void *ptr, swig_type_info *type, int owner)
847 swig_guile_clientdata *cdata = (swig_guile_clientdata *) type->clientdata;
849 SCM_NEWSMOB2(smob, swig_collectable_tag, ptr, (void *) type);
851 SCM_NEWSMOB2(smob, swig_tag, ptr, (void *) type);
853 if (!cdata || SCM_NULLP(cdata->goops_class) || swig_make_func == SCM_EOL ) {
856 /* the scm_make() C function only handles the creation of gf,
857 methods and classes (no instances) the (make ...) function is
858 later redefined in goops.scm. So we need to call that
860 return scm_apply(swig_make_func,
861 scm_list_3(cdata->goops_class,
869 SWIGINTERN unsigned long
870 SWIG_Guile_PointerAddress(SCM object)
872 SCM smob = SWIG_Guile_GetSmob(object);
873 if (SCM_NULLP(smob)) return 0;
874 else if (SCM_SMOB_PREDICATE(swig_tag, smob)
875 || SCM_SMOB_PREDICATE(swig_collectable_tag, smob)
876 || SCM_SMOB_PREDICATE(swig_destroyed_tag, smob)) {
877 return (unsigned long) (void *) SCM_CELL_WORD_1(smob);
879 else scm_wrong_type_arg("SWIG-Guile-PointerAddress", 1, object);
882 SWIGINTERN swig_type_info *
883 SWIG_Guile_PointerType(SCM object)
885 SCM smob = SWIG_Guile_GetSmob(object);
886 if (SCM_NULLP(smob)) return NULL;
887 else if (SCM_SMOB_PREDICATE(swig_tag, smob)
888 || SCM_SMOB_PREDICATE(swig_collectable_tag, smob)
889 || SCM_SMOB_PREDICATE(swig_destroyed_tag, smob)) {
890 return (swig_type_info *) SCM_CELL_WORD_2(smob);
892 else scm_wrong_type_arg("SWIG-Guile-PointerType", 1, object);
896 SWIG_Guile_ConvertPtr(SCM s, void **result, swig_type_info *type, int flags)
898 swig_cast_info *cast;
899 swig_type_info *from;
900 SCM smob = SWIG_Guile_GetSmob(s);
902 if (SCM_NULLP(smob)) {
905 } else if (SCM_SMOB_PREDICATE(swig_tag, smob) || SCM_SMOB_PREDICATE(swig_collectable_tag, smob)) {
906 /* we do not accept smobs representing destroyed pointers */
907 from = (swig_type_info *) SCM_CELL_WORD_2(smob);
908 if (!from) return SWIG_ERROR;
910 cast = SWIG_TypeCheckStruct(from, type);
913 *result = SWIG_TypeCast(cast, (void *) SCM_CELL_WORD_1(smob), &newmemory);
914 assert(!newmemory); /* newmemory handling not yet implemented */
920 *result = (void *) SCM_CELL_WORD_1(smob);
927 SWIGINTERNINLINE void *
928 SWIG_Guile_MustGetPtr (SCM s, swig_type_info *type,
929 int argnum, int flags, const char *func_name)
932 int res = SWIG_Guile_ConvertPtr(s, &result, type, flags);
933 if (!SWIG_IsOK(res)) {
935 scm_wrong_type_arg((char *) func_name, argnum, s);
941 SWIG_Guile_IsPointerOfType (SCM s, swig_type_info *type)
944 if (SWIG_Guile_ConvertPtr(s, &result, type, 0)) {
952 SWIG_Guile_IsPointer (SCM s)
954 /* module might not be initialized yet, so initialize it */
956 return SWIG_Guile_IsPointerOfType (s, NULL);
959 /* Mark a pointer object non-collectable */
961 SWIG_Guile_MarkPointerNoncollectable(SCM s)
963 SCM smob = SWIG_Guile_GetSmob(s);
964 if (!SCM_NULLP(smob)) {
965 if (SCM_SMOB_PREDICATE(swig_tag, smob) || SCM_SMOB_PREDICATE(swig_collectable_tag, smob)) {
966 SCM_SET_CELL_TYPE(smob, swig_tag);
968 else scm_wrong_type_arg(NULL, 0, s);
972 /* Mark a pointer object destroyed */
974 SWIG_Guile_MarkPointerDestroyed(SCM s)
976 SCM smob = SWIG_Guile_GetSmob(s);
977 if (!SCM_NULLP(smob)) {
978 if (SCM_SMOB_PREDICATE(swig_tag, smob) || SCM_SMOB_PREDICATE(swig_collectable_tag, smob)) {
979 SCM_SET_CELL_TYPE(smob, swig_destroyed_tag);
981 else scm_wrong_type_arg(NULL, 0, s);
985 /* Member functions */
988 SWIG_Guile_NewMemberObj(void *ptr, size_t sz, swig_type_info *type,
989 const char *func_name)
992 void *copy = malloc(sz);
993 memcpy(copy, ptr, sz);
994 SCM_NEWSMOB2(smob, swig_member_function_tag, copy, (void *) type);
999 SWIG_Guile_ConvertMember(SCM smob, void *ptr, size_t sz, swig_type_info *type,
1000 const char *func_name)
1002 swig_cast_info *cast;
1003 swig_type_info *from;
1005 if (SCM_SMOB_PREDICATE(swig_member_function_tag, smob)) {
1006 from = (swig_type_info *) SCM_CELL_WORD_2(smob);
1007 if (!from) return SWIG_ERROR;
1009 cast = SWIG_TypeCheckStruct(from, type);
1010 if (!cast) return SWIG_ERROR;
1012 memcpy(ptr, (void *) SCM_CELL_WORD_1(smob), sz);
1022 print_swig_aux (SCM swig_smob, SCM port, scm_print_state *pstate,
1023 const char *attribute)
1025 swig_type_info *type;
1027 type = (swig_type_info *) SCM_CELL_WORD_2(swig_smob);
1029 scm_puts((char *) "#<", port);
1030 scm_puts((char *) attribute, port);
1031 scm_puts((char *) "swig-pointer ", port);
1032 scm_puts((char *) SWIG_TypePrettyName(type), port);
1033 scm_puts((char *) " ", port);
1034 scm_intprint((long) SCM_CELL_WORD_1(swig_smob), 16, port);
1035 scm_puts((char *) ">", port);
1036 /* non-zero means success */
1045 print_swig (SCM swig_smob, SCM port, scm_print_state *pstate)
1047 return print_swig_aux(swig_smob, port, pstate, "");
1051 print_collectable_swig (SCM swig_smob, SCM port, scm_print_state *pstate)
1053 return print_swig_aux(swig_smob, port, pstate, "collectable-");
1057 print_destroyed_swig (SCM swig_smob, SCM port, scm_print_state *pstate)
1059 return print_swig_aux(swig_smob, port, pstate, "destroyed-");
1063 print_member_function_swig (SCM swig_smob, SCM port, scm_print_state *pstate)
1065 swig_type_info *type;
1066 type = (swig_type_info *) SCM_CELL_WORD_2(swig_smob);
1068 scm_puts((char *) "#<", port);
1069 scm_puts((char *) "swig-member-function-pointer ", port);
1070 scm_puts((char *) SWIG_TypePrettyName(type), port);
1071 scm_puts((char *) " >", port);
1072 /* non-zero means success */
1080 equalp_swig (SCM A, SCM B)
1082 if (SCM_CELL_WORD_0(A) == SCM_CELL_WORD_0(B) && SCM_CELL_WORD_1(A) == SCM_CELL_WORD_1(B)
1083 && SCM_CELL_WORD_2(A) == SCM_CELL_WORD_2(B))
1085 else return SCM_BOOL_F;
1091 swig_type_info *type = (swig_type_info *) SCM_CELL_WORD_2(A);
1093 if (type->clientdata && ((swig_guile_clientdata *)type->clientdata)->destroy)
1094 ((swig_guile_clientdata *)type->clientdata)->destroy(A);
1100 free_swig_member_function(SCM A)
1102 free((swig_type_info *) SCM_CELL_WORD_1(A));
1107 ensure_smob_tag(SCM swig_module,
1108 scm_t_bits *tag_variable,
1109 const char *smob_name,
1110 const char *scheme_variable_name)
1112 SCM variable = scm_module_variable(swig_module,
1113 scm_from_locale_symbol(scheme_variable_name));
1114 if (scm_is_false(variable)) {
1115 *tag_variable = scm_make_smob_type((char*)scheme_variable_name, 0);
1116 scm_c_module_define(swig_module, scheme_variable_name,
1117 scm_from_ulong(*tag_variable));
1121 *tag_variable = scm_to_ulong(SCM_VARIABLE_REF(variable));
1129 static SCM swig_module;
1131 if (swig_initialized) return swig_module;
1132 swig_initialized = 1;
1134 swig_module = scm_c_resolve_module("Swig swigrun");
1135 if (ensure_smob_tag(swig_module, &swig_tag,
1136 "swig-pointer", "swig-pointer-tag")) {
1137 scm_set_smob_print(swig_tag, print_swig);
1138 scm_set_smob_equalp(swig_tag, equalp_swig);
1140 if (ensure_smob_tag(swig_module, &swig_collectable_tag,
1141 "collectable-swig-pointer", "collectable-swig-pointer-tag")) {
1142 scm_set_smob_print(swig_collectable_tag, print_collectable_swig);
1143 scm_set_smob_equalp(swig_collectable_tag, equalp_swig);
1144 scm_set_smob_free(swig_collectable_tag, free_swig);
1146 if (ensure_smob_tag(swig_module, &swig_destroyed_tag,
1147 "destroyed-swig-pointer", "destroyed-swig-pointer-tag")) {
1148 scm_set_smob_print(swig_destroyed_tag, print_destroyed_swig);
1149 scm_set_smob_equalp(swig_destroyed_tag, equalp_swig);
1151 if (ensure_smob_tag(swig_module, &swig_member_function_tag,
1152 "swig-member-function-pointer", "swig-member-function-pointer-tag")) {
1153 scm_set_smob_print(swig_member_function_tag, print_member_function_swig);
1154 scm_set_smob_free(swig_member_function_tag, free_swig_member_function);
1156 swig_make_func = scm_permanent_object(
1157 scm_variable_ref(scm_c_module_lookup(scm_c_resolve_module("oop goops"), "make")));
1158 swig_keyword = scm_permanent_object(scm_from_locale_keyword((char*) "init-smob"));
1159 swig_symbol = scm_permanent_object(scm_from_locale_symbol("swig-smob"));
1160 #ifdef SWIG_INIT_RUNTIME_MODULE
1161 SWIG_INIT_RUNTIME_MODULE
1167 SWIGINTERN swig_module_info *
1168 SWIG_Guile_GetModule(void *SWIGUNUSEDPARM(clientdata))
1173 module = SWIG_Guile_Init();
1175 variable = scm_module_variable(module,
1176 scm_from_locale_symbol("swig-type-list-address" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME));
1177 if (scm_is_false(variable)) {
1180 return (swig_module_info *) scm_to_ulong(SCM_VARIABLE_REF(variable));
1185 SWIG_Guile_SetModule(swig_module_info *swig_module)
1190 module = SWIG_Guile_Init();
1192 scm_module_define(module,
1193 scm_from_locale_symbol("swig-type-list-address" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME),
1194 scm_from_ulong((unsigned long) swig_module));
1198 SWIG_Guile_GetArgs (SCM *dest, SCM rest,
1199 int reqargs, int optargs,
1200 const char *procname)
1203 int num_args_passed = 0;
1204 for (i = 0; i<reqargs; i++) {
1205 if (!SCM_CONSP(rest))
1206 scm_wrong_num_args(scm_from_utf8_string(procname ? (char *) procname : "unknown procedure"));
1207 *dest++ = SCM_CAR(rest);
1208 rest = SCM_CDR(rest);
1211 for (i = 0; i<optargs && SCM_CONSP(rest); i++) {
1212 *dest++ = SCM_CAR(rest);
1213 rest = SCM_CDR(rest);
1216 for (; i<optargs; i++)
1217 *dest++ = SCM_UNDEFINED;
1218 if (!SCM_NULLP(rest))
1219 scm_wrong_num_args(scm_from_utf8_string(procname ? (char *) procname : "unknown procedure"));
1220 return num_args_passed;
1229 #define GUILE_MAYBE_VALUES \
1230 if (gswig_list_p) gswig_result = scm_values(gswig_result);
1232 #define GUILE_MAYBE_VECTOR \
1233 if (gswig_list_p) gswig_result = scm_vector(gswig_result);
1235 #define SWIG_APPEND_VALUE(object) \
1236 if (gswig_result == SCM_UNSPECIFIED) \
1237 gswig_result = object; \
1239 if (!gswig_list_p) { \
1241 gswig_result = scm_listify(gswig_result, object, SCM_UNDEFINED); \
1244 gswig_result = scm_append(scm_listify(gswig_result, scm_listify(object, SCM_UNDEFINED), SCM_UNDEFINED)); \
1248 static swig_guile_clientdata _swig_guile_clientdatanlopt_doublevector = { NULL, SCM_EOL };
1249 static swig_guile_clientdata _swig_guile_clientdatanlopt_roundoff_limited = { NULL, SCM_EOL };
1250 static swig_guile_clientdata _swig_guile_clientdatanlopt_forced_stop = { NULL, SCM_EOL };
1251 static swig_guile_clientdata _swig_guile_clientdatanlopt_opt = { NULL, SCM_EOL };
1253 /* -------- TYPES TABLE (BEGIN) -------- */
1255 #define SWIGTYPE_p_double swig_types[0]
1256 #define SWIGTYPE_p_f_r_q_const__std__vector__double___r_std__vector__double___p_void__double swig_types[1]
1257 #define SWIGTYPE_p_int swig_types[2]
1258 #define SWIGTYPE_p_nlopt__forced_stop swig_types[3]
1259 #define SWIGTYPE_p_nlopt__opt swig_types[4]
1260 #define SWIGTYPE_p_nlopt__roundoff_limited swig_types[5]
1261 #define SWIGTYPE_p_nlopt_func swig_types[6]
1262 #define SWIGTYPE_p_nlopt_mfunc swig_types[7]
1263 #define SWIGTYPE_p_nlopt_munge swig_types[8]
1264 #define SWIGTYPE_p_nlopt_opt swig_types[9]
1265 #define SWIGTYPE_p_nlopt_result swig_types[10]
1266 #define SWIGTYPE_p_std__out_of_range swig_types[11]
1267 #define SWIGTYPE_p_std__vectorT_double_t swig_types[12]
1268 #define SWIGTYPE_p_unsigned_long swig_types[13]
1269 static swig_type_info *swig_types[15];
1270 static swig_module_info swig_module = {swig_types, 14, 0, 0, 0, 0};
1271 #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
1272 #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
1274 /* -------- TYPES TABLE (END) -------- */
1277 #include "nlopt.hpp"
1280 #include <stdexcept>
1285 inline std::string SWIG_scm2string(SCM x) {
1287 temp = SWIG_scm2str(x);
1288 std::string s(temp);
1289 if (temp) SWIG_free(temp);
1295 #include <algorithm>
1296 #include <stdexcept>
1298 SWIGINTERN double std_vector_Sl_double_Sg__pop(std::vector< double > *self){
1299 if (self->size() == 0)
1300 throw std::out_of_range("pop from empty vector");
1301 double x = self->back();
1305 SWIGINTERN double std_vector_Sl_double_Sg__ref(std::vector< double > *self,int i){
1306 int size = int(self->size());
1310 throw std::out_of_range("vector index out of range");
1312 SWIGINTERN void std_vector_Sl_double_Sg__set(std::vector< double > *self,int i,double x){
1313 int size = int(self->size());
1317 throw std::out_of_range("vector index out of range");
1320 // work around obsolete stuff used by swig guile
1321 #if SCM_MAJOR_VERSION >= 2
1322 # define gh_symbol2scm scm_from_latin1_symbol
1324 # define gh_symbol2scm scm_str2symbol
1328 // because our f_data pointer to the Scheme function is stored on the
1329 // heap, rather than the stack, it may be missed by the Guile garbage
1330 // collection and be accidentally freed. Hence, use NLopts munge
1331 // feature to prevent this, by incrementing Guile's reference count.
1332 static void *free_guilefunc(void *p) {
1333 scm_gc_unprotect_object((SCM) p); return p; }
1334 static void *dup_guilefunc(void *p) {
1335 scm_gc_protect_object((SCM) p); return p; }
1337 // func wrapper around Guile function val = f(x, grad)
1338 static double func_guile(unsigned n, const double *x, double *grad, void *f) {
1339 SCM xscm = scm_c_make_vector(n, SCM_UNSPECIFIED);
1340 for (unsigned i = 0; i < n; ++i)
1341 SCM_SIMPLE_VECTOR_SET(xscm, i, scm_make_real(x[i]));
1342 SCM grad_scm = grad ? scm_c_make_vector(n, SCM_UNSPECIFIED) : SCM_BOOL_F;
1343 SCM ret = scm_call_2((SCM) f, xscm, grad_scm);
1344 if (!scm_real_p(ret))
1345 throw std::invalid_argument("invalid result passed to nlopt");
1347 for (unsigned i = 0; i < n; ++i) {
1348 if (!scm_real_p(ret))
1349 throw std::invalid_argument("invalid gradient passed to nlopt");
1350 grad[i] = scm_to_double(SCM_SIMPLE_VECTOR_REF(grad_scm, i));
1353 return scm_to_double(ret);
1356 static int gswig_const_NLOPT_GN_DIRECT = nlopt::GN_DIRECT;
1357 static int gswig_const_NLOPT_GN_DIRECT_L = nlopt::GN_DIRECT_L;
1358 static int gswig_const_NLOPT_GN_DIRECT_L_RAND = nlopt::GN_DIRECT_L_RAND;
1359 static int gswig_const_NLOPT_GN_DIRECT_NOSCAL = nlopt::GN_DIRECT_NOSCAL;
1360 static int gswig_const_NLOPT_GN_DIRECT_L_NOSCAL = nlopt::GN_DIRECT_L_NOSCAL;
1361 static int gswig_const_NLOPT_GN_DIRECT_L_RAND_NOSCAL = nlopt::GN_DIRECT_L_RAND_NOSCAL;
1362 static int gswig_const_NLOPT_GN_ORIG_DIRECT = nlopt::GN_ORIG_DIRECT;
1363 static int gswig_const_NLOPT_GN_ORIG_DIRECT_L = nlopt::GN_ORIG_DIRECT_L;
1364 static int gswig_const_NLOPT_GD_STOGO = nlopt::GD_STOGO;
1365 static int gswig_const_NLOPT_GD_STOGO_RAND = nlopt::GD_STOGO_RAND;
1366 static int gswig_const_NLOPT_LD_LBFGS_NOCEDAL = nlopt::LD_LBFGS_NOCEDAL;
1367 static int gswig_const_NLOPT_LD_LBFGS = nlopt::LD_LBFGS;
1368 static int gswig_const_NLOPT_LN_PRAXIS = nlopt::LN_PRAXIS;
1369 static int gswig_const_NLOPT_LD_VAR1 = nlopt::LD_VAR1;
1370 static int gswig_const_NLOPT_LD_VAR2 = nlopt::LD_VAR2;
1371 static int gswig_const_NLOPT_LD_TNEWTON = nlopt::LD_TNEWTON;
1372 static int gswig_const_NLOPT_LD_TNEWTON_RESTART = nlopt::LD_TNEWTON_RESTART;
1373 static int gswig_const_NLOPT_LD_TNEWTON_PRECOND = nlopt::LD_TNEWTON_PRECOND;
1374 static int gswig_const_NLOPT_LD_TNEWTON_PRECOND_RESTART = nlopt::LD_TNEWTON_PRECOND_RESTART;
1375 static int gswig_const_NLOPT_GN_CRS2_LM = nlopt::GN_CRS2_LM;
1376 static int gswig_const_NLOPT_GN_MLSL = nlopt::GN_MLSL;
1377 static int gswig_const_NLOPT_GD_MLSL = nlopt::GD_MLSL;
1378 static int gswig_const_NLOPT_GN_MLSL_LDS = nlopt::GN_MLSL_LDS;
1379 static int gswig_const_NLOPT_GD_MLSL_LDS = nlopt::GD_MLSL_LDS;
1380 static int gswig_const_NLOPT_LD_MMA = nlopt::LD_MMA;
1381 static int gswig_const_NLOPT_LN_COBYLA = nlopt::LN_COBYLA;
1382 static int gswig_const_NLOPT_LN_NEWUOA = nlopt::LN_NEWUOA;
1383 static int gswig_const_NLOPT_LN_NEWUOA_BOUND = nlopt::LN_NEWUOA_BOUND;
1384 static int gswig_const_NLOPT_LN_NELDERMEAD = nlopt::LN_NELDERMEAD;
1385 static int gswig_const_NLOPT_LN_SBPLX = nlopt::LN_SBPLX;
1386 static int gswig_const_NLOPT_LN_AUGLAG = nlopt::LN_AUGLAG;
1387 static int gswig_const_NLOPT_LD_AUGLAG = nlopt::LD_AUGLAG;
1388 static int gswig_const_NLOPT_LN_AUGLAG_EQ = nlopt::LN_AUGLAG_EQ;
1389 static int gswig_const_NLOPT_LD_AUGLAG_EQ = nlopt::LD_AUGLAG_EQ;
1390 static int gswig_const_NLOPT_LN_BOBYQA = nlopt::LN_BOBYQA;
1391 static int gswig_const_NLOPT_GN_ISRES = nlopt::GN_ISRES;
1392 static int gswig_const_NLOPT_AUGLAG = nlopt::AUGLAG;
1393 static int gswig_const_NLOPT_AUGLAG_EQ = nlopt::AUGLAG_EQ;
1394 static int gswig_const_NLOPT_G_MLSL = nlopt::G_MLSL;
1395 static int gswig_const_NLOPT_G_MLSL_LDS = nlopt::G_MLSL_LDS;
1396 static int gswig_const_NLOPT_LD_SLSQP = nlopt::LD_SLSQP;
1397 static int gswig_const_NLOPT_LD_CCSAQ = nlopt::LD_CCSAQ;
1398 static int gswig_const_NLOPT_GN_ESCH = nlopt::GN_ESCH;
1399 static int gswig_const_NLOPT_NUM_ALGORITHMS = nlopt::NUM_ALGORITHMS;
1400 static int gswig_const_NLOPT_FAILURE = nlopt::FAILURE;
1401 static int gswig_const_NLOPT_INVALID_ARGS = nlopt::INVALID_ARGS;
1402 static int gswig_const_NLOPT_OUT_OF_MEMORY = nlopt::OUT_OF_MEMORY;
1403 static int gswig_const_NLOPT_ROUNDOFF_LIMITED = nlopt::ROUNDOFF_LIMITED;
1404 static int gswig_const_NLOPT_FORCED_STOP = nlopt::FORCED_STOP;
1405 static int gswig_const_NLOPT_SUCCESS = nlopt::SUCCESS;
1406 static int gswig_const_NLOPT_STOPVAL_REACHED = nlopt::STOPVAL_REACHED;
1407 static int gswig_const_NLOPT_FTOL_REACHED = nlopt::FTOL_REACHED;
1408 static int gswig_const_NLOPT_XTOL_REACHED = nlopt::XTOL_REACHED;
1409 static int gswig_const_NLOPT_MAXEVAL_REACHED = nlopt::MAXEVAL_REACHED;
1410 static int gswig_const_NLOPT_MAXTIME_REACHED = nlopt::MAXTIME_REACHED;
1412 _wrap_new_nlopt_doublevector__SWIG_0 (int argc, SCM *argv)
1414 #define FUNC_NAME "new-nlopt-doublevector"
1417 SWIGUNUSED int gswig_list_p = 0;
1418 std::vector< double > *result = 0 ;
1421 arg1 = (unsigned int) scm_to_uint(argv[0]);
1423 result = (std::vector< double > *)new std::vector< double >(arg1);
1425 gswig_result = SWIG_NewPointerObj (result, SWIGTYPE_p_std__vectorT_double_t, 1);
1428 return gswig_result;
1434 _wrap_new_nlopt_doublevector__SWIG_1 (int argc, SCM *argv)
1436 #define FUNC_NAME "new-nlopt-doublevector"
1438 SWIGUNUSED int gswig_list_p = 0;
1439 std::vector< double > *result = 0 ;
1441 result = (std::vector< double > *)new std::vector< double >();
1443 gswig_result = SWIG_NewPointerObj (result, SWIGTYPE_p_std__vectorT_double_t, 1);
1446 return gswig_result;
1452 _wrap_new_nlopt_doublevector__SWIG_2 (int argc, SCM *argv)
1454 #define FUNC_NAME "new-nlopt-doublevector"
1459 SWIGUNUSED int gswig_list_p = 0;
1460 std::vector< double > *result = 0 ;
1463 arg1 = (unsigned int) scm_to_uint(argv[0]);
1466 temp2 = scm_to_double(argv[1]);
1467 arg2 = (double *) &temp2;
1469 result = (std::vector< double > *)new std::vector< double >(arg1,(double const &)*arg2);
1471 gswig_result = SWIG_NewPointerObj (result, SWIGTYPE_p_std__vectorT_double_t, 1);
1475 return gswig_result;
1481 _wrap_new_nlopt_doublevector__SWIG_3 (int argc, SCM *argv)
1483 #define FUNC_NAME "new-nlopt-doublevector"
1484 std::vector< double > *arg1 = 0 ;
1485 std::vector< double > temp1 ;
1487 SWIGUNUSED int gswig_list_p = 0;
1488 std::vector< double > *result = 0 ;
1491 if (scm_is_vector(argv[0])) {
1492 unsigned long size = scm_c_vector_length(argv[0]);
1493 temp1 = std::vector<double >(size);
1495 for (unsigned long i=0; i<size; i++) {
1496 SCM o = scm_vector_ref(argv[0],scm_from_ulong(i));
1497 if (scm_is_number(o))
1498 temp1[i] = (double)(scm_to_double(o));
1500 scm_wrong_type_arg(FUNC_NAME, 1, argv[0]);
1502 } else if (scm_is_null(argv[0])) {
1503 temp1 = std::vector<double >();
1505 } else if (scm_is_pair(argv[0])) {
1506 SCM v = scm_vector(argv[0]);
1507 unsigned long size = scm_c_vector_length(v);
1508 temp1 = std::vector<double >(size);
1510 for (unsigned long i=0; i<size; i++) {
1511 SCM o = scm_vector_ref(v,scm_from_ulong(i));
1512 if (scm_is_number(o))
1513 temp1[i] = (double)(scm_to_double(o));
1515 scm_wrong_type_arg(FUNC_NAME, 1, argv[0]);
1518 arg1 = (std::vector< double > *) SWIG_MustGetPtr(argv[0],SWIGTYPE_p_std__vectorT_double_t,1, 0);
1521 result = (std::vector< double > *)new std::vector< double >((std::vector< double > const &)*arg1);
1523 gswig_result = SWIG_NewPointerObj (result, SWIGTYPE_p_std__vectorT_double_t, 1);
1527 return gswig_result;
1533 _wrap_new_nlopt_doublevector(SCM rest)
1535 #define FUNC_NAME "new-nlopt-doublevector"
1537 int argc = SWIG_Guile_GetArgs (argv, rest, 0, 2, "new-nlopt-doublevector");
1539 return _wrap_new_nlopt_doublevector__SWIG_1(argc,argv);
1544 _v = scm_is_true(scm_integer_p(argv[0])) && scm_is_true(scm_exact_p(argv[0]))? 1 : 0;
1547 return _wrap_new_nlopt_doublevector__SWIG_0(argc,argv);
1553 /* native sequence? */
1554 if (scm_is_vector(argv[0])) {
1555 unsigned int size = scm_c_vector_length(argv[0]);
1557 /* an empty sequence can be of any type */
1560 /* check the first element only */
1562 SCM o = scm_vector_ref(argv[0],scm_from_ulong(0));
1563 _v = scm_is_number(o) ? 1 : 0;
1565 } else if (scm_is_null(argv[0])) {
1566 /* again, an empty sequence can be of any type */
1568 } else if (scm_is_pair(argv[0])) {
1569 /* check the first element only */
1571 SCM head = SCM_CAR(argv[0]);
1572 _v = scm_is_number(head) ? 1 : 0;
1574 /* wrapped vector? */
1575 std::vector<double >* v;
1576 _v = (SWIG_ConvertPtr(argv[0],(void **) &v,
1577 SWIGTYPE_p_std__vectorT_double_t, 0) != -1) ? 1 : 0;
1581 return _wrap_new_nlopt_doublevector__SWIG_3(argc,argv);
1587 _v = scm_is_true(scm_integer_p(argv[0])) && scm_is_true(scm_exact_p(argv[0]))? 1 : 0;
1591 _v = scm_is_true(scm_real_p(argv[1])) ? 1 : 0;
1594 return _wrap_new_nlopt_doublevector__SWIG_2(argc,argv);
1599 scm_misc_error("new-nlopt-doublevector", "No matching method for generic function `new_nlopt_doublevector'", SCM_EOL);
1605 _wrap_nlopt_doublevector_length (SCM s_0)
1607 #define FUNC_NAME "nlopt-doublevector-length"
1608 std::vector< double > *arg1 = (std::vector< double > *) 0 ;
1609 std::vector< double > temp1 ;
1611 SWIGUNUSED int gswig_list_p = 0;
1612 unsigned int result;
1615 if (scm_is_vector(s_0)) {
1616 unsigned long size = scm_c_vector_length(s_0);
1617 temp1 = std::vector<double >(size);
1619 for (unsigned long i=0; i<size; i++) {
1620 SCM o = scm_vector_ref(s_0,scm_from_ulong(i));
1621 if (scm_is_number(o))
1622 temp1[i] = (double)(scm_to_double(o));
1624 scm_wrong_type_arg(FUNC_NAME, 1, s_0);
1626 } else if (scm_is_null(s_0)) {
1627 temp1 = std::vector<double >();
1629 } else if (scm_is_pair(s_0)) {
1630 SCM v = scm_vector(s_0);
1631 unsigned long size = scm_c_vector_length(v);
1632 temp1 = std::vector<double >(size);
1634 for (unsigned long i=0; i<size; i++) {
1635 SCM o = scm_vector_ref(v,scm_from_ulong(i));
1636 if (scm_is_number(o))
1637 temp1[i] = (double)(scm_to_double(o));
1639 scm_wrong_type_arg(FUNC_NAME, 1, s_0);
1642 arg1 = (std::vector< double > *) SWIG_MustGetPtr(s_0,SWIGTYPE_p_std__vectorT_double_t,1, 0);
1645 result = (unsigned int)((std::vector< double > const *)arg1)->size();
1647 gswig_result = scm_from_ulong(result);
1651 return gswig_result;
1657 _wrap_nlopt_doublevector_emptyq___ (SCM s_0)
1659 #define FUNC_NAME "nlopt-doublevector-empty?"
1660 std::vector< double > *arg1 = (std::vector< double > *) 0 ;
1661 std::vector< double > temp1 ;
1663 SWIGUNUSED int gswig_list_p = 0;
1667 if (scm_is_vector(s_0)) {
1668 unsigned long size = scm_c_vector_length(s_0);
1669 temp1 = std::vector<double >(size);
1671 for (unsigned long i=0; i<size; i++) {
1672 SCM o = scm_vector_ref(s_0,scm_from_ulong(i));
1673 if (scm_is_number(o))
1674 temp1[i] = (double)(scm_to_double(o));
1676 scm_wrong_type_arg(FUNC_NAME, 1, s_0);
1678 } else if (scm_is_null(s_0)) {
1679 temp1 = std::vector<double >();
1681 } else if (scm_is_pair(s_0)) {
1682 SCM v = scm_vector(s_0);
1683 unsigned long size = scm_c_vector_length(v);
1684 temp1 = std::vector<double >(size);
1686 for (unsigned long i=0; i<size; i++) {
1687 SCM o = scm_vector_ref(v,scm_from_ulong(i));
1688 if (scm_is_number(o))
1689 temp1[i] = (double)(scm_to_double(o));
1691 scm_wrong_type_arg(FUNC_NAME, 1, s_0);
1694 arg1 = (std::vector< double > *) SWIG_MustGetPtr(s_0,SWIGTYPE_p_std__vectorT_double_t,1, 0);
1697 result = (bool)((std::vector< double > const *)arg1)->empty();
1699 gswig_result = scm_from_bool(result);
1703 return gswig_result;
1709 _wrap_nlopt_doublevector_clearN___ (SCM s_0)
1711 #define FUNC_NAME "nlopt-doublevector-clear!"
1712 std::vector< double > *arg1 = (std::vector< double > *) 0 ;
1714 SWIGUNUSED int gswig_list_p = 0;
1717 arg1 = (std::vector< double > *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_std__vectorT_double_t, 1, 0);
1720 gswig_result = SCM_UNSPECIFIED;
1723 return gswig_result;
1729 _wrap_nlopt_doublevector_pushN___ (SCM s_0, SCM s_1)
1731 #define FUNC_NAME "nlopt-doublevector-push!"
1732 std::vector< double > *arg1 = (std::vector< double > *) 0 ;
1735 SWIGUNUSED int gswig_list_p = 0;
1738 arg1 = (std::vector< double > *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_std__vectorT_double_t, 1, 0);
1741 arg2 = (double) scm_to_double(s_1);
1743 (arg1)->push_back(arg2);
1744 gswig_result = SCM_UNSPECIFIED;
1747 return gswig_result;
1753 _wrap_nlopt_doublevector_popN___ (SCM s_0)
1755 #define FUNC_NAME "nlopt-doublevector-pop!"
1756 std::vector< double > *arg1 = (std::vector< double > *) 0 ;
1758 SWIGUNUSED int gswig_list_p = 0;
1762 arg1 = (std::vector< double > *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_std__vectorT_double_t, 1, 0);
1765 result = (double)std_vector_Sl_double_Sg__pop(arg1);
1767 catch(std::out_of_range &_e) {
1769 std::out_of_range * temp = new std::out_of_range(_e);
1770 scm_throw(scm_from_locale_symbol((char *) "swig-exception"),
1771 scm_listify(SWIG_NewPointerObj(temp, SWIGTYPE_p_std__out_of_range, 1),
1777 gswig_result = scm_from_double(result);
1781 return gswig_result;
1787 _wrap_nlopt_doublevector_ref (SCM s_0, SCM s_1)
1789 #define FUNC_NAME "nlopt-doublevector-ref"
1790 std::vector< double > *arg1 = (std::vector< double > *) 0 ;
1793 SWIGUNUSED int gswig_list_p = 0;
1797 arg1 = (std::vector< double > *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_std__vectorT_double_t, 1, 0);
1800 arg2 = (int) scm_to_int(s_1);
1803 result = (double)std_vector_Sl_double_Sg__ref(arg1,arg2);
1805 catch(std::out_of_range &_e) {
1807 std::out_of_range * temp = new std::out_of_range(_e);
1808 scm_throw(scm_from_locale_symbol((char *) "swig-exception"),
1809 scm_listify(SWIG_NewPointerObj(temp, SWIGTYPE_p_std__out_of_range, 1),
1815 gswig_result = scm_from_double(result);
1819 return gswig_result;
1825 _wrap_nlopt_doublevector_setN___ (SCM s_0, SCM s_1, SCM s_2)
1827 #define FUNC_NAME "nlopt-doublevector-set!"
1828 std::vector< double > *arg1 = (std::vector< double > *) 0 ;
1832 SWIGUNUSED int gswig_list_p = 0;
1835 arg1 = (std::vector< double > *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_std__vectorT_double_t, 1, 0);
1838 arg2 = (int) scm_to_int(s_1);
1841 arg3 = (double) scm_to_double(s_2);
1844 std_vector_Sl_double_Sg__set(arg1,arg2,arg3);
1846 catch(std::out_of_range &_e) {
1848 std::out_of_range * temp = new std::out_of_range(_e);
1849 scm_throw(scm_from_locale_symbol((char *) "swig-exception"),
1850 scm_listify(SWIG_NewPointerObj(temp, SWIGTYPE_p_std__out_of_range, 1),
1855 gswig_result = SCM_UNSPECIFIED;
1858 return gswig_result;
1864 _wrap_delete_nlopt_doublevector (SCM s_0)
1866 #define FUNC_NAME "delete-nlopt-doublevector"
1867 std::vector< double > *arg1 = (std::vector< double > *) 0 ;
1869 SWIGUNUSED int gswig_list_p = 0;
1872 arg1 = (std::vector< double > *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_std__vectorT_double_t, 1, 0);
1875 gswig_result = SCM_UNSPECIFIED;
1877 SWIG_Guile_MarkPointerDestroyed(s_0);
1879 return gswig_result;
1885 _wrap_nlopt_get_initial_step (SCM s_0, SCM s_1)
1887 #define FUNC_NAME "nlopt-get-initial-step"
1889 double *arg2 = (double *) 0 ;
1892 SWIGUNUSED int gswig_list_p = 0;
1893 nlopt_result result;
1896 argp1 = (nlopt_opt *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_nlopt_opt, 1, 0);
1900 arg2 = (double *)SWIG_MustGetPtr(s_1, SWIGTYPE_p_double, 2, 0);
1902 result = nlopt_get_initial_step(arg1,arg2);
1904 nlopt_result * resultptr;
1905 resultptr = new nlopt_result((const nlopt_result &) result);
1906 gswig_result = SWIG_NewPointerObj (resultptr, SWIGTYPE_p_nlopt_result, 1);
1910 return gswig_result;
1916 _wrap_NLOPT_GN_DIRECT(SCM s_0)
1918 #define FUNC_NAME "NLOPT-GN-DIRECT"
1922 gswig_result = scm_from_long(gswig_const_NLOPT_GN_DIRECT);
1925 return gswig_result;
1931 _wrap_NLOPT_GN_DIRECT_L(SCM s_0)
1933 #define FUNC_NAME "NLOPT-GN-DIRECT-L"
1937 gswig_result = scm_from_long(gswig_const_NLOPT_GN_DIRECT_L);
1940 return gswig_result;
1946 _wrap_NLOPT_GN_DIRECT_L_RAND(SCM s_0)
1948 #define FUNC_NAME "NLOPT-GN-DIRECT-L-RAND"
1952 gswig_result = scm_from_long(gswig_const_NLOPT_GN_DIRECT_L_RAND);
1955 return gswig_result;
1961 _wrap_NLOPT_GN_DIRECT_NOSCAL(SCM s_0)
1963 #define FUNC_NAME "NLOPT-GN-DIRECT-NOSCAL"
1967 gswig_result = scm_from_long(gswig_const_NLOPT_GN_DIRECT_NOSCAL);
1970 return gswig_result;
1976 _wrap_NLOPT_GN_DIRECT_L_NOSCAL(SCM s_0)
1978 #define FUNC_NAME "NLOPT-GN-DIRECT-L-NOSCAL"
1982 gswig_result = scm_from_long(gswig_const_NLOPT_GN_DIRECT_L_NOSCAL);
1985 return gswig_result;
1991 _wrap_NLOPT_GN_DIRECT_L_RAND_NOSCAL(SCM s_0)
1993 #define FUNC_NAME "NLOPT-GN-DIRECT-L-RAND-NOSCAL"
1997 gswig_result = scm_from_long(gswig_const_NLOPT_GN_DIRECT_L_RAND_NOSCAL);
2000 return gswig_result;
2006 _wrap_NLOPT_GN_ORIG_DIRECT(SCM s_0)
2008 #define FUNC_NAME "NLOPT-GN-ORIG-DIRECT"
2012 gswig_result = scm_from_long(gswig_const_NLOPT_GN_ORIG_DIRECT);
2015 return gswig_result;
2021 _wrap_NLOPT_GN_ORIG_DIRECT_L(SCM s_0)
2023 #define FUNC_NAME "NLOPT-GN-ORIG-DIRECT-L"
2027 gswig_result = scm_from_long(gswig_const_NLOPT_GN_ORIG_DIRECT_L);
2030 return gswig_result;
2036 _wrap_NLOPT_GD_STOGO(SCM s_0)
2038 #define FUNC_NAME "NLOPT-GD-STOGO"
2042 gswig_result = scm_from_long(gswig_const_NLOPT_GD_STOGO);
2045 return gswig_result;
2051 _wrap_NLOPT_GD_STOGO_RAND(SCM s_0)
2053 #define FUNC_NAME "NLOPT-GD-STOGO-RAND"
2057 gswig_result = scm_from_long(gswig_const_NLOPT_GD_STOGO_RAND);
2060 return gswig_result;
2066 _wrap_NLOPT_LD_LBFGS_NOCEDAL(SCM s_0)
2068 #define FUNC_NAME "NLOPT-LD-LBFGS-NOCEDAL"
2072 gswig_result = scm_from_long(gswig_const_NLOPT_LD_LBFGS_NOCEDAL);
2075 return gswig_result;
2081 _wrap_NLOPT_LD_LBFGS(SCM s_0)
2083 #define FUNC_NAME "NLOPT-LD-LBFGS"
2087 gswig_result = scm_from_long(gswig_const_NLOPT_LD_LBFGS);
2090 return gswig_result;
2096 _wrap_NLOPT_LN_PRAXIS(SCM s_0)
2098 #define FUNC_NAME "NLOPT-LN-PRAXIS"
2102 gswig_result = scm_from_long(gswig_const_NLOPT_LN_PRAXIS);
2105 return gswig_result;
2111 _wrap_NLOPT_LD_VAR1(SCM s_0)
2113 #define FUNC_NAME "NLOPT-LD-VAR1"
2117 gswig_result = scm_from_long(gswig_const_NLOPT_LD_VAR1);
2120 return gswig_result;
2126 _wrap_NLOPT_LD_VAR2(SCM s_0)
2128 #define FUNC_NAME "NLOPT-LD-VAR2"
2132 gswig_result = scm_from_long(gswig_const_NLOPT_LD_VAR2);
2135 return gswig_result;
2141 _wrap_NLOPT_LD_TNEWTON(SCM s_0)
2143 #define FUNC_NAME "NLOPT-LD-TNEWTON"
2147 gswig_result = scm_from_long(gswig_const_NLOPT_LD_TNEWTON);
2150 return gswig_result;
2156 _wrap_NLOPT_LD_TNEWTON_RESTART(SCM s_0)
2158 #define FUNC_NAME "NLOPT-LD-TNEWTON-RESTART"
2162 gswig_result = scm_from_long(gswig_const_NLOPT_LD_TNEWTON_RESTART);
2165 return gswig_result;
2171 _wrap_NLOPT_LD_TNEWTON_PRECOND(SCM s_0)
2173 #define FUNC_NAME "NLOPT-LD-TNEWTON-PRECOND"
2177 gswig_result = scm_from_long(gswig_const_NLOPT_LD_TNEWTON_PRECOND);
2180 return gswig_result;
2186 _wrap_NLOPT_LD_TNEWTON_PRECOND_RESTART(SCM s_0)
2188 #define FUNC_NAME "NLOPT-LD-TNEWTON-PRECOND-RESTART"
2192 gswig_result = scm_from_long(gswig_const_NLOPT_LD_TNEWTON_PRECOND_RESTART);
2195 return gswig_result;
2201 _wrap_NLOPT_GN_CRS2_LM(SCM s_0)
2203 #define FUNC_NAME "NLOPT-GN-CRS2-LM"
2207 gswig_result = scm_from_long(gswig_const_NLOPT_GN_CRS2_LM);
2210 return gswig_result;
2216 _wrap_NLOPT_GN_MLSL(SCM s_0)
2218 #define FUNC_NAME "NLOPT-GN-MLSL"
2222 gswig_result = scm_from_long(gswig_const_NLOPT_GN_MLSL);
2225 return gswig_result;
2231 _wrap_NLOPT_GD_MLSL(SCM s_0)
2233 #define FUNC_NAME "NLOPT-GD-MLSL"
2237 gswig_result = scm_from_long(gswig_const_NLOPT_GD_MLSL);
2240 return gswig_result;
2246 _wrap_NLOPT_GN_MLSL_LDS(SCM s_0)
2248 #define FUNC_NAME "NLOPT-GN-MLSL-LDS"
2252 gswig_result = scm_from_long(gswig_const_NLOPT_GN_MLSL_LDS);
2255 return gswig_result;
2261 _wrap_NLOPT_GD_MLSL_LDS(SCM s_0)
2263 #define FUNC_NAME "NLOPT-GD-MLSL-LDS"
2267 gswig_result = scm_from_long(gswig_const_NLOPT_GD_MLSL_LDS);
2270 return gswig_result;
2276 _wrap_NLOPT_LD_MMA(SCM s_0)
2278 #define FUNC_NAME "NLOPT-LD-MMA"
2282 gswig_result = scm_from_long(gswig_const_NLOPT_LD_MMA);
2285 return gswig_result;
2291 _wrap_NLOPT_LN_COBYLA(SCM s_0)
2293 #define FUNC_NAME "NLOPT-LN-COBYLA"
2297 gswig_result = scm_from_long(gswig_const_NLOPT_LN_COBYLA);
2300 return gswig_result;
2306 _wrap_NLOPT_LN_NEWUOA(SCM s_0)
2308 #define FUNC_NAME "NLOPT-LN-NEWUOA"
2312 gswig_result = scm_from_long(gswig_const_NLOPT_LN_NEWUOA);
2315 return gswig_result;
2321 _wrap_NLOPT_LN_NEWUOA_BOUND(SCM s_0)
2323 #define FUNC_NAME "NLOPT-LN-NEWUOA-BOUND"
2327 gswig_result = scm_from_long(gswig_const_NLOPT_LN_NEWUOA_BOUND);
2330 return gswig_result;
2336 _wrap_NLOPT_LN_NELDERMEAD(SCM s_0)
2338 #define FUNC_NAME "NLOPT-LN-NELDERMEAD"
2342 gswig_result = scm_from_long(gswig_const_NLOPT_LN_NELDERMEAD);
2345 return gswig_result;
2351 _wrap_NLOPT_LN_SBPLX(SCM s_0)
2353 #define FUNC_NAME "NLOPT-LN-SBPLX"
2357 gswig_result = scm_from_long(gswig_const_NLOPT_LN_SBPLX);
2360 return gswig_result;
2366 _wrap_NLOPT_LN_AUGLAG(SCM s_0)
2368 #define FUNC_NAME "NLOPT-LN-AUGLAG"
2372 gswig_result = scm_from_long(gswig_const_NLOPT_LN_AUGLAG);
2375 return gswig_result;
2381 _wrap_NLOPT_LD_AUGLAG(SCM s_0)
2383 #define FUNC_NAME "NLOPT-LD-AUGLAG"
2387 gswig_result = scm_from_long(gswig_const_NLOPT_LD_AUGLAG);
2390 return gswig_result;
2396 _wrap_NLOPT_LN_AUGLAG_EQ(SCM s_0)
2398 #define FUNC_NAME "NLOPT-LN-AUGLAG-EQ"
2402 gswig_result = scm_from_long(gswig_const_NLOPT_LN_AUGLAG_EQ);
2405 return gswig_result;
2411 _wrap_NLOPT_LD_AUGLAG_EQ(SCM s_0)
2413 #define FUNC_NAME "NLOPT-LD-AUGLAG-EQ"
2417 gswig_result = scm_from_long(gswig_const_NLOPT_LD_AUGLAG_EQ);
2420 return gswig_result;
2426 _wrap_NLOPT_LN_BOBYQA(SCM s_0)
2428 #define FUNC_NAME "NLOPT-LN-BOBYQA"
2432 gswig_result = scm_from_long(gswig_const_NLOPT_LN_BOBYQA);
2435 return gswig_result;
2441 _wrap_NLOPT_GN_ISRES(SCM s_0)
2443 #define FUNC_NAME "NLOPT-GN-ISRES"
2447 gswig_result = scm_from_long(gswig_const_NLOPT_GN_ISRES);
2450 return gswig_result;
2456 _wrap_NLOPT_AUGLAG(SCM s_0)
2458 #define FUNC_NAME "NLOPT-AUGLAG"
2462 gswig_result = scm_from_long(gswig_const_NLOPT_AUGLAG);
2465 return gswig_result;
2471 _wrap_NLOPT_AUGLAG_EQ(SCM s_0)
2473 #define FUNC_NAME "NLOPT-AUGLAG-EQ"
2477 gswig_result = scm_from_long(gswig_const_NLOPT_AUGLAG_EQ);
2480 return gswig_result;
2486 _wrap_NLOPT_G_MLSL(SCM s_0)
2488 #define FUNC_NAME "NLOPT-G-MLSL"
2492 gswig_result = scm_from_long(gswig_const_NLOPT_G_MLSL);
2495 return gswig_result;
2501 _wrap_NLOPT_G_MLSL_LDS(SCM s_0)
2503 #define FUNC_NAME "NLOPT-G-MLSL-LDS"
2507 gswig_result = scm_from_long(gswig_const_NLOPT_G_MLSL_LDS);
2510 return gswig_result;
2516 _wrap_NLOPT_LD_SLSQP(SCM s_0)
2518 #define FUNC_NAME "NLOPT-LD-SLSQP"
2522 gswig_result = scm_from_long(gswig_const_NLOPT_LD_SLSQP);
2525 return gswig_result;
2531 _wrap_NLOPT_LD_CCSAQ(SCM s_0)
2533 #define FUNC_NAME "NLOPT-LD-CCSAQ"
2537 gswig_result = scm_from_long(gswig_const_NLOPT_LD_CCSAQ);
2540 return gswig_result;
2546 _wrap_NLOPT_GN_ESCH(SCM s_0)
2548 #define FUNC_NAME "NLOPT-GN-ESCH"
2552 gswig_result = scm_from_long(gswig_const_NLOPT_GN_ESCH);
2555 return gswig_result;
2561 _wrap_NLOPT_NUM_ALGORITHMS(SCM s_0)
2563 #define FUNC_NAME "NLOPT-NUM-ALGORITHMS"
2567 gswig_result = scm_from_long(gswig_const_NLOPT_NUM_ALGORITHMS);
2570 return gswig_result;
2576 _wrap_NLOPT_FAILURE(SCM s_0)
2578 #define FUNC_NAME "NLOPT-FAILURE"
2582 gswig_result = scm_from_long(gswig_const_NLOPT_FAILURE);
2585 return gswig_result;
2591 _wrap_NLOPT_INVALID_ARGS(SCM s_0)
2593 #define FUNC_NAME "NLOPT-INVALID-ARGS"
2597 gswig_result = scm_from_long(gswig_const_NLOPT_INVALID_ARGS);
2600 return gswig_result;
2606 _wrap_NLOPT_OUT_OF_MEMORY(SCM s_0)
2608 #define FUNC_NAME "NLOPT-OUT-OF-MEMORY"
2612 gswig_result = scm_from_long(gswig_const_NLOPT_OUT_OF_MEMORY);
2615 return gswig_result;
2621 _wrap_NLOPT_ROUNDOFF_LIMITED(SCM s_0)
2623 #define FUNC_NAME "NLOPT-ROUNDOFF-LIMITED"
2627 gswig_result = scm_from_long(gswig_const_NLOPT_ROUNDOFF_LIMITED);
2630 return gswig_result;
2636 _wrap_NLOPT_FORCED_STOP(SCM s_0)
2638 #define FUNC_NAME "NLOPT-FORCED-STOP"
2642 gswig_result = scm_from_long(gswig_const_NLOPT_FORCED_STOP);
2645 return gswig_result;
2651 _wrap_NLOPT_SUCCESS(SCM s_0)
2653 #define FUNC_NAME "NLOPT-SUCCESS"
2657 gswig_result = scm_from_long(gswig_const_NLOPT_SUCCESS);
2660 return gswig_result;
2666 _wrap_NLOPT_STOPVAL_REACHED(SCM s_0)
2668 #define FUNC_NAME "NLOPT-STOPVAL-REACHED"
2672 gswig_result = scm_from_long(gswig_const_NLOPT_STOPVAL_REACHED);
2675 return gswig_result;
2681 _wrap_NLOPT_FTOL_REACHED(SCM s_0)
2683 #define FUNC_NAME "NLOPT-FTOL-REACHED"
2687 gswig_result = scm_from_long(gswig_const_NLOPT_FTOL_REACHED);
2690 return gswig_result;
2696 _wrap_NLOPT_XTOL_REACHED(SCM s_0)
2698 #define FUNC_NAME "NLOPT-XTOL-REACHED"
2702 gswig_result = scm_from_long(gswig_const_NLOPT_XTOL_REACHED);
2705 return gswig_result;
2711 _wrap_NLOPT_MAXEVAL_REACHED(SCM s_0)
2713 #define FUNC_NAME "NLOPT-MAXEVAL-REACHED"
2717 gswig_result = scm_from_long(gswig_const_NLOPT_MAXEVAL_REACHED);
2720 return gswig_result;
2726 _wrap_NLOPT_MAXTIME_REACHED(SCM s_0)
2728 #define FUNC_NAME "NLOPT-MAXTIME-REACHED"
2732 gswig_result = scm_from_long(gswig_const_NLOPT_MAXTIME_REACHED);
2735 return gswig_result;
2741 _wrap_new_nlopt_roundoff_limited ()
2743 #define FUNC_NAME "new-nlopt-roundoff-limited"
2745 SWIGUNUSED int gswig_list_p = 0;
2746 nlopt::roundoff_limited *result = 0 ;
2748 result = (nlopt::roundoff_limited *)new nlopt::roundoff_limited();
2750 gswig_result = SWIG_NewPointerObj (result, SWIGTYPE_p_nlopt__roundoff_limited, 1);
2753 return gswig_result;
2759 _wrap_delete_nlopt_roundoff_limited (SCM s_0)
2761 #define FUNC_NAME "delete-nlopt-roundoff-limited"
2762 nlopt::roundoff_limited *arg1 = (nlopt::roundoff_limited *) 0 ;
2764 SWIGUNUSED int gswig_list_p = 0;
2767 arg1 = (nlopt::roundoff_limited *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_nlopt__roundoff_limited, 1, 0);
2770 gswig_result = SCM_UNSPECIFIED;
2772 SWIG_Guile_MarkPointerDestroyed(s_0);
2774 return gswig_result;
2780 _wrap_new_nlopt_forced_stop ()
2782 #define FUNC_NAME "new-nlopt-forced-stop"
2784 SWIGUNUSED int gswig_list_p = 0;
2785 nlopt::forced_stop *result = 0 ;
2787 result = (nlopt::forced_stop *)new nlopt::forced_stop();
2789 gswig_result = SWIG_NewPointerObj (result, SWIGTYPE_p_nlopt__forced_stop, 1);
2792 return gswig_result;
2798 _wrap_delete_nlopt_forced_stop (SCM s_0)
2800 #define FUNC_NAME "delete-nlopt-forced-stop"
2801 nlopt::forced_stop *arg1 = (nlopt::forced_stop *) 0 ;
2803 SWIGUNUSED int gswig_list_p = 0;
2806 arg1 = (nlopt::forced_stop *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_nlopt__forced_stop, 1, 0);
2809 gswig_result = SCM_UNSPECIFIED;
2811 SWIG_Guile_MarkPointerDestroyed(s_0);
2813 return gswig_result;
2819 _wrap_new_nlopt_opt__SWIG_0 (int argc, SCM *argv)
2821 #define FUNC_NAME "new-nlopt-opt"
2823 SWIGUNUSED int gswig_list_p = 0;
2824 nlopt::opt *result = 0 ;
2827 result = (nlopt::opt *)new nlopt::opt();
2829 catch(std::bad_alloc &_e) {
2830 scm_throw(gh_symbol2scm("bad-alloc"),
2831 scm_list_1(scm_from_locale_string((_e).what())));
2836 gswig_result = SWIG_NewPointerObj (result, SWIGTYPE_p_nlopt__opt, 1);
2839 return gswig_result;
2845 _wrap_delete_nlopt_opt (SCM s_0)
2847 #define FUNC_NAME "delete-nlopt-opt"
2848 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
2850 SWIGUNUSED int gswig_list_p = 0;
2853 arg1 = (nlopt::opt *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_nlopt__opt, 1, 0);
2856 gswig_result = SCM_UNSPECIFIED;
2858 SWIG_Guile_MarkPointerDestroyed(s_0);
2860 return gswig_result;
2866 _wrap_new_nlopt_opt__SWIG_1 (int argc, SCM *argv)
2868 #define FUNC_NAME "new-nlopt-opt"
2869 nlopt::algorithm arg1 ;
2872 SWIGUNUSED int gswig_list_p = 0;
2873 nlopt::opt *result = 0 ;
2876 arg1 = (nlopt::algorithm) scm_to_int(argv[0]);
2879 arg2 = (unsigned int) scm_to_uint(argv[1]);
2882 result = (nlopt::opt *)new nlopt::opt(arg1,arg2);
2884 catch(std::bad_alloc &_e) {
2885 scm_throw(gh_symbol2scm("bad-alloc"),
2886 scm_list_1(scm_from_locale_string((_e).what())));
2891 gswig_result = SWIG_NewPointerObj (result, SWIGTYPE_p_nlopt__opt, 1);
2894 return gswig_result;
2900 _wrap_new_nlopt_opt__SWIG_2 (int argc, SCM *argv)
2902 #define FUNC_NAME "new-nlopt-opt"
2903 nlopt::opt *arg1 = 0 ;
2905 SWIGUNUSED int gswig_list_p = 0;
2906 nlopt::opt *result = 0 ;
2909 arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
2912 result = (nlopt::opt *)new nlopt::opt((nlopt::opt const &)*arg1);
2914 catch(std::bad_alloc &_e) {
2915 scm_throw(gh_symbol2scm("bad-alloc"),
2916 scm_list_1(scm_from_locale_string((_e).what())));
2921 gswig_result = SWIG_NewPointerObj (result, SWIGTYPE_p_nlopt__opt, 1);
2925 return gswig_result;
2931 _wrap_new_nlopt_opt(SCM rest)
2933 #define FUNC_NAME "new-nlopt-opt"
2935 int argc = SWIG_Guile_GetArgs (argv, rest, 0, 2, "new-nlopt-opt");
2937 return _wrap_new_nlopt_opt__SWIG_0(argc,argv);
2943 int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
2944 _v = SWIG_CheckState(res);
2947 return _wrap_new_nlopt_opt__SWIG_2(argc,argv);
2953 _v = scm_is_true(scm_integer_p(argv[0])) && scm_is_true(scm_exact_p(argv[0]))? 1 : 0;
2957 _v = scm_is_true(scm_integer_p(argv[1])) && scm_is_true(scm_exact_p(argv[1]))? 1 : 0;
2960 return _wrap_new_nlopt_opt__SWIG_1(argc,argv);
2965 scm_misc_error("new-nlopt-opt", "No matching method for generic function `new_nlopt_opt'", SCM_EOL);
2971 _wrap_nlopt_opt_optimize__SWIG_0 (int argc, SCM *argv)
2973 #define FUNC_NAME "nlopt-opt-optimize"
2974 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
2975 std::vector< double > *arg2 = 0 ;
2978 SWIGUNUSED int gswig_list_p = 0;
2979 nlopt::result result;
2982 arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
2985 arg2 = (std::vector< double > *)SWIG_MustGetPtr(argv[1], SWIGTYPE_p_std__vectorT_double_t, 2, 0);
2988 arg3 = (double *)SWIG_MustGetPtr(argv[2], SWIGTYPE_p_double, 3, 0);
2991 result = (nlopt::result)(arg1)->optimize(*arg2,*arg3);
2993 catch(nlopt::roundoff_limited &_e) {
2994 scm_throw(gh_symbol2scm("roundoff-limited"), SCM_EOL);
2997 catch(nlopt::forced_stop &_e) {
2998 scm_throw(gh_symbol2scm("forced-stop"), SCM_EOL);
3001 catch(std::runtime_error &_e) {
3002 scm_throw(gh_symbol2scm("runtime-error"),
3003 scm_list_1(scm_from_locale_string((_e).what())));
3006 catch(std::bad_alloc &_e) {
3007 scm_throw(gh_symbol2scm("bad-alloc"),
3008 scm_list_1(scm_from_locale_string((_e).what())));
3011 catch(std::invalid_argument &_e) {
3012 scm_throw(gh_symbol2scm("invalid-argument"),
3013 scm_list_1(scm_from_locale_string((_e).what())));
3018 gswig_result = scm_from_long(result);
3024 return gswig_result;
3030 _wrap_nlopt_opt_optimize__SWIG_1 (int argc, SCM *argv)
3032 #define FUNC_NAME "nlopt-opt-optimize"
3033 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
3034 std::vector< double > *arg2 = 0 ;
3035 std::vector< double > temp2 ;
3037 SWIGUNUSED int gswig_list_p = 0;
3038 std::vector< double > result;
3041 arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
3044 if (scm_is_vector(argv[1])) {
3045 unsigned long size = scm_c_vector_length(argv[1]);
3046 temp2 = std::vector<double >(size);
3048 for (unsigned long i=0; i<size; i++) {
3049 SCM o = scm_vector_ref(argv[1],scm_from_ulong(i));
3050 if (scm_is_number(o))
3051 temp2[i] = (double)(scm_to_double(o));
3053 scm_wrong_type_arg(FUNC_NAME, 2, argv[1]);
3055 } else if (scm_is_null(argv[1])) {
3056 temp2 = std::vector<double >();
3058 } else if (scm_is_pair(argv[1])) {
3059 SCM v = scm_vector(argv[1]);
3060 unsigned long size = scm_c_vector_length(v);
3061 temp2 = std::vector<double >(size);
3063 for (unsigned long i=0; i<size; i++) {
3064 SCM o = scm_vector_ref(v,scm_from_ulong(i));
3065 if (scm_is_number(o))
3066 temp2[i] = (double)(scm_to_double(o));
3068 scm_wrong_type_arg(FUNC_NAME, 2, argv[1]);
3071 arg2 = (std::vector< double > *) SWIG_MustGetPtr(argv[1],SWIGTYPE_p_std__vectorT_double_t,2, 0);
3075 result = (arg1)->optimize((std::vector< double > const &)*arg2);
3077 catch(nlopt::roundoff_limited &_e) {
3078 scm_throw(gh_symbol2scm("roundoff-limited"), SCM_EOL);
3081 catch(nlopt::forced_stop &_e) {
3082 scm_throw(gh_symbol2scm("forced-stop"), SCM_EOL);
3085 catch(std::runtime_error &_e) {
3086 scm_throw(gh_symbol2scm("runtime-error"),
3087 scm_list_1(scm_from_locale_string((_e).what())));
3090 catch(std::bad_alloc &_e) {
3091 scm_throw(gh_symbol2scm("bad-alloc"),
3092 scm_list_1(scm_from_locale_string((_e).what())));
3095 catch(std::invalid_argument &_e) {
3096 scm_throw(gh_symbol2scm("invalid-argument"),
3097 scm_list_1(scm_from_locale_string((_e).what())));
3102 gswig_result = scm_make_vector(scm_from_long((&result)->size()),SCM_UNSPECIFIED);
3103 for (unsigned int i=0; i<(&result)->size(); i++) {
3104 SCM x = scm_from_double(((std::vector< double > &)result)[i]);
3105 scm_vector_set_x(gswig_result,scm_from_long(i),x);
3111 return gswig_result;
3117 _wrap_nlopt_opt_optimize(SCM rest)
3119 #define FUNC_NAME "nlopt-opt-optimize"
3121 int argc = SWIG_Guile_GetArgs (argv, rest, 0, 3, "nlopt-opt-optimize");
3126 int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
3127 _v = SWIG_CheckState(res);
3131 /* native sequence? */
3132 if (scm_is_vector(argv[1])) {
3133 unsigned int size = scm_c_vector_length(argv[1]);
3135 /* an empty sequence can be of any type */
3138 /* check the first element only */
3140 SCM o = scm_vector_ref(argv[1],scm_from_ulong(0));
3141 _v = scm_is_number(o) ? 1 : 0;
3143 } else if (scm_is_null(argv[1])) {
3144 /* again, an empty sequence can be of any type */
3146 } else if (scm_is_pair(argv[1])) {
3147 /* check the first element only */
3149 SCM head = SCM_CAR(argv[1]);
3150 _v = scm_is_number(head) ? 1 : 0;
3152 /* wrapped vector? */
3153 std::vector<double >* v;
3154 _v = (SWIG_ConvertPtr(argv[1],(void **) &v,
3155 SWIGTYPE_p_std__vectorT_double_t, 0) != -1) ? 1 : 0;
3159 return _wrap_nlopt_opt_optimize__SWIG_1(argc,argv);
3167 int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
3168 _v = SWIG_CheckState(res);
3173 int res = SWIG_ConvertPtr(argv[1], &ptr, SWIGTYPE_p_std__vectorT_double_t, 0);
3174 _v = SWIG_CheckState(res);
3179 int res = SWIG_ConvertPtr(argv[2], &ptr, SWIGTYPE_p_double, 0);
3180 _v = SWIG_CheckState(res);
3183 return _wrap_nlopt_opt_optimize__SWIG_0(argc,argv);
3189 scm_misc_error("nlopt-opt-optimize", "No matching method for generic function `nlopt_opt_optimize'", SCM_EOL);
3195 _wrap_nlopt_opt_last_optimize_result (SCM s_0)
3197 #define FUNC_NAME "nlopt-opt-last-optimize-result"
3198 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
3200 SWIGUNUSED int gswig_list_p = 0;
3201 nlopt::result result;
3204 arg1 = (nlopt::opt *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_nlopt__opt, 1, 0);
3206 result = (nlopt::result)((nlopt::opt const *)arg1)->last_optimize_result();
3208 gswig_result = scm_from_long(result);
3212 return gswig_result;
3218 _wrap_nlopt_opt_last_optimum_value (SCM s_0)
3220 #define FUNC_NAME "nlopt-opt-last-optimum-value"
3221 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
3223 SWIGUNUSED int gswig_list_p = 0;
3227 arg1 = (nlopt::opt *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_nlopt__opt, 1, 0);
3229 result = (double)((nlopt::opt const *)arg1)->last_optimum_value();
3231 gswig_result = scm_from_double(result);
3235 return gswig_result;
3241 _wrap_nlopt_opt_get_algorithm (SCM s_0)
3243 #define FUNC_NAME "nlopt-opt-get-algorithm"
3244 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
3246 SWIGUNUSED int gswig_list_p = 0;
3247 nlopt::algorithm result;
3250 arg1 = (nlopt::opt *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_nlopt__opt, 1, 0);
3252 result = (nlopt::algorithm)((nlopt::opt const *)arg1)->get_algorithm();
3254 gswig_result = scm_from_long(result);
3258 return gswig_result;
3264 _wrap_nlopt_opt_get_algorithm_name (SCM s_0)
3266 #define FUNC_NAME "nlopt-opt-get-algorithm-name"
3267 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
3269 SWIGUNUSED int gswig_list_p = 0;
3273 arg1 = (nlopt::opt *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_nlopt__opt, 1, 0);
3275 result = (char *)((nlopt::opt const *)arg1)->get_algorithm_name();
3277 gswig_result = SWIG_str02scm((const char *)result);
3281 return gswig_result;
3287 _wrap_nlopt_opt_get_dimension (SCM s_0)
3289 #define FUNC_NAME "nlopt-opt-get-dimension"
3290 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
3292 SWIGUNUSED int gswig_list_p = 0;
3293 unsigned int result;
3296 arg1 = (nlopt::opt *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_nlopt__opt, 1, 0);
3298 result = (unsigned int)((nlopt::opt const *)arg1)->get_dimension();
3300 gswig_result = scm_from_ulong(result);
3304 return gswig_result;
3310 _wrap_nlopt_opt_set_min_objective__SWIG_0 (int argc, SCM *argv)
3312 #define FUNC_NAME "nlopt-opt-set-min-objective"
3313 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
3315 void *arg3 = (void *) 0 ;
3316 nlopt::func *argp2 ;
3318 SWIGUNUSED int gswig_list_p = 0;
3321 arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
3324 argp2 = (nlopt::func *)SWIG_MustGetPtr(argv[1], SWIGTYPE_p_nlopt_func, 2, 0);
3328 arg3 = (void *)SWIG_MustGetPtr(argv[2], NULL, 3, 0);
3331 (arg1)->set_min_objective(arg2,arg3);
3333 catch(std::bad_alloc &_e) {
3334 scm_throw(gh_symbol2scm("bad-alloc"),
3335 scm_list_1(scm_from_locale_string((_e).what())));
3338 catch(std::invalid_argument &_e) {
3339 scm_throw(gh_symbol2scm("invalid-argument"),
3340 scm_list_1(scm_from_locale_string((_e).what())));
3344 gswig_result = SCM_UNSPECIFIED;
3348 return gswig_result;
3354 _wrap_nlopt_opt_set_min_objective__SWIG_1 (int argc, SCM *argv)
3356 #define FUNC_NAME "nlopt-opt-set-min-objective"
3357 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
3358 nlopt::vfunc arg2 = (nlopt::vfunc) 0 ;
3359 void *arg3 = (void *) 0 ;
3361 SWIGUNUSED int gswig_list_p = 0;
3364 arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
3367 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);
3370 arg3 = (void *)SWIG_MustGetPtr(argv[2], NULL, 3, 0);
3373 (arg1)->set_min_objective(arg2,arg3);
3375 catch(std::bad_alloc &_e) {
3376 scm_throw(gh_symbol2scm("bad-alloc"),
3377 scm_list_1(scm_from_locale_string((_e).what())));
3380 catch(std::invalid_argument &_e) {
3381 scm_throw(gh_symbol2scm("invalid-argument"),
3382 scm_list_1(scm_from_locale_string((_e).what())));
3386 gswig_result = SCM_UNSPECIFIED;
3391 return gswig_result;
3397 _wrap_nlopt_opt_set_max_objective__SWIG_0 (int argc, SCM *argv)
3399 #define FUNC_NAME "nlopt-opt-set-max-objective"
3400 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
3402 void *arg3 = (void *) 0 ;
3403 nlopt::func *argp2 ;
3405 SWIGUNUSED int gswig_list_p = 0;
3408 arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
3411 argp2 = (nlopt::func *)SWIG_MustGetPtr(argv[1], SWIGTYPE_p_nlopt_func, 2, 0);
3415 arg3 = (void *)SWIG_MustGetPtr(argv[2], NULL, 3, 0);
3418 (arg1)->set_max_objective(arg2,arg3);
3420 catch(std::bad_alloc &_e) {
3421 scm_throw(gh_symbol2scm("bad-alloc"),
3422 scm_list_1(scm_from_locale_string((_e).what())));
3425 catch(std::invalid_argument &_e) {
3426 scm_throw(gh_symbol2scm("invalid-argument"),
3427 scm_list_1(scm_from_locale_string((_e).what())));
3431 gswig_result = SCM_UNSPECIFIED;
3435 return gswig_result;
3441 _wrap_nlopt_opt_set_max_objective__SWIG_1 (int argc, SCM *argv)
3443 #define FUNC_NAME "nlopt-opt-set-max-objective"
3444 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
3445 nlopt::vfunc arg2 = (nlopt::vfunc) 0 ;
3446 void *arg3 = (void *) 0 ;
3448 SWIGUNUSED int gswig_list_p = 0;
3451 arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
3454 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);
3457 arg3 = (void *)SWIG_MustGetPtr(argv[2], NULL, 3, 0);
3460 (arg1)->set_max_objective(arg2,arg3);
3462 catch(std::bad_alloc &_e) {
3463 scm_throw(gh_symbol2scm("bad-alloc"),
3464 scm_list_1(scm_from_locale_string((_e).what())));
3467 catch(std::invalid_argument &_e) {
3468 scm_throw(gh_symbol2scm("invalid-argument"),
3469 scm_list_1(scm_from_locale_string((_e).what())));
3473 gswig_result = SCM_UNSPECIFIED;
3478 return gswig_result;
3484 _wrap_nlopt_opt_set_min_objective__SWIG_2 (int argc, SCM *argv)
3486 #define FUNC_NAME "nlopt-opt-set-min-objective"
3487 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
3489 void *arg3 = (void *) 0 ;
3493 SWIGUNUSED int gswig_list_p = 0;
3496 arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
3500 arg3 = dup_guilefunc((void*) argv[1]); // input = SCM pointer to Scheme function
3501 arg4 = free_guilefunc;
3502 arg5 = dup_guilefunc;
3505 (arg1)->set_min_objective(arg2,arg3,arg4,arg5);
3507 catch(std::bad_alloc &_e) {
3508 scm_throw(gh_symbol2scm("bad-alloc"),
3509 scm_list_1(scm_from_locale_string((_e).what())));
3512 catch(std::invalid_argument &_e) {
3513 scm_throw(gh_symbol2scm("invalid-argument"),
3514 scm_list_1(scm_from_locale_string((_e).what())));
3518 gswig_result = SCM_UNSPECIFIED;
3522 return gswig_result;
3528 _wrap_nlopt_opt_set_min_objective(SCM rest)
3530 #define FUNC_NAME "nlopt-opt-set-min-objective"
3532 int argc = SWIG_Guile_GetArgs (argv, rest, 0, 3, "nlopt-opt-set-min-objective");
3537 int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
3538 _v = SWIG_CheckState(res);
3542 _v = SCM_NFALSEP(scm_procedure_p(argv[1]));
3546 return _wrap_nlopt_opt_set_min_objective__SWIG_2(argc,argv);
3549 return _wrap_nlopt_opt_set_min_objective__SWIG_2(argc,argv);
3552 return _wrap_nlopt_opt_set_min_objective__SWIG_2(argc,argv);
3554 return _wrap_nlopt_opt_set_min_objective__SWIG_2(argc,argv);
3562 int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
3563 _v = SWIG_CheckState(res);
3568 int res = SWIG_ConvertPtr(argv[1], &ptr, SWIGTYPE_p_f_r_q_const__std__vector__double___r_std__vector__double___p_void__double, 0);
3569 _v = SWIG_CheckState(res);
3574 int res = SWIG_ConvertPtr(argv[2], &ptr, 0, 0);
3575 _v = SWIG_CheckState(res);
3578 return _wrap_nlopt_opt_set_min_objective__SWIG_1(argc,argv);
3587 int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
3588 _v = SWIG_CheckState(res);
3593 int res = SWIG_ConvertPtr(argv[1], &ptr, SWIGTYPE_p_nlopt_func, 0);
3594 _v = SWIG_CheckState(res);
3599 int res = SWIG_ConvertPtr(argv[2], &ptr, 0, 0);
3600 _v = SWIG_CheckState(res);
3603 return _wrap_nlopt_opt_set_min_objective__SWIG_0(argc,argv);
3609 scm_misc_error("nlopt-opt-set-min-objective", "No matching method for generic function `nlopt_opt_set_min_objective'", SCM_EOL);
3615 _wrap_nlopt_opt_set_max_objective__SWIG_2 (int argc, SCM *argv)
3617 #define FUNC_NAME "nlopt-opt-set-max-objective"
3618 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
3620 void *arg3 = (void *) 0 ;
3624 SWIGUNUSED int gswig_list_p = 0;
3627 arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
3631 arg3 = dup_guilefunc((void*) argv[1]); // input = SCM pointer to Scheme function
3632 arg4 = free_guilefunc;
3633 arg5 = dup_guilefunc;
3636 (arg1)->set_max_objective(arg2,arg3,arg4,arg5);
3638 catch(std::bad_alloc &_e) {
3639 scm_throw(gh_symbol2scm("bad-alloc"),
3640 scm_list_1(scm_from_locale_string((_e).what())));
3643 catch(std::invalid_argument &_e) {
3644 scm_throw(gh_symbol2scm("invalid-argument"),
3645 scm_list_1(scm_from_locale_string((_e).what())));
3649 gswig_result = SCM_UNSPECIFIED;
3653 return gswig_result;
3659 _wrap_nlopt_opt_set_max_objective(SCM rest)
3661 #define FUNC_NAME "nlopt-opt-set-max-objective"
3663 int argc = SWIG_Guile_GetArgs (argv, rest, 0, 3, "nlopt-opt-set-max-objective");
3668 int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
3669 _v = SWIG_CheckState(res);
3673 _v = SCM_NFALSEP(scm_procedure_p(argv[1]));
3677 return _wrap_nlopt_opt_set_max_objective__SWIG_2(argc,argv);
3680 return _wrap_nlopt_opt_set_max_objective__SWIG_2(argc,argv);
3683 return _wrap_nlopt_opt_set_max_objective__SWIG_2(argc,argv);
3685 return _wrap_nlopt_opt_set_max_objective__SWIG_2(argc,argv);
3693 int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
3694 _v = SWIG_CheckState(res);
3699 int res = SWIG_ConvertPtr(argv[1], &ptr, SWIGTYPE_p_f_r_q_const__std__vector__double___r_std__vector__double___p_void__double, 0);
3700 _v = SWIG_CheckState(res);
3705 int res = SWIG_ConvertPtr(argv[2], &ptr, 0, 0);
3706 _v = SWIG_CheckState(res);
3709 return _wrap_nlopt_opt_set_max_objective__SWIG_1(argc,argv);
3718 int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
3719 _v = SWIG_CheckState(res);
3724 int res = SWIG_ConvertPtr(argv[1], &ptr, SWIGTYPE_p_nlopt_func, 0);
3725 _v = SWIG_CheckState(res);
3730 int res = SWIG_ConvertPtr(argv[2], &ptr, 0, 0);
3731 _v = SWIG_CheckState(res);
3734 return _wrap_nlopt_opt_set_max_objective__SWIG_0(argc,argv);
3740 scm_misc_error("nlopt-opt-set-max-objective", "No matching method for generic function `nlopt_opt_set_max_objective'", SCM_EOL);
3746 _wrap_nlopt_opt_remove_inequality_constraints (SCM s_0)
3748 #define FUNC_NAME "nlopt-opt-remove-inequality-constraints"
3749 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
3751 SWIGUNUSED int gswig_list_p = 0;
3754 arg1 = (nlopt::opt *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_nlopt__opt, 1, 0);
3757 (arg1)->remove_inequality_constraints();
3759 catch(std::invalid_argument &_e) {
3760 scm_throw(gh_symbol2scm("invalid-argument"),
3761 scm_list_1(scm_from_locale_string((_e).what())));
3765 gswig_result = SCM_UNSPECIFIED;
3768 return gswig_result;
3774 _wrap_nlopt_opt_add_inequality_constraint__SWIG_0 (int argc, SCM *argv)
3776 #define FUNC_NAME "nlopt-opt-add-inequality-constraint"
3777 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
3779 void *arg3 = (void *) 0 ;
3781 nlopt::func *argp2 ;
3783 SWIGUNUSED int gswig_list_p = 0;
3786 arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
3789 argp2 = (nlopt::func *)SWIG_MustGetPtr(argv[1], SWIGTYPE_p_nlopt_func, 2, 0);
3793 arg3 = (void *)SWIG_MustGetPtr(argv[2], NULL, 3, 0);
3796 arg4 = (double) scm_to_double(argv[3]);
3799 (arg1)->add_inequality_constraint(arg2,arg3,arg4);
3801 catch(std::bad_alloc &_e) {
3802 scm_throw(gh_symbol2scm("bad-alloc"),
3803 scm_list_1(scm_from_locale_string((_e).what())));
3806 catch(std::invalid_argument &_e) {
3807 scm_throw(gh_symbol2scm("invalid-argument"),
3808 scm_list_1(scm_from_locale_string((_e).what())));
3812 gswig_result = SCM_UNSPECIFIED;
3816 return gswig_result;
3822 _wrap_nlopt_opt_add_inequality_constraint__SWIG_1 (int argc, SCM *argv)
3824 #define FUNC_NAME "nlopt-opt-add-inequality-constraint"
3825 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
3827 void *arg3 = (void *) 0 ;
3828 nlopt::func *argp2 ;
3830 SWIGUNUSED int gswig_list_p = 0;
3833 arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
3836 argp2 = (nlopt::func *)SWIG_MustGetPtr(argv[1], SWIGTYPE_p_nlopt_func, 2, 0);
3840 arg3 = (void *)SWIG_MustGetPtr(argv[2], NULL, 3, 0);
3843 (arg1)->add_inequality_constraint(arg2,arg3);
3845 catch(std::bad_alloc &_e) {
3846 scm_throw(gh_symbol2scm("bad-alloc"),
3847 scm_list_1(scm_from_locale_string((_e).what())));
3850 catch(std::invalid_argument &_e) {
3851 scm_throw(gh_symbol2scm("invalid-argument"),
3852 scm_list_1(scm_from_locale_string((_e).what())));
3856 gswig_result = SCM_UNSPECIFIED;
3860 return gswig_result;
3866 _wrap_nlopt_opt_add_inequality_constraint__SWIG_2 (int argc, SCM *argv)
3868 #define FUNC_NAME "nlopt-opt-add-inequality-constraint"
3869 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
3870 nlopt::vfunc arg2 = (nlopt::vfunc) 0 ;
3871 void *arg3 = (void *) 0 ;
3874 SWIGUNUSED int gswig_list_p = 0;
3877 arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
3880 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);
3883 arg3 = (void *)SWIG_MustGetPtr(argv[2], NULL, 3, 0);
3886 arg4 = (double) scm_to_double(argv[3]);
3889 (arg1)->add_inequality_constraint(arg2,arg3,arg4);
3891 catch(std::bad_alloc &_e) {
3892 scm_throw(gh_symbol2scm("bad-alloc"),
3893 scm_list_1(scm_from_locale_string((_e).what())));
3896 catch(std::invalid_argument &_e) {
3897 scm_throw(gh_symbol2scm("invalid-argument"),
3898 scm_list_1(scm_from_locale_string((_e).what())));
3902 gswig_result = SCM_UNSPECIFIED;
3907 return gswig_result;
3913 _wrap_nlopt_opt_add_inequality_constraint__SWIG_3 (int argc, SCM *argv)
3915 #define FUNC_NAME "nlopt-opt-add-inequality-constraint"
3916 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
3917 nlopt::vfunc arg2 = (nlopt::vfunc) 0 ;
3918 void *arg3 = (void *) 0 ;
3920 SWIGUNUSED int gswig_list_p = 0;
3923 arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
3926 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);
3929 arg3 = (void *)SWIG_MustGetPtr(argv[2], NULL, 3, 0);
3932 (arg1)->add_inequality_constraint(arg2,arg3);
3934 catch(std::bad_alloc &_e) {
3935 scm_throw(gh_symbol2scm("bad-alloc"),
3936 scm_list_1(scm_from_locale_string((_e).what())));
3939 catch(std::invalid_argument &_e) {
3940 scm_throw(gh_symbol2scm("invalid-argument"),
3941 scm_list_1(scm_from_locale_string((_e).what())));
3945 gswig_result = SCM_UNSPECIFIED;
3950 return gswig_result;
3956 _wrap_nlopt_opt_add_inequality_mconstraint__SWIG_0 (int argc, SCM *argv)
3958 #define FUNC_NAME "nlopt-opt-add-inequality-mconstraint"
3959 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
3961 void *arg3 = (void *) 0 ;
3962 std::vector< double > *arg4 = 0 ;
3963 nlopt::mfunc *argp2 ;
3964 std::vector< double > temp4 ;
3966 SWIGUNUSED int gswig_list_p = 0;
3969 arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
3972 argp2 = (nlopt::mfunc *)SWIG_MustGetPtr(argv[1], SWIGTYPE_p_nlopt_mfunc, 2, 0);
3976 arg3 = (void *)SWIG_MustGetPtr(argv[2], NULL, 3, 0);
3979 if (scm_is_vector(argv[3])) {
3980 unsigned long size = scm_c_vector_length(argv[3]);
3981 temp4 = std::vector<double >(size);
3983 for (unsigned long i=0; i<size; i++) {
3984 SCM o = scm_vector_ref(argv[3],scm_from_ulong(i));
3985 if (scm_is_number(o))
3986 temp4[i] = (double)(scm_to_double(o));
3988 scm_wrong_type_arg(FUNC_NAME, 4, argv[3]);
3990 } else if (scm_is_null(argv[3])) {
3991 temp4 = std::vector<double >();
3993 } else if (scm_is_pair(argv[3])) {
3994 SCM v = scm_vector(argv[3]);
3995 unsigned long size = scm_c_vector_length(v);
3996 temp4 = std::vector<double >(size);
3998 for (unsigned long i=0; i<size; i++) {
3999 SCM o = scm_vector_ref(v,scm_from_ulong(i));
4000 if (scm_is_number(o))
4001 temp4[i] = (double)(scm_to_double(o));
4003 scm_wrong_type_arg(FUNC_NAME, 4, argv[3]);
4006 arg4 = (std::vector< double > *) SWIG_MustGetPtr(argv[3],SWIGTYPE_p_std__vectorT_double_t,4, 0);
4010 (arg1)->add_inequality_mconstraint(arg2,arg3,(std::vector< double > const &)*arg4);
4012 catch(std::bad_alloc &_e) {
4013 scm_throw(gh_symbol2scm("bad-alloc"),
4014 scm_list_1(scm_from_locale_string((_e).what())));
4017 catch(std::invalid_argument &_e) {
4018 scm_throw(gh_symbol2scm("invalid-argument"),
4019 scm_list_1(scm_from_locale_string((_e).what())));
4023 gswig_result = SCM_UNSPECIFIED;
4028 return gswig_result;
4034 _wrap_nlopt_opt_remove_equality_constraints (SCM s_0)
4036 #define FUNC_NAME "nlopt-opt-remove-equality-constraints"
4037 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
4039 SWIGUNUSED int gswig_list_p = 0;
4042 arg1 = (nlopt::opt *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_nlopt__opt, 1, 0);
4045 (arg1)->remove_equality_constraints();
4047 catch(std::invalid_argument &_e) {
4048 scm_throw(gh_symbol2scm("invalid-argument"),
4049 scm_list_1(scm_from_locale_string((_e).what())));
4053 gswig_result = SCM_UNSPECIFIED;
4056 return gswig_result;
4062 _wrap_nlopt_opt_add_equality_constraint__SWIG_0 (int argc, SCM *argv)
4064 #define FUNC_NAME "nlopt-opt-add-equality-constraint"
4065 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
4067 void *arg3 = (void *) 0 ;
4069 nlopt::func *argp2 ;
4071 SWIGUNUSED int gswig_list_p = 0;
4074 arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
4077 argp2 = (nlopt::func *)SWIG_MustGetPtr(argv[1], SWIGTYPE_p_nlopt_func, 2, 0);
4081 arg3 = (void *)SWIG_MustGetPtr(argv[2], NULL, 3, 0);
4084 arg4 = (double) scm_to_double(argv[3]);
4087 (arg1)->add_equality_constraint(arg2,arg3,arg4);
4089 catch(std::bad_alloc &_e) {
4090 scm_throw(gh_symbol2scm("bad-alloc"),
4091 scm_list_1(scm_from_locale_string((_e).what())));
4094 catch(std::invalid_argument &_e) {
4095 scm_throw(gh_symbol2scm("invalid-argument"),
4096 scm_list_1(scm_from_locale_string((_e).what())));
4100 gswig_result = SCM_UNSPECIFIED;
4104 return gswig_result;
4110 _wrap_nlopt_opt_add_equality_constraint__SWIG_1 (int argc, SCM *argv)
4112 #define FUNC_NAME "nlopt-opt-add-equality-constraint"
4113 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
4115 void *arg3 = (void *) 0 ;
4116 nlopt::func *argp2 ;
4118 SWIGUNUSED int gswig_list_p = 0;
4121 arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
4124 argp2 = (nlopt::func *)SWIG_MustGetPtr(argv[1], SWIGTYPE_p_nlopt_func, 2, 0);
4128 arg3 = (void *)SWIG_MustGetPtr(argv[2], NULL, 3, 0);
4131 (arg1)->add_equality_constraint(arg2,arg3);
4133 catch(std::bad_alloc &_e) {
4134 scm_throw(gh_symbol2scm("bad-alloc"),
4135 scm_list_1(scm_from_locale_string((_e).what())));
4138 catch(std::invalid_argument &_e) {
4139 scm_throw(gh_symbol2scm("invalid-argument"),
4140 scm_list_1(scm_from_locale_string((_e).what())));
4144 gswig_result = SCM_UNSPECIFIED;
4148 return gswig_result;
4154 _wrap_nlopt_opt_add_equality_constraint__SWIG_2 (int argc, SCM *argv)
4156 #define FUNC_NAME "nlopt-opt-add-equality-constraint"
4157 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
4158 nlopt::vfunc arg2 = (nlopt::vfunc) 0 ;
4159 void *arg3 = (void *) 0 ;
4162 SWIGUNUSED int gswig_list_p = 0;
4165 arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
4168 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);
4171 arg3 = (void *)SWIG_MustGetPtr(argv[2], NULL, 3, 0);
4174 arg4 = (double) scm_to_double(argv[3]);
4177 (arg1)->add_equality_constraint(arg2,arg3,arg4);
4179 catch(std::bad_alloc &_e) {
4180 scm_throw(gh_symbol2scm("bad-alloc"),
4181 scm_list_1(scm_from_locale_string((_e).what())));
4184 catch(std::invalid_argument &_e) {
4185 scm_throw(gh_symbol2scm("invalid-argument"),
4186 scm_list_1(scm_from_locale_string((_e).what())));
4190 gswig_result = SCM_UNSPECIFIED;
4195 return gswig_result;
4201 _wrap_nlopt_opt_add_equality_constraint__SWIG_3 (int argc, SCM *argv)
4203 #define FUNC_NAME "nlopt-opt-add-equality-constraint"
4204 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
4205 nlopt::vfunc arg2 = (nlopt::vfunc) 0 ;
4206 void *arg3 = (void *) 0 ;
4208 SWIGUNUSED int gswig_list_p = 0;
4211 arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
4214 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);
4217 arg3 = (void *)SWIG_MustGetPtr(argv[2], NULL, 3, 0);
4220 (arg1)->add_equality_constraint(arg2,arg3);
4222 catch(std::bad_alloc &_e) {
4223 scm_throw(gh_symbol2scm("bad-alloc"),
4224 scm_list_1(scm_from_locale_string((_e).what())));
4227 catch(std::invalid_argument &_e) {
4228 scm_throw(gh_symbol2scm("invalid-argument"),
4229 scm_list_1(scm_from_locale_string((_e).what())));
4233 gswig_result = SCM_UNSPECIFIED;
4238 return gswig_result;
4244 _wrap_nlopt_opt_add_equality_mconstraint__SWIG_0 (int argc, SCM *argv)
4246 #define FUNC_NAME "nlopt-opt-add-equality-mconstraint"
4247 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
4249 void *arg3 = (void *) 0 ;
4250 std::vector< double > *arg4 = 0 ;
4251 nlopt::mfunc *argp2 ;
4252 std::vector< double > temp4 ;
4254 SWIGUNUSED int gswig_list_p = 0;
4257 arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
4260 argp2 = (nlopt::mfunc *)SWIG_MustGetPtr(argv[1], SWIGTYPE_p_nlopt_mfunc, 2, 0);
4264 arg3 = (void *)SWIG_MustGetPtr(argv[2], NULL, 3, 0);
4267 if (scm_is_vector(argv[3])) {
4268 unsigned long size = scm_c_vector_length(argv[3]);
4269 temp4 = std::vector<double >(size);
4271 for (unsigned long i=0; i<size; i++) {
4272 SCM o = scm_vector_ref(argv[3],scm_from_ulong(i));
4273 if (scm_is_number(o))
4274 temp4[i] = (double)(scm_to_double(o));
4276 scm_wrong_type_arg(FUNC_NAME, 4, argv[3]);
4278 } else if (scm_is_null(argv[3])) {
4279 temp4 = std::vector<double >();
4281 } else if (scm_is_pair(argv[3])) {
4282 SCM v = scm_vector(argv[3]);
4283 unsigned long size = scm_c_vector_length(v);
4284 temp4 = std::vector<double >(size);
4286 for (unsigned long i=0; i<size; i++) {
4287 SCM o = scm_vector_ref(v,scm_from_ulong(i));
4288 if (scm_is_number(o))
4289 temp4[i] = (double)(scm_to_double(o));
4291 scm_wrong_type_arg(FUNC_NAME, 4, argv[3]);
4294 arg4 = (std::vector< double > *) SWIG_MustGetPtr(argv[3],SWIGTYPE_p_std__vectorT_double_t,4, 0);
4298 (arg1)->add_equality_mconstraint(arg2,arg3,(std::vector< double > const &)*arg4);
4300 catch(std::bad_alloc &_e) {
4301 scm_throw(gh_symbol2scm("bad-alloc"),
4302 scm_list_1(scm_from_locale_string((_e).what())));
4305 catch(std::invalid_argument &_e) {
4306 scm_throw(gh_symbol2scm("invalid-argument"),
4307 scm_list_1(scm_from_locale_string((_e).what())));
4311 gswig_result = SCM_UNSPECIFIED;
4316 return gswig_result;
4322 _wrap_nlopt_opt_add_inequality_constraint__SWIG_4 (int argc, SCM *argv)
4324 #define FUNC_NAME "nlopt-opt-add-inequality-constraint"
4325 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
4327 void *arg3 = (void *) 0 ;
4332 SWIGUNUSED int gswig_list_p = 0;
4335 arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
4339 arg3 = dup_guilefunc((void*) argv[1]); // input = SCM pointer to Scheme function
4340 arg4 = free_guilefunc;
4341 arg5 = dup_guilefunc;
4344 arg6 = (double) scm_to_double(argv[2]);
4347 (arg1)->add_inequality_constraint(arg2,arg3,arg4,arg5,arg6);
4349 catch(std::bad_alloc &_e) {
4350 scm_throw(gh_symbol2scm("bad-alloc"),
4351 scm_list_1(scm_from_locale_string((_e).what())));
4354 catch(std::invalid_argument &_e) {
4355 scm_throw(gh_symbol2scm("invalid-argument"),
4356 scm_list_1(scm_from_locale_string((_e).what())));
4360 gswig_result = SCM_UNSPECIFIED;
4364 return gswig_result;
4370 _wrap_nlopt_opt_add_inequality_constraint__SWIG_5 (int argc, SCM *argv)
4372 #define FUNC_NAME "nlopt-opt-add-inequality-constraint"
4373 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
4375 void *arg3 = (void *) 0 ;
4379 SWIGUNUSED int gswig_list_p = 0;
4382 arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
4386 arg3 = dup_guilefunc((void*) argv[1]); // input = SCM pointer to Scheme function
4387 arg4 = free_guilefunc;
4388 arg5 = dup_guilefunc;
4391 (arg1)->add_inequality_constraint(arg2,arg3,arg4,arg5);
4393 catch(std::bad_alloc &_e) {
4394 scm_throw(gh_symbol2scm("bad-alloc"),
4395 scm_list_1(scm_from_locale_string((_e).what())));
4398 catch(std::invalid_argument &_e) {
4399 scm_throw(gh_symbol2scm("invalid-argument"),
4400 scm_list_1(scm_from_locale_string((_e).what())));
4404 gswig_result = SCM_UNSPECIFIED;
4408 return gswig_result;
4414 _wrap_nlopt_opt_add_inequality_constraint(SCM rest)
4416 #define FUNC_NAME "nlopt-opt-add-inequality-constraint"
4418 int argc = SWIG_Guile_GetArgs (argv, rest, 0, 4, "nlopt-opt-add-inequality-constraint");
4423 int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
4424 _v = SWIG_CheckState(res);
4428 _v = SCM_NFALSEP(scm_procedure_p(argv[1]));
4432 return _wrap_nlopt_opt_add_inequality_constraint__SWIG_5(argc,argv);
4435 return _wrap_nlopt_opt_add_inequality_constraint__SWIG_5(argc,argv);
4438 return _wrap_nlopt_opt_add_inequality_constraint__SWIG_5(argc,argv);
4440 return _wrap_nlopt_opt_add_inequality_constraint__SWIG_5(argc,argv);
4448 int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
4449 _v = SWIG_CheckState(res);
4454 int res = SWIG_ConvertPtr(argv[1], &ptr, SWIGTYPE_p_f_r_q_const__std__vector__double___r_std__vector__double___p_void__double, 0);
4455 _v = SWIG_CheckState(res);
4460 int res = SWIG_ConvertPtr(argv[2], &ptr, 0, 0);
4461 _v = SWIG_CheckState(res);
4464 return _wrap_nlopt_opt_add_inequality_constraint__SWIG_3(argc,argv);
4473 int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
4474 _v = SWIG_CheckState(res);
4478 _v = SCM_NFALSEP(scm_procedure_p(argv[1]));
4482 _v = scm_is_true(scm_real_p(argv[2])) ? 1 : 0;
4485 return _wrap_nlopt_opt_add_inequality_constraint__SWIG_4(argc,argv);
4494 int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
4495 _v = SWIG_CheckState(res);
4500 int res = SWIG_ConvertPtr(argv[1], &ptr, SWIGTYPE_p_nlopt_func, 0);
4501 _v = SWIG_CheckState(res);
4506 int res = SWIG_ConvertPtr(argv[2], &ptr, 0, 0);
4507 _v = SWIG_CheckState(res);
4510 return _wrap_nlopt_opt_add_inequality_constraint__SWIG_1(argc,argv);
4519 int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
4520 _v = SWIG_CheckState(res);
4525 int res = SWIG_ConvertPtr(argv[1], &ptr, SWIGTYPE_p_f_r_q_const__std__vector__double___r_std__vector__double___p_void__double, 0);
4526 _v = SWIG_CheckState(res);
4531 int res = SWIG_ConvertPtr(argv[2], &ptr, 0, 0);
4532 _v = SWIG_CheckState(res);
4536 _v = scm_is_true(scm_real_p(argv[3])) ? 1 : 0;
4539 return _wrap_nlopt_opt_add_inequality_constraint__SWIG_2(argc,argv);
4549 int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
4550 _v = SWIG_CheckState(res);
4555 int res = SWIG_ConvertPtr(argv[1], &ptr, SWIGTYPE_p_nlopt_func, 0);
4556 _v = SWIG_CheckState(res);
4561 int res = SWIG_ConvertPtr(argv[2], &ptr, 0, 0);
4562 _v = SWIG_CheckState(res);
4566 _v = scm_is_true(scm_real_p(argv[3])) ? 1 : 0;
4569 return _wrap_nlopt_opt_add_inequality_constraint__SWIG_0(argc,argv);
4576 scm_misc_error("nlopt-opt-add-inequality-constraint", "No matching method for generic function `nlopt_opt_add_inequality_constraint'", SCM_EOL);
4582 _wrap_nlopt_opt_add_equality_constraint__SWIG_4 (int argc, SCM *argv)
4584 #define FUNC_NAME "nlopt-opt-add-equality-constraint"
4585 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
4587 void *arg3 = (void *) 0 ;
4592 SWIGUNUSED int gswig_list_p = 0;
4595 arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
4599 arg3 = dup_guilefunc((void*) argv[1]); // input = SCM pointer to Scheme function
4600 arg4 = free_guilefunc;
4601 arg5 = dup_guilefunc;
4604 arg6 = (double) scm_to_double(argv[2]);
4607 (arg1)->add_equality_constraint(arg2,arg3,arg4,arg5,arg6);
4609 catch(std::bad_alloc &_e) {
4610 scm_throw(gh_symbol2scm("bad-alloc"),
4611 scm_list_1(scm_from_locale_string((_e).what())));
4614 catch(std::invalid_argument &_e) {
4615 scm_throw(gh_symbol2scm("invalid-argument"),
4616 scm_list_1(scm_from_locale_string((_e).what())));
4620 gswig_result = SCM_UNSPECIFIED;
4624 return gswig_result;
4630 _wrap_nlopt_opt_add_equality_constraint__SWIG_5 (int argc, SCM *argv)
4632 #define FUNC_NAME "nlopt-opt-add-equality-constraint"
4633 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
4635 void *arg3 = (void *) 0 ;
4639 SWIGUNUSED int gswig_list_p = 0;
4642 arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
4646 arg3 = dup_guilefunc((void*) argv[1]); // input = SCM pointer to Scheme function
4647 arg4 = free_guilefunc;
4648 arg5 = dup_guilefunc;
4651 (arg1)->add_equality_constraint(arg2,arg3,arg4,arg5);
4653 catch(std::bad_alloc &_e) {
4654 scm_throw(gh_symbol2scm("bad-alloc"),
4655 scm_list_1(scm_from_locale_string((_e).what())));
4658 catch(std::invalid_argument &_e) {
4659 scm_throw(gh_symbol2scm("invalid-argument"),
4660 scm_list_1(scm_from_locale_string((_e).what())));
4664 gswig_result = SCM_UNSPECIFIED;
4668 return gswig_result;
4674 _wrap_nlopt_opt_add_equality_constraint(SCM rest)
4676 #define FUNC_NAME "nlopt-opt-add-equality-constraint"
4678 int argc = SWIG_Guile_GetArgs (argv, rest, 0, 4, "nlopt-opt-add-equality-constraint");
4683 int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
4684 _v = SWIG_CheckState(res);
4688 _v = SCM_NFALSEP(scm_procedure_p(argv[1]));
4692 return _wrap_nlopt_opt_add_equality_constraint__SWIG_5(argc,argv);
4695 return _wrap_nlopt_opt_add_equality_constraint__SWIG_5(argc,argv);
4698 return _wrap_nlopt_opt_add_equality_constraint__SWIG_5(argc,argv);
4700 return _wrap_nlopt_opt_add_equality_constraint__SWIG_5(argc,argv);
4708 int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
4709 _v = SWIG_CheckState(res);
4714 int res = SWIG_ConvertPtr(argv[1], &ptr, SWIGTYPE_p_f_r_q_const__std__vector__double___r_std__vector__double___p_void__double, 0);
4715 _v = SWIG_CheckState(res);
4720 int res = SWIG_ConvertPtr(argv[2], &ptr, 0, 0);
4721 _v = SWIG_CheckState(res);
4724 return _wrap_nlopt_opt_add_equality_constraint__SWIG_3(argc,argv);
4733 int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
4734 _v = SWIG_CheckState(res);
4738 _v = SCM_NFALSEP(scm_procedure_p(argv[1]));
4742 _v = scm_is_true(scm_real_p(argv[2])) ? 1 : 0;
4745 return _wrap_nlopt_opt_add_equality_constraint__SWIG_4(argc,argv);
4754 int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
4755 _v = SWIG_CheckState(res);
4760 int res = SWIG_ConvertPtr(argv[1], &ptr, SWIGTYPE_p_nlopt_func, 0);
4761 _v = SWIG_CheckState(res);
4766 int res = SWIG_ConvertPtr(argv[2], &ptr, 0, 0);
4767 _v = SWIG_CheckState(res);
4770 return _wrap_nlopt_opt_add_equality_constraint__SWIG_1(argc,argv);
4779 int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
4780 _v = SWIG_CheckState(res);
4785 int res = SWIG_ConvertPtr(argv[1], &ptr, SWIGTYPE_p_f_r_q_const__std__vector__double___r_std__vector__double___p_void__double, 0);
4786 _v = SWIG_CheckState(res);
4791 int res = SWIG_ConvertPtr(argv[2], &ptr, 0, 0);
4792 _v = SWIG_CheckState(res);
4796 _v = scm_is_true(scm_real_p(argv[3])) ? 1 : 0;
4799 return _wrap_nlopt_opt_add_equality_constraint__SWIG_2(argc,argv);
4809 int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
4810 _v = SWIG_CheckState(res);
4815 int res = SWIG_ConvertPtr(argv[1], &ptr, SWIGTYPE_p_nlopt_func, 0);
4816 _v = SWIG_CheckState(res);
4821 int res = SWIG_ConvertPtr(argv[2], &ptr, 0, 0);
4822 _v = SWIG_CheckState(res);
4826 _v = scm_is_true(scm_real_p(argv[3])) ? 1 : 0;
4829 return _wrap_nlopt_opt_add_equality_constraint__SWIG_0(argc,argv);
4836 scm_misc_error("nlopt-opt-add-equality-constraint", "No matching method for generic function `nlopt_opt_add_equality_constraint'", SCM_EOL);
4842 _wrap_nlopt_opt_add_inequality_mconstraint__SWIG_1 (int argc, SCM *argv)
4844 #define FUNC_NAME "nlopt-opt-add-inequality-mconstraint"
4845 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
4847 void *arg3 = (void *) 0 ;
4850 std::vector< double > *arg6 = 0 ;
4851 nlopt::mfunc *argp2 ;
4852 nlopt_munge *argp4 ;
4853 nlopt_munge *argp5 ;
4854 std::vector< double > temp6 ;
4856 SWIGUNUSED int gswig_list_p = 0;
4859 arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
4862 argp2 = (nlopt::mfunc *)SWIG_MustGetPtr(argv[1], SWIGTYPE_p_nlopt_mfunc, 2, 0);
4866 arg3 = (void *)SWIG_MustGetPtr(argv[2], NULL, 3, 0);
4869 argp4 = (nlopt_munge *)SWIG_MustGetPtr(argv[3], SWIGTYPE_p_nlopt_munge, 4, 0);
4873 argp5 = (nlopt_munge *)SWIG_MustGetPtr(argv[4], SWIGTYPE_p_nlopt_munge, 5, 0);
4877 if (scm_is_vector(argv[5])) {
4878 unsigned long size = scm_c_vector_length(argv[5]);
4879 temp6 = std::vector<double >(size);
4881 for (unsigned long i=0; i<size; i++) {
4882 SCM o = scm_vector_ref(argv[5],scm_from_ulong(i));
4883 if (scm_is_number(o))
4884 temp6[i] = (double)(scm_to_double(o));
4886 scm_wrong_type_arg(FUNC_NAME, 6, argv[5]);
4888 } else if (scm_is_null(argv[5])) {
4889 temp6 = std::vector<double >();
4891 } else if (scm_is_pair(argv[5])) {
4892 SCM v = scm_vector(argv[5]);
4893 unsigned long size = scm_c_vector_length(v);
4894 temp6 = std::vector<double >(size);
4896 for (unsigned long i=0; i<size; i++) {
4897 SCM o = scm_vector_ref(v,scm_from_ulong(i));
4898 if (scm_is_number(o))
4899 temp6[i] = (double)(scm_to_double(o));
4901 scm_wrong_type_arg(FUNC_NAME, 6, argv[5]);
4904 arg6 = (std::vector< double > *) SWIG_MustGetPtr(argv[5],SWIGTYPE_p_std__vectorT_double_t,6, 0);
4908 (arg1)->add_inequality_mconstraint(arg2,arg3,arg4,arg5,(std::vector< double > const &)*arg6);
4910 catch(std::bad_alloc &_e) {
4911 scm_throw(gh_symbol2scm("bad-alloc"),
4912 scm_list_1(scm_from_locale_string((_e).what())));
4915 catch(std::invalid_argument &_e) {
4916 scm_throw(gh_symbol2scm("invalid-argument"),
4917 scm_list_1(scm_from_locale_string((_e).what())));
4921 gswig_result = SCM_UNSPECIFIED;
4926 return gswig_result;
4932 _wrap_nlopt_opt_add_inequality_mconstraint(SCM rest)
4934 #define FUNC_NAME "nlopt-opt-add-inequality-mconstraint"
4936 int argc = SWIG_Guile_GetArgs (argv, rest, 0, 6, "nlopt-opt-add-inequality-mconstraint");
4941 int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
4942 _v = SWIG_CheckState(res);
4947 int res = SWIG_ConvertPtr(argv[1], &ptr, SWIGTYPE_p_nlopt_mfunc, 0);
4948 _v = SWIG_CheckState(res);
4953 int res = SWIG_ConvertPtr(argv[2], &ptr, 0, 0);
4954 _v = SWIG_CheckState(res);
4958 /* native sequence? */
4959 if (scm_is_vector(argv[3])) {
4960 unsigned int size = scm_c_vector_length(argv[3]);
4962 /* an empty sequence can be of any type */
4965 /* check the first element only */
4967 SCM o = scm_vector_ref(argv[3],scm_from_ulong(0));
4968 _v = scm_is_number(o) ? 1 : 0;
4970 } else if (scm_is_null(argv[3])) {
4971 /* again, an empty sequence can be of any type */
4973 } else if (scm_is_pair(argv[3])) {
4974 /* check the first element only */
4976 SCM head = SCM_CAR(argv[3]);
4977 _v = scm_is_number(head) ? 1 : 0;
4979 /* wrapped vector? */
4980 std::vector<double >* v;
4981 _v = (SWIG_ConvertPtr(argv[3],(void **) &v,
4982 SWIGTYPE_p_std__vectorT_double_t, 0) != -1) ? 1 : 0;
4986 return _wrap_nlopt_opt_add_inequality_mconstraint__SWIG_0(argc,argv);
4996 int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
4997 _v = SWIG_CheckState(res);
5002 int res = SWIG_ConvertPtr(argv[1], &ptr, SWIGTYPE_p_nlopt_mfunc, 0);
5003 _v = SWIG_CheckState(res);
5008 int res = SWIG_ConvertPtr(argv[2], &ptr, 0, 0);
5009 _v = SWIG_CheckState(res);
5014 int res = SWIG_ConvertPtr(argv[3], &ptr, SWIGTYPE_p_nlopt_munge, 0);
5015 _v = SWIG_CheckState(res);
5020 int res = SWIG_ConvertPtr(argv[4], &ptr, SWIGTYPE_p_nlopt_munge, 0);
5021 _v = SWIG_CheckState(res);
5025 /* native sequence? */
5026 if (scm_is_vector(argv[5])) {
5027 unsigned int size = scm_c_vector_length(argv[5]);
5029 /* an empty sequence can be of any type */
5032 /* check the first element only */
5034 SCM o = scm_vector_ref(argv[5],scm_from_ulong(0));
5035 _v = scm_is_number(o) ? 1 : 0;
5037 } else if (scm_is_null(argv[5])) {
5038 /* again, an empty sequence can be of any type */
5040 } else if (scm_is_pair(argv[5])) {
5041 /* check the first element only */
5043 SCM head = SCM_CAR(argv[5]);
5044 _v = scm_is_number(head) ? 1 : 0;
5046 /* wrapped vector? */
5047 std::vector<double >* v;
5048 _v = (SWIG_ConvertPtr(argv[5],(void **) &v,
5049 SWIGTYPE_p_std__vectorT_double_t, 0) != -1) ? 1 : 0;
5053 return _wrap_nlopt_opt_add_inequality_mconstraint__SWIG_1(argc,argv);
5062 scm_misc_error("nlopt-opt-add-inequality-mconstraint", "No matching method for generic function `nlopt_opt_add_inequality_mconstraint'", SCM_EOL);
5068 _wrap_nlopt_opt_add_equality_mconstraint__SWIG_1 (int argc, SCM *argv)
5070 #define FUNC_NAME "nlopt-opt-add-equality-mconstraint"
5071 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
5073 void *arg3 = (void *) 0 ;
5076 std::vector< double > *arg6 = 0 ;
5077 nlopt::mfunc *argp2 ;
5078 nlopt_munge *argp4 ;
5079 nlopt_munge *argp5 ;
5080 std::vector< double > temp6 ;
5082 SWIGUNUSED int gswig_list_p = 0;
5085 arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
5088 argp2 = (nlopt::mfunc *)SWIG_MustGetPtr(argv[1], SWIGTYPE_p_nlopt_mfunc, 2, 0);
5092 arg3 = (void *)SWIG_MustGetPtr(argv[2], NULL, 3, 0);
5095 argp4 = (nlopt_munge *)SWIG_MustGetPtr(argv[3], SWIGTYPE_p_nlopt_munge, 4, 0);
5099 argp5 = (nlopt_munge *)SWIG_MustGetPtr(argv[4], SWIGTYPE_p_nlopt_munge, 5, 0);
5103 if (scm_is_vector(argv[5])) {
5104 unsigned long size = scm_c_vector_length(argv[5]);
5105 temp6 = std::vector<double >(size);
5107 for (unsigned long i=0; i<size; i++) {
5108 SCM o = scm_vector_ref(argv[5],scm_from_ulong(i));
5109 if (scm_is_number(o))
5110 temp6[i] = (double)(scm_to_double(o));
5112 scm_wrong_type_arg(FUNC_NAME, 6, argv[5]);
5114 } else if (scm_is_null(argv[5])) {
5115 temp6 = std::vector<double >();
5117 } else if (scm_is_pair(argv[5])) {
5118 SCM v = scm_vector(argv[5]);
5119 unsigned long size = scm_c_vector_length(v);
5120 temp6 = std::vector<double >(size);
5122 for (unsigned long i=0; i<size; i++) {
5123 SCM o = scm_vector_ref(v,scm_from_ulong(i));
5124 if (scm_is_number(o))
5125 temp6[i] = (double)(scm_to_double(o));
5127 scm_wrong_type_arg(FUNC_NAME, 6, argv[5]);
5130 arg6 = (std::vector< double > *) SWIG_MustGetPtr(argv[5],SWIGTYPE_p_std__vectorT_double_t,6, 0);
5134 (arg1)->add_equality_mconstraint(arg2,arg3,arg4,arg5,(std::vector< double > const &)*arg6);
5136 catch(std::bad_alloc &_e) {
5137 scm_throw(gh_symbol2scm("bad-alloc"),
5138 scm_list_1(scm_from_locale_string((_e).what())));
5141 catch(std::invalid_argument &_e) {
5142 scm_throw(gh_symbol2scm("invalid-argument"),
5143 scm_list_1(scm_from_locale_string((_e).what())));
5147 gswig_result = SCM_UNSPECIFIED;
5152 return gswig_result;
5158 _wrap_nlopt_opt_add_equality_mconstraint(SCM rest)
5160 #define FUNC_NAME "nlopt-opt-add-equality-mconstraint"
5162 int argc = SWIG_Guile_GetArgs (argv, rest, 0, 6, "nlopt-opt-add-equality-mconstraint");
5167 int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
5168 _v = SWIG_CheckState(res);
5173 int res = SWIG_ConvertPtr(argv[1], &ptr, SWIGTYPE_p_nlopt_mfunc, 0);
5174 _v = SWIG_CheckState(res);
5179 int res = SWIG_ConvertPtr(argv[2], &ptr, 0, 0);
5180 _v = SWIG_CheckState(res);
5184 /* native sequence? */
5185 if (scm_is_vector(argv[3])) {
5186 unsigned int size = scm_c_vector_length(argv[3]);
5188 /* an empty sequence can be of any type */
5191 /* check the first element only */
5193 SCM o = scm_vector_ref(argv[3],scm_from_ulong(0));
5194 _v = scm_is_number(o) ? 1 : 0;
5196 } else if (scm_is_null(argv[3])) {
5197 /* again, an empty sequence can be of any type */
5199 } else if (scm_is_pair(argv[3])) {
5200 /* check the first element only */
5202 SCM head = SCM_CAR(argv[3]);
5203 _v = scm_is_number(head) ? 1 : 0;
5205 /* wrapped vector? */
5206 std::vector<double >* v;
5207 _v = (SWIG_ConvertPtr(argv[3],(void **) &v,
5208 SWIGTYPE_p_std__vectorT_double_t, 0) != -1) ? 1 : 0;
5212 return _wrap_nlopt_opt_add_equality_mconstraint__SWIG_0(argc,argv);
5222 int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
5223 _v = SWIG_CheckState(res);
5228 int res = SWIG_ConvertPtr(argv[1], &ptr, SWIGTYPE_p_nlopt_mfunc, 0);
5229 _v = SWIG_CheckState(res);
5234 int res = SWIG_ConvertPtr(argv[2], &ptr, 0, 0);
5235 _v = SWIG_CheckState(res);
5240 int res = SWIG_ConvertPtr(argv[3], &ptr, SWIGTYPE_p_nlopt_munge, 0);
5241 _v = SWIG_CheckState(res);
5246 int res = SWIG_ConvertPtr(argv[4], &ptr, SWIGTYPE_p_nlopt_munge, 0);
5247 _v = SWIG_CheckState(res);
5251 /* native sequence? */
5252 if (scm_is_vector(argv[5])) {
5253 unsigned int size = scm_c_vector_length(argv[5]);
5255 /* an empty sequence can be of any type */
5258 /* check the first element only */
5260 SCM o = scm_vector_ref(argv[5],scm_from_ulong(0));
5261 _v = scm_is_number(o) ? 1 : 0;
5263 } else if (scm_is_null(argv[5])) {
5264 /* again, an empty sequence can be of any type */
5266 } else if (scm_is_pair(argv[5])) {
5267 /* check the first element only */
5269 SCM head = SCM_CAR(argv[5]);
5270 _v = scm_is_number(head) ? 1 : 0;
5272 /* wrapped vector? */
5273 std::vector<double >* v;
5274 _v = (SWIG_ConvertPtr(argv[5],(void **) &v,
5275 SWIGTYPE_p_std__vectorT_double_t, 0) != -1) ? 1 : 0;
5279 return _wrap_nlopt_opt_add_equality_mconstraint__SWIG_1(argc,argv);
5288 scm_misc_error("nlopt-opt-add-equality-mconstraint", "No matching method for generic function `nlopt_opt_add_equality_mconstraint'", SCM_EOL);
5294 _wrap_nlopt_opt_set_lower_bounds__SWIG_0 (int argc, SCM *argv)
5296 #define FUNC_NAME "nlopt-opt-set-lower-bounds"
5297 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
5300 SWIGUNUSED int gswig_list_p = 0;
5303 arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
5306 arg2 = (double) scm_to_double(argv[1]);
5309 (arg1)->set_lower_bounds(arg2);
5311 catch(std::invalid_argument &_e) {
5312 scm_throw(gh_symbol2scm("invalid-argument"),
5313 scm_list_1(scm_from_locale_string((_e).what())));
5317 gswig_result = SCM_UNSPECIFIED;
5320 return gswig_result;
5326 _wrap_nlopt_opt_get_lower_bounds__SWIG_0 (int argc, SCM *argv)
5328 #define FUNC_NAME "nlopt-opt-get-lower-bounds"
5329 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
5330 std::vector< double > *arg2 = 0 ;
5332 SWIGUNUSED int gswig_list_p = 0;
5335 arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
5338 arg2 = (std::vector< double > *)SWIG_MustGetPtr(argv[1], SWIGTYPE_p_std__vectorT_double_t, 2, 0);
5340 ((nlopt::opt const *)arg1)->get_lower_bounds(*arg2);
5341 gswig_result = SCM_UNSPECIFIED;
5345 return gswig_result;
5351 _wrap_nlopt_opt_get_lower_bounds__SWIG_1 (int argc, SCM *argv)
5353 #define FUNC_NAME "nlopt-opt-get-lower-bounds"
5354 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
5356 SWIGUNUSED int gswig_list_p = 0;
5357 std::vector< double > result;
5360 arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
5362 result = ((nlopt::opt const *)arg1)->get_lower_bounds();
5364 gswig_result = scm_make_vector(scm_from_long((&result)->size()),SCM_UNSPECIFIED);
5365 for (unsigned int i=0; i<(&result)->size(); i++) {
5366 SCM x = scm_from_double(((std::vector< double > &)result)[i]);
5367 scm_vector_set_x(gswig_result,scm_from_long(i),x);
5372 return gswig_result;
5378 _wrap_nlopt_opt_get_lower_bounds(SCM rest)
5380 #define FUNC_NAME "nlopt-opt-get-lower-bounds"
5382 int argc = SWIG_Guile_GetArgs (argv, rest, 0, 2, "nlopt-opt-get-lower-bounds");
5387 int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
5388 _v = SWIG_CheckState(res);
5391 return _wrap_nlopt_opt_get_lower_bounds__SWIG_1(argc,argv);
5398 int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
5399 _v = SWIG_CheckState(res);
5404 int res = SWIG_ConvertPtr(argv[1], &ptr, SWIGTYPE_p_std__vectorT_double_t, 0);
5405 _v = SWIG_CheckState(res);
5408 return _wrap_nlopt_opt_get_lower_bounds__SWIG_0(argc,argv);
5413 scm_misc_error("nlopt-opt-get-lower-bounds", "No matching method for generic function `nlopt_opt_get_lower_bounds'", SCM_EOL);
5419 _wrap_nlopt_opt_set_lower_bounds__SWIG_1 (int argc, SCM *argv)
5421 #define FUNC_NAME "nlopt-opt-set-lower-bounds"
5422 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
5423 std::vector< double > *arg2 = 0 ;
5424 std::vector< double > temp2 ;
5426 SWIGUNUSED int gswig_list_p = 0;
5429 arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
5432 if (scm_is_vector(argv[1])) {
5433 unsigned long size = scm_c_vector_length(argv[1]);
5434 temp2 = std::vector<double >(size);
5436 for (unsigned long i=0; i<size; i++) {
5437 SCM o = scm_vector_ref(argv[1],scm_from_ulong(i));
5438 if (scm_is_number(o))
5439 temp2[i] = (double)(scm_to_double(o));
5441 scm_wrong_type_arg(FUNC_NAME, 2, argv[1]);
5443 } else if (scm_is_null(argv[1])) {
5444 temp2 = std::vector<double >();
5446 } else if (scm_is_pair(argv[1])) {
5447 SCM v = scm_vector(argv[1]);
5448 unsigned long size = scm_c_vector_length(v);
5449 temp2 = std::vector<double >(size);
5451 for (unsigned long i=0; i<size; i++) {
5452 SCM o = scm_vector_ref(v,scm_from_ulong(i));
5453 if (scm_is_number(o))
5454 temp2[i] = (double)(scm_to_double(o));
5456 scm_wrong_type_arg(FUNC_NAME, 2, argv[1]);
5459 arg2 = (std::vector< double > *) SWIG_MustGetPtr(argv[1],SWIGTYPE_p_std__vectorT_double_t,2, 0);
5463 (arg1)->set_lower_bounds((std::vector< double > const &)*arg2);
5465 catch(std::invalid_argument &_e) {
5466 scm_throw(gh_symbol2scm("invalid-argument"),
5467 scm_list_1(scm_from_locale_string((_e).what())));
5471 gswig_result = SCM_UNSPECIFIED;
5475 return gswig_result;
5481 _wrap_nlopt_opt_set_lower_bounds(SCM rest)
5483 #define FUNC_NAME "nlopt-opt-set-lower-bounds"
5485 int argc = SWIG_Guile_GetArgs (argv, rest, 0, 2, "nlopt-opt-set-lower-bounds");
5490 int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
5491 _v = SWIG_CheckState(res);
5495 _v = scm_is_true(scm_real_p(argv[1])) ? 1 : 0;
5498 return _wrap_nlopt_opt_set_lower_bounds__SWIG_0(argc,argv);
5506 int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
5507 _v = SWIG_CheckState(res);
5511 /* native sequence? */
5512 if (scm_is_vector(argv[1])) {
5513 unsigned int size = scm_c_vector_length(argv[1]);
5515 /* an empty sequence can be of any type */
5518 /* check the first element only */
5520 SCM o = scm_vector_ref(argv[1],scm_from_ulong(0));
5521 _v = scm_is_number(o) ? 1 : 0;
5523 } else if (scm_is_null(argv[1])) {
5524 /* again, an empty sequence can be of any type */
5526 } else if (scm_is_pair(argv[1])) {
5527 /* check the first element only */
5529 SCM head = SCM_CAR(argv[1]);
5530 _v = scm_is_number(head) ? 1 : 0;
5532 /* wrapped vector? */
5533 std::vector<double >* v;
5534 _v = (SWIG_ConvertPtr(argv[1],(void **) &v,
5535 SWIGTYPE_p_std__vectorT_double_t, 0) != -1) ? 1 : 0;
5539 return _wrap_nlopt_opt_set_lower_bounds__SWIG_1(argc,argv);
5544 scm_misc_error("nlopt-opt-set-lower-bounds", "No matching method for generic function `nlopt_opt_set_lower_bounds'", SCM_EOL);
5550 _wrap_nlopt_opt_set_upper_bounds__SWIG_0 (int argc, SCM *argv)
5552 #define FUNC_NAME "nlopt-opt-set-upper-bounds"
5553 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
5556 SWIGUNUSED int gswig_list_p = 0;
5559 arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
5562 arg2 = (double) scm_to_double(argv[1]);
5565 (arg1)->set_upper_bounds(arg2);
5567 catch(std::invalid_argument &_e) {
5568 scm_throw(gh_symbol2scm("invalid-argument"),
5569 scm_list_1(scm_from_locale_string((_e).what())));
5573 gswig_result = SCM_UNSPECIFIED;
5576 return gswig_result;
5582 _wrap_nlopt_opt_get_upper_bounds__SWIG_0 (int argc, SCM *argv)
5584 #define FUNC_NAME "nlopt-opt-get-upper-bounds"
5585 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
5586 std::vector< double > *arg2 = 0 ;
5588 SWIGUNUSED int gswig_list_p = 0;
5591 arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
5594 arg2 = (std::vector< double > *)SWIG_MustGetPtr(argv[1], SWIGTYPE_p_std__vectorT_double_t, 2, 0);
5596 ((nlopt::opt const *)arg1)->get_upper_bounds(*arg2);
5597 gswig_result = SCM_UNSPECIFIED;
5601 return gswig_result;
5607 _wrap_nlopt_opt_get_upper_bounds__SWIG_1 (int argc, SCM *argv)
5609 #define FUNC_NAME "nlopt-opt-get-upper-bounds"
5610 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
5612 SWIGUNUSED int gswig_list_p = 0;
5613 std::vector< double > result;
5616 arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
5618 result = ((nlopt::opt const *)arg1)->get_upper_bounds();
5620 gswig_result = scm_make_vector(scm_from_long((&result)->size()),SCM_UNSPECIFIED);
5621 for (unsigned int i=0; i<(&result)->size(); i++) {
5622 SCM x = scm_from_double(((std::vector< double > &)result)[i]);
5623 scm_vector_set_x(gswig_result,scm_from_long(i),x);
5628 return gswig_result;
5634 _wrap_nlopt_opt_get_upper_bounds(SCM rest)
5636 #define FUNC_NAME "nlopt-opt-get-upper-bounds"
5638 int argc = SWIG_Guile_GetArgs (argv, rest, 0, 2, "nlopt-opt-get-upper-bounds");
5643 int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
5644 _v = SWIG_CheckState(res);
5647 return _wrap_nlopt_opt_get_upper_bounds__SWIG_1(argc,argv);
5654 int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
5655 _v = SWIG_CheckState(res);
5660 int res = SWIG_ConvertPtr(argv[1], &ptr, SWIGTYPE_p_std__vectorT_double_t, 0);
5661 _v = SWIG_CheckState(res);
5664 return _wrap_nlopt_opt_get_upper_bounds__SWIG_0(argc,argv);
5669 scm_misc_error("nlopt-opt-get-upper-bounds", "No matching method for generic function `nlopt_opt_get_upper_bounds'", SCM_EOL);
5675 _wrap_nlopt_opt_set_upper_bounds__SWIG_1 (int argc, SCM *argv)
5677 #define FUNC_NAME "nlopt-opt-set-upper-bounds"
5678 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
5679 std::vector< double > *arg2 = 0 ;
5680 std::vector< double > temp2 ;
5682 SWIGUNUSED int gswig_list_p = 0;
5685 arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
5688 if (scm_is_vector(argv[1])) {
5689 unsigned long size = scm_c_vector_length(argv[1]);
5690 temp2 = std::vector<double >(size);
5692 for (unsigned long i=0; i<size; i++) {
5693 SCM o = scm_vector_ref(argv[1],scm_from_ulong(i));
5694 if (scm_is_number(o))
5695 temp2[i] = (double)(scm_to_double(o));
5697 scm_wrong_type_arg(FUNC_NAME, 2, argv[1]);
5699 } else if (scm_is_null(argv[1])) {
5700 temp2 = std::vector<double >();
5702 } else if (scm_is_pair(argv[1])) {
5703 SCM v = scm_vector(argv[1]);
5704 unsigned long size = scm_c_vector_length(v);
5705 temp2 = std::vector<double >(size);
5707 for (unsigned long i=0; i<size; i++) {
5708 SCM o = scm_vector_ref(v,scm_from_ulong(i));
5709 if (scm_is_number(o))
5710 temp2[i] = (double)(scm_to_double(o));
5712 scm_wrong_type_arg(FUNC_NAME, 2, argv[1]);
5715 arg2 = (std::vector< double > *) SWIG_MustGetPtr(argv[1],SWIGTYPE_p_std__vectorT_double_t,2, 0);
5719 (arg1)->set_upper_bounds((std::vector< double > const &)*arg2);
5721 catch(std::invalid_argument &_e) {
5722 scm_throw(gh_symbol2scm("invalid-argument"),
5723 scm_list_1(scm_from_locale_string((_e).what())));
5727 gswig_result = SCM_UNSPECIFIED;
5731 return gswig_result;
5737 _wrap_nlopt_opt_set_upper_bounds(SCM rest)
5739 #define FUNC_NAME "nlopt-opt-set-upper-bounds"
5741 int argc = SWIG_Guile_GetArgs (argv, rest, 0, 2, "nlopt-opt-set-upper-bounds");
5746 int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
5747 _v = SWIG_CheckState(res);
5751 _v = scm_is_true(scm_real_p(argv[1])) ? 1 : 0;
5754 return _wrap_nlopt_opt_set_upper_bounds__SWIG_0(argc,argv);
5762 int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
5763 _v = SWIG_CheckState(res);
5767 /* native sequence? */
5768 if (scm_is_vector(argv[1])) {
5769 unsigned int size = scm_c_vector_length(argv[1]);
5771 /* an empty sequence can be of any type */
5774 /* check the first element only */
5776 SCM o = scm_vector_ref(argv[1],scm_from_ulong(0));
5777 _v = scm_is_number(o) ? 1 : 0;
5779 } else if (scm_is_null(argv[1])) {
5780 /* again, an empty sequence can be of any type */
5782 } else if (scm_is_pair(argv[1])) {
5783 /* check the first element only */
5785 SCM head = SCM_CAR(argv[1]);
5786 _v = scm_is_number(head) ? 1 : 0;
5788 /* wrapped vector? */
5789 std::vector<double >* v;
5790 _v = (SWIG_ConvertPtr(argv[1],(void **) &v,
5791 SWIGTYPE_p_std__vectorT_double_t, 0) != -1) ? 1 : 0;
5795 return _wrap_nlopt_opt_set_upper_bounds__SWIG_1(argc,argv);
5800 scm_misc_error("nlopt-opt-set-upper-bounds", "No matching method for generic function `nlopt_opt_set_upper_bounds'", SCM_EOL);
5806 _wrap_nlopt_opt_get_stopval (SCM s_0)
5808 #define FUNC_NAME "nlopt-opt-get-stopval"
5809 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
5811 SWIGUNUSED int gswig_list_p = 0;
5815 arg1 = (nlopt::opt *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_nlopt__opt, 1, 0);
5817 result = (double)((nlopt::opt const *)arg1)->get_stopval();
5819 gswig_result = scm_from_double(result);
5823 return gswig_result;
5829 _wrap_nlopt_opt_set_stopval (SCM s_0, SCM s_1)
5831 #define FUNC_NAME "nlopt-opt-set-stopval"
5832 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
5835 SWIGUNUSED int gswig_list_p = 0;
5838 arg1 = (nlopt::opt *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_nlopt__opt, 1, 0);
5841 arg2 = (double) scm_to_double(s_1);
5844 (arg1)->set_stopval(arg2);
5846 catch(std::invalid_argument &_e) {
5847 scm_throw(gh_symbol2scm("invalid-argument"),
5848 scm_list_1(scm_from_locale_string((_e).what())));
5852 gswig_result = SCM_UNSPECIFIED;
5855 return gswig_result;
5861 _wrap_nlopt_opt_get_ftol_rel (SCM s_0)
5863 #define FUNC_NAME "nlopt-opt-get-ftol-rel"
5864 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
5866 SWIGUNUSED int gswig_list_p = 0;
5870 arg1 = (nlopt::opt *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_nlopt__opt, 1, 0);
5872 result = (double)((nlopt::opt const *)arg1)->get_ftol_rel();
5874 gswig_result = scm_from_double(result);
5878 return gswig_result;
5884 _wrap_nlopt_opt_set_ftol_rel (SCM s_0, SCM s_1)
5886 #define FUNC_NAME "nlopt-opt-set-ftol-rel"
5887 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
5890 SWIGUNUSED int gswig_list_p = 0;
5893 arg1 = (nlopt::opt *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_nlopt__opt, 1, 0);
5896 arg2 = (double) scm_to_double(s_1);
5899 (arg1)->set_ftol_rel(arg2);
5901 catch(std::invalid_argument &_e) {
5902 scm_throw(gh_symbol2scm("invalid-argument"),
5903 scm_list_1(scm_from_locale_string((_e).what())));
5907 gswig_result = SCM_UNSPECIFIED;
5910 return gswig_result;
5916 _wrap_nlopt_opt_get_ftol_abs (SCM s_0)
5918 #define FUNC_NAME "nlopt-opt-get-ftol-abs"
5919 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
5921 SWIGUNUSED int gswig_list_p = 0;
5925 arg1 = (nlopt::opt *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_nlopt__opt, 1, 0);
5927 result = (double)((nlopt::opt const *)arg1)->get_ftol_abs();
5929 gswig_result = scm_from_double(result);
5933 return gswig_result;
5939 _wrap_nlopt_opt_set_ftol_abs (SCM s_0, SCM s_1)
5941 #define FUNC_NAME "nlopt-opt-set-ftol-abs"
5942 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
5945 SWIGUNUSED int gswig_list_p = 0;
5948 arg1 = (nlopt::opt *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_nlopt__opt, 1, 0);
5951 arg2 = (double) scm_to_double(s_1);
5954 (arg1)->set_ftol_abs(arg2);
5956 catch(std::invalid_argument &_e) {
5957 scm_throw(gh_symbol2scm("invalid-argument"),
5958 scm_list_1(scm_from_locale_string((_e).what())));
5962 gswig_result = SCM_UNSPECIFIED;
5965 return gswig_result;
5971 _wrap_nlopt_opt_get_xtol_rel (SCM s_0)
5973 #define FUNC_NAME "nlopt-opt-get-xtol-rel"
5974 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
5976 SWIGUNUSED int gswig_list_p = 0;
5980 arg1 = (nlopt::opt *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_nlopt__opt, 1, 0);
5982 result = (double)((nlopt::opt const *)arg1)->get_xtol_rel();
5984 gswig_result = scm_from_double(result);
5988 return gswig_result;
5994 _wrap_nlopt_opt_set_xtol_rel (SCM s_0, SCM s_1)
5996 #define FUNC_NAME "nlopt-opt-set-xtol-rel"
5997 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
6000 SWIGUNUSED int gswig_list_p = 0;
6003 arg1 = (nlopt::opt *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_nlopt__opt, 1, 0);
6006 arg2 = (double) scm_to_double(s_1);
6009 (arg1)->set_xtol_rel(arg2);
6011 catch(std::invalid_argument &_e) {
6012 scm_throw(gh_symbol2scm("invalid-argument"),
6013 scm_list_1(scm_from_locale_string((_e).what())));
6017 gswig_result = SCM_UNSPECIFIED;
6020 return gswig_result;
6026 _wrap_nlopt_opt_set_xtol_abs__SWIG_0 (int argc, SCM *argv)
6028 #define FUNC_NAME "nlopt-opt-set-xtol-abs"
6029 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
6032 SWIGUNUSED int gswig_list_p = 0;
6035 arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
6038 arg2 = (double) scm_to_double(argv[1]);
6041 (arg1)->set_xtol_abs(arg2);
6043 catch(std::invalid_argument &_e) {
6044 scm_throw(gh_symbol2scm("invalid-argument"),
6045 scm_list_1(scm_from_locale_string((_e).what())));
6049 gswig_result = SCM_UNSPECIFIED;
6052 return gswig_result;
6058 _wrap_nlopt_opt_get_xtol_abs__SWIG_0 (int argc, SCM *argv)
6060 #define FUNC_NAME "nlopt-opt-get-xtol-abs"
6061 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
6062 std::vector< double > *arg2 = 0 ;
6064 SWIGUNUSED int gswig_list_p = 0;
6067 arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
6070 arg2 = (std::vector< double > *)SWIG_MustGetPtr(argv[1], SWIGTYPE_p_std__vectorT_double_t, 2, 0);
6072 ((nlopt::opt const *)arg1)->get_xtol_abs(*arg2);
6073 gswig_result = SCM_UNSPECIFIED;
6077 return gswig_result;
6083 _wrap_nlopt_opt_get_xtol_abs__SWIG_1 (int argc, SCM *argv)
6085 #define FUNC_NAME "nlopt-opt-get-xtol-abs"
6086 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
6088 SWIGUNUSED int gswig_list_p = 0;
6089 std::vector< double > result;
6092 arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
6094 result = ((nlopt::opt const *)arg1)->get_xtol_abs();
6096 gswig_result = scm_make_vector(scm_from_long((&result)->size()),SCM_UNSPECIFIED);
6097 for (unsigned int i=0; i<(&result)->size(); i++) {
6098 SCM x = scm_from_double(((std::vector< double > &)result)[i]);
6099 scm_vector_set_x(gswig_result,scm_from_long(i),x);
6104 return gswig_result;
6110 _wrap_nlopt_opt_get_xtol_abs(SCM rest)
6112 #define FUNC_NAME "nlopt-opt-get-xtol-abs"
6114 int argc = SWIG_Guile_GetArgs (argv, rest, 0, 2, "nlopt-opt-get-xtol-abs");
6119 int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
6120 _v = SWIG_CheckState(res);
6123 return _wrap_nlopt_opt_get_xtol_abs__SWIG_1(argc,argv);
6130 int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
6131 _v = SWIG_CheckState(res);
6136 int res = SWIG_ConvertPtr(argv[1], &ptr, SWIGTYPE_p_std__vectorT_double_t, 0);
6137 _v = SWIG_CheckState(res);
6140 return _wrap_nlopt_opt_get_xtol_abs__SWIG_0(argc,argv);
6145 scm_misc_error("nlopt-opt-get-xtol-abs", "No matching method for generic function `nlopt_opt_get_xtol_abs'", SCM_EOL);
6151 _wrap_nlopt_opt_set_xtol_abs__SWIG_1 (int argc, SCM *argv)
6153 #define FUNC_NAME "nlopt-opt-set-xtol-abs"
6154 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
6155 std::vector< double > *arg2 = 0 ;
6156 std::vector< double > temp2 ;
6158 SWIGUNUSED int gswig_list_p = 0;
6161 arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
6164 if (scm_is_vector(argv[1])) {
6165 unsigned long size = scm_c_vector_length(argv[1]);
6166 temp2 = std::vector<double >(size);
6168 for (unsigned long i=0; i<size; i++) {
6169 SCM o = scm_vector_ref(argv[1],scm_from_ulong(i));
6170 if (scm_is_number(o))
6171 temp2[i] = (double)(scm_to_double(o));
6173 scm_wrong_type_arg(FUNC_NAME, 2, argv[1]);
6175 } else if (scm_is_null(argv[1])) {
6176 temp2 = std::vector<double >();
6178 } else if (scm_is_pair(argv[1])) {
6179 SCM v = scm_vector(argv[1]);
6180 unsigned long size = scm_c_vector_length(v);
6181 temp2 = std::vector<double >(size);
6183 for (unsigned long i=0; i<size; i++) {
6184 SCM o = scm_vector_ref(v,scm_from_ulong(i));
6185 if (scm_is_number(o))
6186 temp2[i] = (double)(scm_to_double(o));
6188 scm_wrong_type_arg(FUNC_NAME, 2, argv[1]);
6191 arg2 = (std::vector< double > *) SWIG_MustGetPtr(argv[1],SWIGTYPE_p_std__vectorT_double_t,2, 0);
6195 (arg1)->set_xtol_abs((std::vector< double > const &)*arg2);
6197 catch(std::invalid_argument &_e) {
6198 scm_throw(gh_symbol2scm("invalid-argument"),
6199 scm_list_1(scm_from_locale_string((_e).what())));
6203 gswig_result = SCM_UNSPECIFIED;
6207 return gswig_result;
6213 _wrap_nlopt_opt_set_xtol_abs(SCM rest)
6215 #define FUNC_NAME "nlopt-opt-set-xtol-abs"
6217 int argc = SWIG_Guile_GetArgs (argv, rest, 0, 2, "nlopt-opt-set-xtol-abs");
6222 int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
6223 _v = SWIG_CheckState(res);
6227 _v = scm_is_true(scm_real_p(argv[1])) ? 1 : 0;
6230 return _wrap_nlopt_opt_set_xtol_abs__SWIG_0(argc,argv);
6238 int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
6239 _v = SWIG_CheckState(res);
6243 /* native sequence? */
6244 if (scm_is_vector(argv[1])) {
6245 unsigned int size = scm_c_vector_length(argv[1]);
6247 /* an empty sequence can be of any type */
6250 /* check the first element only */
6252 SCM o = scm_vector_ref(argv[1],scm_from_ulong(0));
6253 _v = scm_is_number(o) ? 1 : 0;
6255 } else if (scm_is_null(argv[1])) {
6256 /* again, an empty sequence can be of any type */
6258 } else if (scm_is_pair(argv[1])) {
6259 /* check the first element only */
6261 SCM head = SCM_CAR(argv[1]);
6262 _v = scm_is_number(head) ? 1 : 0;
6264 /* wrapped vector? */
6265 std::vector<double >* v;
6266 _v = (SWIG_ConvertPtr(argv[1],(void **) &v,
6267 SWIGTYPE_p_std__vectorT_double_t, 0) != -1) ? 1 : 0;
6271 return _wrap_nlopt_opt_set_xtol_abs__SWIG_1(argc,argv);
6276 scm_misc_error("nlopt-opt-set-xtol-abs", "No matching method for generic function `nlopt_opt_set_xtol_abs'", SCM_EOL);
6282 _wrap_nlopt_opt_get_maxeval (SCM s_0)
6284 #define FUNC_NAME "nlopt-opt-get-maxeval"
6285 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
6287 SWIGUNUSED int gswig_list_p = 0;
6291 arg1 = (nlopt::opt *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_nlopt__opt, 1, 0);
6293 result = (int)((nlopt::opt const *)arg1)->get_maxeval();
6295 gswig_result = scm_from_long(result);
6299 return gswig_result;
6305 _wrap_nlopt_opt_set_maxeval (SCM s_0, SCM s_1)
6307 #define FUNC_NAME "nlopt-opt-set-maxeval"
6308 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
6311 SWIGUNUSED int gswig_list_p = 0;
6314 arg1 = (nlopt::opt *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_nlopt__opt, 1, 0);
6317 arg2 = (int) scm_to_int(s_1);
6320 (arg1)->set_maxeval(arg2);
6322 catch(std::invalid_argument &_e) {
6323 scm_throw(gh_symbol2scm("invalid-argument"),
6324 scm_list_1(scm_from_locale_string((_e).what())));
6328 gswig_result = SCM_UNSPECIFIED;
6331 return gswig_result;
6337 _wrap_nlopt_opt_get_maxtime (SCM s_0)
6339 #define FUNC_NAME "nlopt-opt-get-maxtime"
6340 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
6342 SWIGUNUSED int gswig_list_p = 0;
6346 arg1 = (nlopt::opt *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_nlopt__opt, 1, 0);
6348 result = (double)((nlopt::opt const *)arg1)->get_maxtime();
6350 gswig_result = scm_from_double(result);
6354 return gswig_result;
6360 _wrap_nlopt_opt_set_maxtime (SCM s_0, SCM s_1)
6362 #define FUNC_NAME "nlopt-opt-set-maxtime"
6363 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
6366 SWIGUNUSED int gswig_list_p = 0;
6369 arg1 = (nlopt::opt *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_nlopt__opt, 1, 0);
6372 arg2 = (double) scm_to_double(s_1);
6375 (arg1)->set_maxtime(arg2);
6377 catch(std::invalid_argument &_e) {
6378 scm_throw(gh_symbol2scm("invalid-argument"),
6379 scm_list_1(scm_from_locale_string((_e).what())));
6383 gswig_result = SCM_UNSPECIFIED;
6386 return gswig_result;
6392 _wrap_nlopt_opt_get_force_stop (SCM s_0)
6394 #define FUNC_NAME "nlopt-opt-get-force-stop"
6395 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
6397 SWIGUNUSED int gswig_list_p = 0;
6401 arg1 = (nlopt::opt *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_nlopt__opt, 1, 0);
6403 result = (int)((nlopt::opt const *)arg1)->get_force_stop();
6405 gswig_result = scm_from_long(result);
6409 return gswig_result;
6415 _wrap_nlopt_opt_set_force_stop (SCM s_0, SCM s_1)
6417 #define FUNC_NAME "nlopt-opt-set-force-stop"
6418 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
6421 SWIGUNUSED int gswig_list_p = 0;
6424 arg1 = (nlopt::opt *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_nlopt__opt, 1, 0);
6427 arg2 = (int) scm_to_int(s_1);
6430 (arg1)->set_force_stop(arg2);
6432 catch(std::invalid_argument &_e) {
6433 scm_throw(gh_symbol2scm("invalid-argument"),
6434 scm_list_1(scm_from_locale_string((_e).what())));
6438 gswig_result = SCM_UNSPECIFIED;
6441 return gswig_result;
6447 _wrap_nlopt_opt_force_stop (SCM s_0)
6449 #define FUNC_NAME "nlopt-opt-force-stop"
6450 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
6452 SWIGUNUSED int gswig_list_p = 0;
6455 arg1 = (nlopt::opt *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_nlopt__opt, 1, 0);
6458 (arg1)->force_stop();
6460 catch(std::invalid_argument &_e) {
6461 scm_throw(gh_symbol2scm("invalid-argument"),
6462 scm_list_1(scm_from_locale_string((_e).what())));
6466 gswig_result = SCM_UNSPECIFIED;
6469 return gswig_result;
6475 _wrap_nlopt_opt_set_local_optimizer (SCM s_0, SCM s_1)
6477 #define FUNC_NAME "nlopt-opt-set-local-optimizer"
6478 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
6479 nlopt::opt *arg2 = 0 ;
6481 SWIGUNUSED int gswig_list_p = 0;
6484 arg1 = (nlopt::opt *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_nlopt__opt, 1, 0);
6487 arg2 = (nlopt::opt *)SWIG_MustGetPtr(s_1, SWIGTYPE_p_nlopt__opt, 2, 0);
6490 (arg1)->set_local_optimizer((nlopt::opt const &)*arg2);
6492 catch(std::bad_alloc &_e) {
6493 scm_throw(gh_symbol2scm("bad-alloc"),
6494 scm_list_1(scm_from_locale_string((_e).what())));
6497 catch(std::invalid_argument &_e) {
6498 scm_throw(gh_symbol2scm("invalid-argument"),
6499 scm_list_1(scm_from_locale_string((_e).what())));
6503 gswig_result = SCM_UNSPECIFIED;
6507 return gswig_result;
6513 _wrap_nlopt_opt_get_population (SCM s_0)
6515 #define FUNC_NAME "nlopt-opt-get-population"
6516 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
6518 SWIGUNUSED int gswig_list_p = 0;
6519 unsigned int result;
6522 arg1 = (nlopt::opt *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_nlopt__opt, 1, 0);
6524 result = (unsigned int)((nlopt::opt const *)arg1)->get_population();
6526 gswig_result = scm_from_ulong(result);
6530 return gswig_result;
6536 _wrap_nlopt_opt_set_population (SCM s_0, SCM s_1)
6538 #define FUNC_NAME "nlopt-opt-set-population"
6539 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
6542 SWIGUNUSED int gswig_list_p = 0;
6545 arg1 = (nlopt::opt *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_nlopt__opt, 1, 0);
6548 arg2 = (unsigned int) scm_to_uint(s_1);
6551 (arg1)->set_population(arg2);
6553 catch(std::invalid_argument &_e) {
6554 scm_throw(gh_symbol2scm("invalid-argument"),
6555 scm_list_1(scm_from_locale_string((_e).what())));
6559 gswig_result = SCM_UNSPECIFIED;
6562 return gswig_result;
6568 _wrap_nlopt_opt_get_vector_storage (SCM s_0)
6570 #define FUNC_NAME "nlopt-opt-get-vector-storage"
6571 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
6573 SWIGUNUSED int gswig_list_p = 0;
6574 unsigned int result;
6577 arg1 = (nlopt::opt *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_nlopt__opt, 1, 0);
6579 result = (unsigned int)((nlopt::opt const *)arg1)->get_vector_storage();
6581 gswig_result = scm_from_ulong(result);
6585 return gswig_result;
6591 _wrap_nlopt_opt_set_vector_storage (SCM s_0, SCM s_1)
6593 #define FUNC_NAME "nlopt-opt-set-vector-storage"
6594 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
6597 SWIGUNUSED int gswig_list_p = 0;
6600 arg1 = (nlopt::opt *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_nlopt__opt, 1, 0);
6603 arg2 = (unsigned int) scm_to_uint(s_1);
6606 (arg1)->set_vector_storage(arg2);
6608 catch(std::invalid_argument &_e) {
6609 scm_throw(gh_symbol2scm("invalid-argument"),
6610 scm_list_1(scm_from_locale_string((_e).what())));
6614 gswig_result = SCM_UNSPECIFIED;
6617 return gswig_result;
6623 _wrap_nlopt_opt_set_initial_step__SWIG_0 (int argc, SCM *argv)
6625 #define FUNC_NAME "nlopt-opt-set-initial-step"
6626 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
6629 SWIGUNUSED int gswig_list_p = 0;
6632 arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
6635 arg2 = (double) scm_to_double(argv[1]);
6638 (arg1)->set_initial_step(arg2);
6640 catch(std::invalid_argument &_e) {
6641 scm_throw(gh_symbol2scm("invalid-argument"),
6642 scm_list_1(scm_from_locale_string((_e).what())));
6646 gswig_result = SCM_UNSPECIFIED;
6649 return gswig_result;
6655 _wrap_nlopt_opt_get_initial_step__SWIG_0 (int argc, SCM *argv)
6657 #define FUNC_NAME "nlopt-opt-get-initial-step"
6658 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
6659 std::vector< double > *arg2 = 0 ;
6661 SWIGUNUSED int gswig_list_p = 0;
6664 arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
6667 arg2 = (std::vector< double > *)SWIG_MustGetPtr(argv[1], SWIGTYPE_p_std__vectorT_double_t, 2, 0);
6669 ((nlopt::opt const *)arg1)->get_initial_step(*arg2);
6670 gswig_result = SCM_UNSPECIFIED;
6674 return gswig_result;
6680 _wrap_nlopt_opt_get_initial_step__SWIG_1 (int argc, SCM *argv)
6682 #define FUNC_NAME "nlopt-opt-get-initial-step"
6683 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
6685 SWIGUNUSED int gswig_list_p = 0;
6686 std::vector< double > result;
6689 arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
6691 result = ((nlopt::opt const *)arg1)->get_initial_step();
6693 gswig_result = scm_make_vector(scm_from_long((&result)->size()),SCM_UNSPECIFIED);
6694 for (unsigned int i=0; i<(&result)->size(); i++) {
6695 SCM x = scm_from_double(((std::vector< double > &)result)[i]);
6696 scm_vector_set_x(gswig_result,scm_from_long(i),x);
6701 return gswig_result;
6707 _wrap_nlopt_opt_set_initial_step__SWIG_1 (int argc, SCM *argv)
6709 #define FUNC_NAME "nlopt-opt-set-initial-step"
6710 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
6711 std::vector< double > *arg2 = 0 ;
6712 std::vector< double > temp2 ;
6714 SWIGUNUSED int gswig_list_p = 0;
6717 arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
6720 if (scm_is_vector(argv[1])) {
6721 unsigned long size = scm_c_vector_length(argv[1]);
6722 temp2 = std::vector<double >(size);
6724 for (unsigned long i=0; i<size; i++) {
6725 SCM o = scm_vector_ref(argv[1],scm_from_ulong(i));
6726 if (scm_is_number(o))
6727 temp2[i] = (double)(scm_to_double(o));
6729 scm_wrong_type_arg(FUNC_NAME, 2, argv[1]);
6731 } else if (scm_is_null(argv[1])) {
6732 temp2 = std::vector<double >();
6734 } else if (scm_is_pair(argv[1])) {
6735 SCM v = scm_vector(argv[1]);
6736 unsigned long size = scm_c_vector_length(v);
6737 temp2 = std::vector<double >(size);
6739 for (unsigned long i=0; i<size; i++) {
6740 SCM o = scm_vector_ref(v,scm_from_ulong(i));
6741 if (scm_is_number(o))
6742 temp2[i] = (double)(scm_to_double(o));
6744 scm_wrong_type_arg(FUNC_NAME, 2, argv[1]);
6747 arg2 = (std::vector< double > *) SWIG_MustGetPtr(argv[1],SWIGTYPE_p_std__vectorT_double_t,2, 0);
6751 (arg1)->set_initial_step((std::vector< double > const &)*arg2);
6753 catch(std::invalid_argument &_e) {
6754 scm_throw(gh_symbol2scm("invalid-argument"),
6755 scm_list_1(scm_from_locale_string((_e).what())));
6759 gswig_result = SCM_UNSPECIFIED;
6763 return gswig_result;
6769 _wrap_nlopt_opt_set_initial_step(SCM rest)
6771 #define FUNC_NAME "nlopt-opt-set-initial-step"
6773 int argc = SWIG_Guile_GetArgs (argv, rest, 0, 2, "nlopt-opt-set-initial-step");
6778 int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
6779 _v = SWIG_CheckState(res);
6783 _v = scm_is_true(scm_real_p(argv[1])) ? 1 : 0;
6786 return _wrap_nlopt_opt_set_initial_step__SWIG_0(argc,argv);
6794 int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
6795 _v = SWIG_CheckState(res);
6799 /* native sequence? */
6800 if (scm_is_vector(argv[1])) {
6801 unsigned int size = scm_c_vector_length(argv[1]);
6803 /* an empty sequence can be of any type */
6806 /* check the first element only */
6808 SCM o = scm_vector_ref(argv[1],scm_from_ulong(0));
6809 _v = scm_is_number(o) ? 1 : 0;
6811 } else if (scm_is_null(argv[1])) {
6812 /* again, an empty sequence can be of any type */
6814 } else if (scm_is_pair(argv[1])) {
6815 /* check the first element only */
6817 SCM head = SCM_CAR(argv[1]);
6818 _v = scm_is_number(head) ? 1 : 0;
6820 /* wrapped vector? */
6821 std::vector<double >* v;
6822 _v = (SWIG_ConvertPtr(argv[1],(void **) &v,
6823 SWIGTYPE_p_std__vectorT_double_t, 0) != -1) ? 1 : 0;
6827 return _wrap_nlopt_opt_set_initial_step__SWIG_1(argc,argv);
6832 scm_misc_error("nlopt-opt-set-initial-step", "No matching method for generic function `nlopt_opt_set_initial_step'", SCM_EOL);
6838 _wrap_nlopt_opt_set_default_initial_step (SCM s_0, SCM s_1)
6840 #define FUNC_NAME "nlopt-opt-set-default-initial-step"
6841 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
6842 std::vector< double > *arg2 = 0 ;
6843 std::vector< double > temp2 ;
6845 SWIGUNUSED int gswig_list_p = 0;
6848 arg1 = (nlopt::opt *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_nlopt__opt, 1, 0);
6851 if (scm_is_vector(s_1)) {
6852 unsigned long size = scm_c_vector_length(s_1);
6853 temp2 = std::vector<double >(size);
6855 for (unsigned long i=0; i<size; i++) {
6856 SCM o = scm_vector_ref(s_1,scm_from_ulong(i));
6857 if (scm_is_number(o))
6858 temp2[i] = (double)(scm_to_double(o));
6860 scm_wrong_type_arg(FUNC_NAME, 2, s_1);
6862 } else if (scm_is_null(s_1)) {
6863 temp2 = std::vector<double >();
6865 } else if (scm_is_pair(s_1)) {
6866 SCM v = scm_vector(s_1);
6867 unsigned long size = scm_c_vector_length(v);
6868 temp2 = std::vector<double >(size);
6870 for (unsigned long i=0; i<size; i++) {
6871 SCM o = scm_vector_ref(v,scm_from_ulong(i));
6872 if (scm_is_number(o))
6873 temp2[i] = (double)(scm_to_double(o));
6875 scm_wrong_type_arg(FUNC_NAME, 2, s_1);
6878 arg2 = (std::vector< double > *) SWIG_MustGetPtr(s_1,SWIGTYPE_p_std__vectorT_double_t,2, 0);
6882 (arg1)->set_default_initial_step((std::vector< double > const &)*arg2);
6884 catch(std::bad_alloc &_e) {
6885 scm_throw(gh_symbol2scm("bad-alloc"),
6886 scm_list_1(scm_from_locale_string((_e).what())));
6889 catch(std::invalid_argument &_e) {
6890 scm_throw(gh_symbol2scm("invalid-argument"),
6891 scm_list_1(scm_from_locale_string((_e).what())));
6895 gswig_result = SCM_UNSPECIFIED;
6899 return gswig_result;
6905 _wrap_nlopt_opt_get_initial_step__SWIG_2 (int argc, SCM *argv)
6907 #define FUNC_NAME "nlopt-opt-get-initial-step"
6908 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
6909 std::vector< double > *arg2 = 0 ;
6910 std::vector< double > *arg3 = 0 ;
6911 std::vector< double > temp2 ;
6913 SWIGUNUSED int gswig_list_p = 0;
6916 arg1 = (nlopt::opt *)SWIG_MustGetPtr(argv[0], SWIGTYPE_p_nlopt__opt, 1, 0);
6919 if (scm_is_vector(argv[1])) {
6920 unsigned long size = scm_c_vector_length(argv[1]);
6921 temp2 = std::vector<double >(size);
6923 for (unsigned long i=0; i<size; i++) {
6924 SCM o = scm_vector_ref(argv[1],scm_from_ulong(i));
6925 if (scm_is_number(o))
6926 temp2[i] = (double)(scm_to_double(o));
6928 scm_wrong_type_arg(FUNC_NAME, 2, argv[1]);
6930 } else if (scm_is_null(argv[1])) {
6931 temp2 = std::vector<double >();
6933 } else if (scm_is_pair(argv[1])) {
6934 SCM v = scm_vector(argv[1]);
6935 unsigned long size = scm_c_vector_length(v);
6936 temp2 = std::vector<double >(size);
6938 for (unsigned long i=0; i<size; i++) {
6939 SCM o = scm_vector_ref(v,scm_from_ulong(i));
6940 if (scm_is_number(o))
6941 temp2[i] = (double)(scm_to_double(o));
6943 scm_wrong_type_arg(FUNC_NAME, 2, argv[1]);
6946 arg2 = (std::vector< double > *) SWIG_MustGetPtr(argv[1],SWIGTYPE_p_std__vectorT_double_t,2, 0);
6950 arg3 = (std::vector< double > *)SWIG_MustGetPtr(argv[2], SWIGTYPE_p_std__vectorT_double_t, 3, 0);
6952 ((nlopt::opt const *)arg1)->get_initial_step((std::vector< double > const &)*arg2,*arg3);
6953 gswig_result = SCM_UNSPECIFIED;
6958 return gswig_result;
6964 _wrap_nlopt_opt_get_initial_step(SCM rest)
6966 #define FUNC_NAME "nlopt-opt-get-initial-step"
6968 int argc = SWIG_Guile_GetArgs (argv, rest, 0, 3, "nlopt-opt-get-initial-step");
6973 int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
6974 _v = SWIG_CheckState(res);
6977 return _wrap_nlopt_opt_get_initial_step__SWIG_1(argc,argv);
6984 int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
6985 _v = SWIG_CheckState(res);
6990 int res = SWIG_ConvertPtr(argv[1], &ptr, SWIGTYPE_p_std__vectorT_double_t, 0);
6991 _v = SWIG_CheckState(res);
6994 return _wrap_nlopt_opt_get_initial_step__SWIG_0(argc,argv);
7002 int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_nlopt__opt, 0);
7003 _v = SWIG_CheckState(res);
7007 /* native sequence? */
7008 if (scm_is_vector(argv[1])) {
7009 unsigned int size = scm_c_vector_length(argv[1]);
7011 /* an empty sequence can be of any type */
7014 /* check the first element only */
7016 SCM o = scm_vector_ref(argv[1],scm_from_ulong(0));
7017 _v = scm_is_number(o) ? 1 : 0;
7019 } else if (scm_is_null(argv[1])) {
7020 /* again, an empty sequence can be of any type */
7022 } else if (scm_is_pair(argv[1])) {
7023 /* check the first element only */
7025 SCM head = SCM_CAR(argv[1]);
7026 _v = scm_is_number(head) ? 1 : 0;
7028 /* wrapped vector? */
7029 std::vector<double >* v;
7030 _v = (SWIG_ConvertPtr(argv[1],(void **) &v,
7031 SWIGTYPE_p_std__vectorT_double_t, 0) != -1) ? 1 : 0;
7037 int res = SWIG_ConvertPtr(argv[2], &ptr, SWIGTYPE_p_std__vectorT_double_t, 0);
7038 _v = SWIG_CheckState(res);
7041 return _wrap_nlopt_opt_get_initial_step__SWIG_2(argc,argv);
7047 scm_misc_error("nlopt-opt-get-initial-step", "No matching method for generic function `nlopt_opt_get_initial_step'", SCM_EOL);
7053 _wrap_nlopt_opt_get_initial_step_ (SCM s_0, SCM s_1)
7055 #define FUNC_NAME "nlopt-opt-get-initial-step-"
7056 nlopt::opt *arg1 = (nlopt::opt *) 0 ;
7057 std::vector< double > *arg2 = 0 ;
7058 std::vector< double > temp2 ;
7060 SWIGUNUSED int gswig_list_p = 0;
7061 std::vector< double > result;
7064 arg1 = (nlopt::opt *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_nlopt__opt, 1, 0);
7067 if (scm_is_vector(s_1)) {
7068 unsigned long size = scm_c_vector_length(s_1);
7069 temp2 = std::vector<double >(size);
7071 for (unsigned long i=0; i<size; i++) {
7072 SCM o = scm_vector_ref(s_1,scm_from_ulong(i));
7073 if (scm_is_number(o))
7074 temp2[i] = (double)(scm_to_double(o));
7076 scm_wrong_type_arg(FUNC_NAME, 2, s_1);
7078 } else if (scm_is_null(s_1)) {
7079 temp2 = std::vector<double >();
7081 } else if (scm_is_pair(s_1)) {
7082 SCM v = scm_vector(s_1);
7083 unsigned long size = scm_c_vector_length(v);
7084 temp2 = std::vector<double >(size);
7086 for (unsigned long i=0; i<size; i++) {
7087 SCM o = scm_vector_ref(v,scm_from_ulong(i));
7088 if (scm_is_number(o))
7089 temp2[i] = (double)(scm_to_double(o));
7091 scm_wrong_type_arg(FUNC_NAME, 2, s_1);
7094 arg2 = (std::vector< double > *) SWIG_MustGetPtr(s_1,SWIGTYPE_p_std__vectorT_double_t,2, 0);
7097 result = ((nlopt::opt const *)arg1)->get_initial_step_((std::vector< double > const &)*arg2);
7099 gswig_result = scm_make_vector(scm_from_long((&result)->size()),SCM_UNSPECIFIED);
7100 for (unsigned int i=0; i<(&result)->size(); i++) {
7101 SCM x = scm_from_double(((std::vector< double > &)result)[i]);
7102 scm_vector_set_x(gswig_result,scm_from_long(i),x);
7108 return gswig_result;
7114 _wrap_nlopt_srand (SCM s_0)
7116 #define FUNC_NAME "nlopt-srand"
7117 unsigned long arg1 ;
7119 SWIGUNUSED int gswig_list_p = 0;
7122 arg1 = (unsigned long) scm_to_ulong(s_0);
7125 gswig_result = SCM_UNSPECIFIED;
7127 return gswig_result;
7133 _wrap_nlopt_srand_time ()
7135 #define FUNC_NAME "nlopt-srand-time"
7137 SWIGUNUSED int gswig_list_p = 0;
7139 nlopt::srand_time();
7140 gswig_result = SCM_UNSPECIFIED;
7142 return gswig_result;
7148 _wrap_nlopt_version (SCM s_0, SCM s_1, SCM s_2)
7150 #define FUNC_NAME "nlopt-version"
7155 SWIGUNUSED int gswig_list_p = 0;
7158 arg1 = (int *)SWIG_MustGetPtr(s_0, SWIGTYPE_p_int, 1, 0);
7161 arg2 = (int *)SWIG_MustGetPtr(s_1, SWIGTYPE_p_int, 2, 0);
7164 arg3 = (int *)SWIG_MustGetPtr(s_2, SWIGTYPE_p_int, 3, 0);
7166 nlopt::version(*arg1,*arg2,*arg3);
7167 gswig_result = SCM_UNSPECIFIED;
7172 return gswig_result;
7178 _wrap_nlopt_version_major ()
7180 #define FUNC_NAME "nlopt-version-major"
7182 SWIGUNUSED int gswig_list_p = 0;
7185 result = (int)nlopt::version_major();
7187 gswig_result = scm_from_long(result);
7190 return gswig_result;
7196 _wrap_nlopt_version_minor ()
7198 #define FUNC_NAME "nlopt-version-minor"
7200 SWIGUNUSED int gswig_list_p = 0;
7203 result = (int)nlopt::version_minor();
7205 gswig_result = scm_from_long(result);
7208 return gswig_result;
7214 _wrap_nlopt_version_bugfix ()
7216 #define FUNC_NAME "nlopt-version-bugfix"
7218 SWIGUNUSED int gswig_list_p = 0;
7221 result = (int)nlopt::version_bugfix();
7223 gswig_result = scm_from_long(result);
7226 return gswig_result;
7232 _wrap_nlopt_algorithm_name (SCM s_0)
7234 #define FUNC_NAME "nlopt-algorithm-name"
7235 nlopt::algorithm arg1 ;
7237 SWIGUNUSED int gswig_list_p = 0;
7241 arg1 = (nlopt::algorithm) scm_to_int(s_0);
7243 result = (char *)nlopt::algorithm_name(arg1);
7245 gswig_result = SWIG_str02scm((const char *)result);
7248 return gswig_result;
7257 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
7259 static swig_type_info _swigt__p_double = {"_p_double", "double *", 0, 0, (void*)0, 0};
7260 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};
7261 static swig_type_info _swigt__p_int = {"_p_int", "int *", 0, 0, (void*)0, 0};
7262 static swig_type_info _swigt__p_nlopt__forced_stop = {"_p_nlopt__forced_stop", "nlopt::forced_stop *", 0, 0, (void*)0, 0};
7263 static swig_type_info _swigt__p_nlopt__opt = {"_p_nlopt__opt", "nlopt::opt *", 0, 0, (void*)0, 0};
7264 static swig_type_info _swigt__p_nlopt__roundoff_limited = {"_p_nlopt__roundoff_limited", "nlopt::roundoff_limited *", 0, 0, (void*)0, 0};
7265 static swig_type_info _swigt__p_nlopt_func = {"_p_nlopt_func", "nlopt::func *|nlopt_func *", 0, 0, (void*)0, 0};
7266 static swig_type_info _swigt__p_nlopt_mfunc = {"_p_nlopt_mfunc", "nlopt_mfunc *|nlopt::mfunc *", 0, 0, (void*)0, 0};
7267 static swig_type_info _swigt__p_nlopt_munge = {"_p_nlopt_munge", "nlopt_munge *", 0, 0, (void*)0, 0};
7268 static swig_type_info _swigt__p_nlopt_opt = {"_p_nlopt_opt", "nlopt_opt *", 0, 0, (void*)0, 0};
7269 static swig_type_info _swigt__p_nlopt_result = {"_p_nlopt_result", "nlopt_result *", 0, 0, (void*)0, 0};
7270 static swig_type_info _swigt__p_std__out_of_range = {"_p_std__out_of_range", "std::out_of_range *", 0, 0, (void*)0, 0};
7271 static swig_type_info _swigt__p_std__vectorT_double_t = {"_p_std__vectorT_double_t", "std::vector< double > *", 0, 0, (void*)0, 0};
7272 static swig_type_info _swigt__p_unsigned_long = {"_p_unsigned_long", "SCM *|unsigned long *", 0, 0, (void*)0, 0};
7274 static swig_type_info *swig_type_initial[] = {
7276 &_swigt__p_f_r_q_const__std__vector__double___r_std__vector__double___p_void__double,
7278 &_swigt__p_nlopt__forced_stop,
7279 &_swigt__p_nlopt__opt,
7280 &_swigt__p_nlopt__roundoff_limited,
7281 &_swigt__p_nlopt_func,
7282 &_swigt__p_nlopt_mfunc,
7283 &_swigt__p_nlopt_munge,
7284 &_swigt__p_nlopt_opt,
7285 &_swigt__p_nlopt_result,
7286 &_swigt__p_std__out_of_range,
7287 &_swigt__p_std__vectorT_double_t,
7288 &_swigt__p_unsigned_long,
7291 static swig_cast_info _swigc__p_double[] = { {&_swigt__p_double, 0, 0, 0},{0, 0, 0, 0}};
7292 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}};
7293 static swig_cast_info _swigc__p_int[] = { {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}};
7294 static swig_cast_info _swigc__p_nlopt__forced_stop[] = { {&_swigt__p_nlopt__forced_stop, 0, 0, 0},{0, 0, 0, 0}};
7295 static swig_cast_info _swigc__p_nlopt__opt[] = { {&_swigt__p_nlopt__opt, 0, 0, 0},{0, 0, 0, 0}};
7296 static swig_cast_info _swigc__p_nlopt__roundoff_limited[] = { {&_swigt__p_nlopt__roundoff_limited, 0, 0, 0},{0, 0, 0, 0}};
7297 static swig_cast_info _swigc__p_nlopt_func[] = { {&_swigt__p_nlopt_func, 0, 0, 0},{0, 0, 0, 0}};
7298 static swig_cast_info _swigc__p_nlopt_mfunc[] = { {&_swigt__p_nlopt_mfunc, 0, 0, 0},{0, 0, 0, 0}};
7299 static swig_cast_info _swigc__p_nlopt_munge[] = { {&_swigt__p_nlopt_munge, 0, 0, 0},{0, 0, 0, 0}};
7300 static swig_cast_info _swigc__p_nlopt_opt[] = { {&_swigt__p_nlopt_opt, 0, 0, 0},{0, 0, 0, 0}};
7301 static swig_cast_info _swigc__p_nlopt_result[] = { {&_swigt__p_nlopt_result, 0, 0, 0},{0, 0, 0, 0}};
7302 static swig_cast_info _swigc__p_std__out_of_range[] = { {&_swigt__p_std__out_of_range, 0, 0, 0},{0, 0, 0, 0}};
7303 static swig_cast_info _swigc__p_std__vectorT_double_t[] = { {&_swigt__p_std__vectorT_double_t, 0, 0, 0},{0, 0, 0, 0}};
7304 static swig_cast_info _swigc__p_unsigned_long[] = { {&_swigt__p_unsigned_long, 0, 0, 0},{0, 0, 0, 0}};
7306 static swig_cast_info *swig_cast_initial[] = {
7308 _swigc__p_f_r_q_const__std__vector__double___r_std__vector__double___p_void__double,
7310 _swigc__p_nlopt__forced_stop,
7311 _swigc__p_nlopt__opt,
7312 _swigc__p_nlopt__roundoff_limited,
7313 _swigc__p_nlopt_func,
7314 _swigc__p_nlopt_mfunc,
7315 _swigc__p_nlopt_munge,
7316 _swigc__p_nlopt_opt,
7317 _swigc__p_nlopt_result,
7318 _swigc__p_std__out_of_range,
7319 _swigc__p_std__vectorT_double_t,
7320 _swigc__p_unsigned_long,
7324 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
7326 /* -----------------------------------------------------------------------------
7327 * Type initialization:
7328 * This problem is tough by the requirement that no dynamic
7329 * memory is used. Also, since swig_type_info structures store pointers to
7330 * swig_cast_info structures and swig_cast_info structures store pointers back
7331 * to swig_type_info structures, we need some lookup code at initialization.
7332 * The idea is that swig generates all the structures that are needed.
7333 * The runtime then collects these partially filled structures.
7334 * The SWIG_InitializeModule function takes these initial arrays out of
7335 * swig_module, and does all the lookup, filling in the swig_module.types
7336 * array with the correct data and linking the correct swig_cast_info
7337 * structures together.
7339 * The generated swig_type_info structures are assigned staticly to an initial
7340 * array. We just loop through that array, and handle each type individually.
7341 * First we lookup if this type has been already loaded, and if so, use the
7342 * loaded structure instead of the generated one. Then we have to fill in the
7343 * cast linked list. The cast data is initially stored in something like a
7344 * two-dimensional array. Each row corresponds to a type (there are the same
7345 * number of rows as there are in the swig_type_initial array). Each entry in
7346 * a column is one of the swig_cast_info structures for that type.
7347 * The cast_initial array is actually an array of arrays, because each row has
7348 * a variable number of columns. So to actually build the cast linked list,
7349 * we find the array of casts associated with the type, and loop through it
7350 * adding the casts to the list. The one last trick we need to do is making
7351 * sure the type pointer in the swig_cast_info struct is correct.
7353 * First off, we lookup the cast->type name to see if it is already loaded.
7354 * There are three cases to handle:
7355 * 1) If the cast->type has already been loaded AND the type we are adding
7356 * casting info to has not been loaded (it is in this module), THEN we
7357 * replace the cast->type pointer with the type pointer that has already
7359 * 2) If BOTH types (the one we are adding casting info to, and the
7360 * cast->type) are loaded, THEN the cast info has already been loaded by
7361 * the previous module so we just ignore it.
7362 * 3) Finally, if cast->type has not already been loaded, then we add that
7363 * swig_cast_info to the linked list (because the cast->type) pointer will
7365 * ----------------------------------------------------------------------------- */
7375 #define SWIGRUNTIME_DEBUG
7380 SWIG_InitializeModule(void *clientdata) {
7382 swig_module_info *module_head, *iter;
7385 /* check to see if the circular list has been setup, if not, set it up */
7386 if (swig_module.next==0) {
7387 /* Initialize the swig_module */
7388 swig_module.type_initial = swig_type_initial;
7389 swig_module.cast_initial = swig_cast_initial;
7390 swig_module.next = &swig_module;
7396 /* Try and load any already created modules */
7397 module_head = SWIG_GetModule(clientdata);
7399 /* This is the first module loaded for this interpreter */
7400 /* so set the swig module into the interpreter */
7401 SWIG_SetModule(clientdata, &swig_module);
7402 module_head = &swig_module;
7404 /* the interpreter has loaded a SWIG module, but has it loaded this one? */
7408 if (iter==&swig_module) {
7413 } while (iter!= module_head);
7415 /* if the is found in the list, then all is done and we may leave */
7417 /* otherwise we must add out module into the list */
7418 swig_module.next = module_head->next;
7419 module_head->next = &swig_module;
7422 /* When multiple interpreters are used, a module could have already been initialized in
7423 a different interpreter, but not yet have a pointer in this interpreter.
7424 In this case, we do not want to continue adding types... everything should be
7426 if (init == 0) return;
7428 /* Now work on filling in swig_module.types */
7429 #ifdef SWIGRUNTIME_DEBUG
7430 printf("SWIG_InitializeModule: size %d\n", swig_module.size);
7432 for (i = 0; i < swig_module.size; ++i) {
7433 swig_type_info *type = 0;
7434 swig_type_info *ret;
7435 swig_cast_info *cast;
7437 #ifdef SWIGRUNTIME_DEBUG
7438 printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
7441 /* if there is another module already loaded */
7442 if (swig_module.next != &swig_module) {
7443 type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
7446 /* Overwrite clientdata field */
7447 #ifdef SWIGRUNTIME_DEBUG
7448 printf("SWIG_InitializeModule: found type %s\n", type->name);
7450 if (swig_module.type_initial[i]->clientdata) {
7451 type->clientdata = swig_module.type_initial[i]->clientdata;
7452 #ifdef SWIGRUNTIME_DEBUG
7453 printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
7457 type = swig_module.type_initial[i];
7460 /* Insert casting types */
7461 cast = swig_module.cast_initial[i];
7462 while (cast->type) {
7463 /* Don't need to add information already in the list */
7465 #ifdef SWIGRUNTIME_DEBUG
7466 printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
7468 if (swig_module.next != &swig_module) {
7469 ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
7470 #ifdef SWIGRUNTIME_DEBUG
7471 if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
7475 if (type == swig_module.type_initial[i]) {
7476 #ifdef SWIGRUNTIME_DEBUG
7477 printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
7482 /* Check for casting already in the list */
7483 swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
7484 #ifdef SWIGRUNTIME_DEBUG
7485 if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
7487 if (!ocast) ret = 0;
7492 #ifdef SWIGRUNTIME_DEBUG
7493 printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
7496 type->cast->prev = cast;
7497 cast->next = type->cast;
7503 /* Set entry in modules->types array equal to the type */
7504 swig_module.types[i] = type;
7506 swig_module.types[i] = 0;
7508 #ifdef SWIGRUNTIME_DEBUG
7509 printf("**** SWIG_InitializeModule: Cast List ******\n");
7510 for (i = 0; i < swig_module.size; ++i) {
7512 swig_cast_info *cast = swig_module.cast_initial[i];
7513 printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
7514 while (cast->type) {
7515 printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
7519 printf("---- Total casts: %d\n",j);
7521 printf("**** SWIG_InitializeModule: Cast List ******\n");
7525 /* This function will propagate the clientdata field of type to
7526 * any new swig_type_info structures that have been added into the list
7527 * of equivalent types. It is like calling
7528 * SWIG_TypeClientData(type, clientdata) a second time.
7531 SWIG_PropagateClientData(void) {
7533 swig_cast_info *equiv;
7534 static int init_run = 0;
7536 if (init_run) return;
7539 for (i = 0; i < swig_module.size; i++) {
7540 if (swig_module.types[i]->clientdata) {
7541 equiv = swig_module.types[i]->cast;
7543 if (!equiv->converter) {
7544 if (equiv->type && !equiv->type->clientdata)
7545 SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
7547 equiv = equiv->next;
7562 SWIG_GUILE_INIT_STATIC void
7565 SWIG_InitializeModule(0);
7566 SWIG_PropagateClientData();
7568 SWIG_TypeClientData(SWIGTYPE_p_std__vectorT_double_t, (void *) &_swig_guile_clientdatanlopt_doublevector);
7569 scm_c_define_gsubr("new-nlopt-doublevector", 0, 0, 1, (swig_guile_proc) _wrap_new_nlopt_doublevector);
7570 scm_c_define_gsubr("nlopt-doublevector-length", 1, 0, 0, (swig_guile_proc) _wrap_nlopt_doublevector_length);
7571 scm_c_define_gsubr("nlopt-doublevector-empty?", 1, 0, 0, (swig_guile_proc) _wrap_nlopt_doublevector_emptyq___);
7572 scm_c_define_gsubr("nlopt-doublevector-clear!", 1, 0, 0, (swig_guile_proc) _wrap_nlopt_doublevector_clearN___);
7573 scm_c_define_gsubr("nlopt-doublevector-push!", 2, 0, 0, (swig_guile_proc) _wrap_nlopt_doublevector_pushN___);
7574 scm_c_define_gsubr("nlopt-doublevector-pop!", 1, 0, 0, (swig_guile_proc) _wrap_nlopt_doublevector_popN___);
7575 scm_c_define_gsubr("nlopt-doublevector-ref", 2, 0, 0, (swig_guile_proc) _wrap_nlopt_doublevector_ref);
7576 scm_c_define_gsubr("nlopt-doublevector-set!", 3, 0, 0, (swig_guile_proc) _wrap_nlopt_doublevector_setN___);
7577 ((swig_guile_clientdata *)(SWIGTYPE_p_std__vectorT_double_t->clientdata))->destroy = (guile_destructor) _wrap_delete_nlopt_doublevector;
7578 scm_c_define_gsubr("delete-nlopt-doublevector", 1, 0, 0, (swig_guile_proc) _wrap_delete_nlopt_doublevector);
7579 scm_c_define_gsubr("nlopt-get-initial-step", 2, 0, 0, (swig_guile_proc) _wrap_nlopt_get_initial_step);
7580 scm_c_define_gsubr("NLOPT-GN-DIRECT", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_GN_DIRECT);
7581 scm_c_define_gsubr("NLOPT-GN-DIRECT-L", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_GN_DIRECT_L);
7582 scm_c_define_gsubr("NLOPT-GN-DIRECT-L-RAND", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_GN_DIRECT_L_RAND);
7583 scm_c_define_gsubr("NLOPT-GN-DIRECT-NOSCAL", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_GN_DIRECT_NOSCAL);
7584 scm_c_define_gsubr("NLOPT-GN-DIRECT-L-NOSCAL", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_GN_DIRECT_L_NOSCAL);
7585 scm_c_define_gsubr("NLOPT-GN-DIRECT-L-RAND-NOSCAL", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_GN_DIRECT_L_RAND_NOSCAL);
7586 scm_c_define_gsubr("NLOPT-GN-ORIG-DIRECT", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_GN_ORIG_DIRECT);
7587 scm_c_define_gsubr("NLOPT-GN-ORIG-DIRECT-L", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_GN_ORIG_DIRECT_L);
7588 scm_c_define_gsubr("NLOPT-GD-STOGO", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_GD_STOGO);
7589 scm_c_define_gsubr("NLOPT-GD-STOGO-RAND", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_GD_STOGO_RAND);
7590 scm_c_define_gsubr("NLOPT-LD-LBFGS-NOCEDAL", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_LD_LBFGS_NOCEDAL);
7591 scm_c_define_gsubr("NLOPT-LD-LBFGS", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_LD_LBFGS);
7592 scm_c_define_gsubr("NLOPT-LN-PRAXIS", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_LN_PRAXIS);
7593 scm_c_define_gsubr("NLOPT-LD-VAR1", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_LD_VAR1);
7594 scm_c_define_gsubr("NLOPT-LD-VAR2", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_LD_VAR2);
7595 scm_c_define_gsubr("NLOPT-LD-TNEWTON", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_LD_TNEWTON);
7596 scm_c_define_gsubr("NLOPT-LD-TNEWTON-RESTART", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_LD_TNEWTON_RESTART);
7597 scm_c_define_gsubr("NLOPT-LD-TNEWTON-PRECOND", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_LD_TNEWTON_PRECOND);
7598 scm_c_define_gsubr("NLOPT-LD-TNEWTON-PRECOND-RESTART", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_LD_TNEWTON_PRECOND_RESTART);
7599 scm_c_define_gsubr("NLOPT-GN-CRS2-LM", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_GN_CRS2_LM);
7600 scm_c_define_gsubr("NLOPT-GN-MLSL", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_GN_MLSL);
7601 scm_c_define_gsubr("NLOPT-GD-MLSL", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_GD_MLSL);
7602 scm_c_define_gsubr("NLOPT-GN-MLSL-LDS", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_GN_MLSL_LDS);
7603 scm_c_define_gsubr("NLOPT-GD-MLSL-LDS", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_GD_MLSL_LDS);
7604 scm_c_define_gsubr("NLOPT-LD-MMA", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_LD_MMA);
7605 scm_c_define_gsubr("NLOPT-LN-COBYLA", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_LN_COBYLA);
7606 scm_c_define_gsubr("NLOPT-LN-NEWUOA", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_LN_NEWUOA);
7607 scm_c_define_gsubr("NLOPT-LN-NEWUOA-BOUND", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_LN_NEWUOA_BOUND);
7608 scm_c_define_gsubr("NLOPT-LN-NELDERMEAD", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_LN_NELDERMEAD);
7609 scm_c_define_gsubr("NLOPT-LN-SBPLX", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_LN_SBPLX);
7610 scm_c_define_gsubr("NLOPT-LN-AUGLAG", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_LN_AUGLAG);
7611 scm_c_define_gsubr("NLOPT-LD-AUGLAG", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_LD_AUGLAG);
7612 scm_c_define_gsubr("NLOPT-LN-AUGLAG-EQ", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_LN_AUGLAG_EQ);
7613 scm_c_define_gsubr("NLOPT-LD-AUGLAG-EQ", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_LD_AUGLAG_EQ);
7614 scm_c_define_gsubr("NLOPT-LN-BOBYQA", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_LN_BOBYQA);
7615 scm_c_define_gsubr("NLOPT-GN-ISRES", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_GN_ISRES);
7616 scm_c_define_gsubr("NLOPT-AUGLAG", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_AUGLAG);
7617 scm_c_define_gsubr("NLOPT-AUGLAG-EQ", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_AUGLAG_EQ);
7618 scm_c_define_gsubr("NLOPT-G-MLSL", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_G_MLSL);
7619 scm_c_define_gsubr("NLOPT-G-MLSL-LDS", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_G_MLSL_LDS);
7620 scm_c_define_gsubr("NLOPT-LD-SLSQP", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_LD_SLSQP);
7621 scm_c_define_gsubr("NLOPT-LD-CCSAQ", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_LD_CCSAQ);
7622 scm_c_define_gsubr("NLOPT-GN-ESCH", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_GN_ESCH);
7623 scm_c_define_gsubr("NLOPT-NUM-ALGORITHMS", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_NUM_ALGORITHMS);
7624 scm_c_define_gsubr("NLOPT-FAILURE", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_FAILURE);
7625 scm_c_define_gsubr("NLOPT-INVALID-ARGS", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_INVALID_ARGS);
7626 scm_c_define_gsubr("NLOPT-OUT-OF-MEMORY", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_OUT_OF_MEMORY);
7627 scm_c_define_gsubr("NLOPT-ROUNDOFF-LIMITED", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_ROUNDOFF_LIMITED);
7628 scm_c_define_gsubr("NLOPT-FORCED-STOP", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_FORCED_STOP);
7629 scm_c_define_gsubr("NLOPT-SUCCESS", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_SUCCESS);
7630 scm_c_define_gsubr("NLOPT-STOPVAL-REACHED", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_STOPVAL_REACHED);
7631 scm_c_define_gsubr("NLOPT-FTOL-REACHED", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_FTOL_REACHED);
7632 scm_c_define_gsubr("NLOPT-XTOL-REACHED", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_XTOL_REACHED);
7633 scm_c_define_gsubr("NLOPT-MAXEVAL-REACHED", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_MAXEVAL_REACHED);
7634 scm_c_define_gsubr("NLOPT-MAXTIME-REACHED", 0, 0, 0, (swig_guile_proc) _wrap_NLOPT_MAXTIME_REACHED);
7635 SWIG_TypeClientData(SWIGTYPE_p_nlopt__roundoff_limited, (void *) &_swig_guile_clientdatanlopt_roundoff_limited);
7636 scm_c_define_gsubr("new-nlopt-roundoff-limited", 0, 0, 0, (swig_guile_proc) _wrap_new_nlopt_roundoff_limited);
7637 ((swig_guile_clientdata *)(SWIGTYPE_p_nlopt__roundoff_limited->clientdata))->destroy = (guile_destructor) _wrap_delete_nlopt_roundoff_limited;
7638 scm_c_define_gsubr("delete-nlopt-roundoff-limited", 1, 0, 0, (swig_guile_proc) _wrap_delete_nlopt_roundoff_limited);
7639 SWIG_TypeClientData(SWIGTYPE_p_nlopt__forced_stop, (void *) &_swig_guile_clientdatanlopt_forced_stop);
7640 scm_c_define_gsubr("new-nlopt-forced-stop", 0, 0, 0, (swig_guile_proc) _wrap_new_nlopt_forced_stop);
7641 ((swig_guile_clientdata *)(SWIGTYPE_p_nlopt__forced_stop->clientdata))->destroy = (guile_destructor) _wrap_delete_nlopt_forced_stop;
7642 scm_c_define_gsubr("delete-nlopt-forced-stop", 1, 0, 0, (swig_guile_proc) _wrap_delete_nlopt_forced_stop);
7643 SWIG_TypeClientData(SWIGTYPE_p_nlopt__opt, (void *) &_swig_guile_clientdatanlopt_opt);
7644 ((swig_guile_clientdata *)(SWIGTYPE_p_nlopt__opt->clientdata))->destroy = (guile_destructor) _wrap_delete_nlopt_opt;
7645 scm_c_define_gsubr("delete-nlopt-opt", 1, 0, 0, (swig_guile_proc) _wrap_delete_nlopt_opt);
7646 scm_c_define_gsubr("new-nlopt-opt", 0, 0, 1, (swig_guile_proc) _wrap_new_nlopt_opt);
7647 scm_c_define_gsubr("nlopt-opt-optimize", 0, 0, 1, (swig_guile_proc) _wrap_nlopt_opt_optimize);
7648 scm_c_define_gsubr("nlopt-opt-last-optimize-result", 1, 0, 0, (swig_guile_proc) _wrap_nlopt_opt_last_optimize_result);
7649 scm_c_define_gsubr("nlopt-opt-last-optimum-value", 1, 0, 0, (swig_guile_proc) _wrap_nlopt_opt_last_optimum_value);
7650 scm_c_define_gsubr("nlopt-opt-get-algorithm", 1, 0, 0, (swig_guile_proc) _wrap_nlopt_opt_get_algorithm);
7651 scm_c_define_gsubr("nlopt-opt-get-algorithm-name", 1, 0, 0, (swig_guile_proc) _wrap_nlopt_opt_get_algorithm_name);
7652 scm_c_define_gsubr("nlopt-opt-get-dimension", 1, 0, 0, (swig_guile_proc) _wrap_nlopt_opt_get_dimension);
7653 scm_c_define_gsubr("nlopt-opt-set-min-objective", 0, 0, 1, (swig_guile_proc) _wrap_nlopt_opt_set_min_objective);
7654 scm_c_define_gsubr("nlopt-opt-set-max-objective", 0, 0, 1, (swig_guile_proc) _wrap_nlopt_opt_set_max_objective);
7655 scm_c_define_gsubr("nlopt-opt-remove-inequality-constraints", 1, 0, 0, (swig_guile_proc) _wrap_nlopt_opt_remove_inequality_constraints);
7656 scm_c_define_gsubr("nlopt-opt-remove-equality-constraints", 1, 0, 0, (swig_guile_proc) _wrap_nlopt_opt_remove_equality_constraints);
7657 scm_c_define_gsubr("nlopt-opt-add-inequality-constraint", 0, 0, 1, (swig_guile_proc) _wrap_nlopt_opt_add_inequality_constraint);
7658 scm_c_define_gsubr("nlopt-opt-add-equality-constraint", 0, 0, 1, (swig_guile_proc) _wrap_nlopt_opt_add_equality_constraint);
7659 scm_c_define_gsubr("nlopt-opt-add-inequality-mconstraint", 0, 0, 1, (swig_guile_proc) _wrap_nlopt_opt_add_inequality_mconstraint);
7660 scm_c_define_gsubr("nlopt-opt-add-equality-mconstraint", 0, 0, 1, (swig_guile_proc) _wrap_nlopt_opt_add_equality_mconstraint);
7661 scm_c_define_gsubr("nlopt-opt-get-lower-bounds", 0, 0, 1, (swig_guile_proc) _wrap_nlopt_opt_get_lower_bounds);
7662 scm_c_define_gsubr("nlopt-opt-set-lower-bounds", 0, 0, 1, (swig_guile_proc) _wrap_nlopt_opt_set_lower_bounds);
7663 scm_c_define_gsubr("nlopt-opt-get-upper-bounds", 0, 0, 1, (swig_guile_proc) _wrap_nlopt_opt_get_upper_bounds);
7664 scm_c_define_gsubr("nlopt-opt-set-upper-bounds", 0, 0, 1, (swig_guile_proc) _wrap_nlopt_opt_set_upper_bounds);
7665 scm_c_define_gsubr("nlopt-opt-get-stopval", 1, 0, 0, (swig_guile_proc) _wrap_nlopt_opt_get_stopval);
7666 scm_c_define_gsubr("nlopt-opt-set-stopval", 2, 0, 0, (swig_guile_proc) _wrap_nlopt_opt_set_stopval);
7667 scm_c_define_gsubr("nlopt-opt-get-ftol-rel", 1, 0, 0, (swig_guile_proc) _wrap_nlopt_opt_get_ftol_rel);
7668 scm_c_define_gsubr("nlopt-opt-set-ftol-rel", 2, 0, 0, (swig_guile_proc) _wrap_nlopt_opt_set_ftol_rel);
7669 scm_c_define_gsubr("nlopt-opt-get-ftol-abs", 1, 0, 0, (swig_guile_proc) _wrap_nlopt_opt_get_ftol_abs);
7670 scm_c_define_gsubr("nlopt-opt-set-ftol-abs", 2, 0, 0, (swig_guile_proc) _wrap_nlopt_opt_set_ftol_abs);
7671 scm_c_define_gsubr("nlopt-opt-get-xtol-rel", 1, 0, 0, (swig_guile_proc) _wrap_nlopt_opt_get_xtol_rel);
7672 scm_c_define_gsubr("nlopt-opt-set-xtol-rel", 2, 0, 0, (swig_guile_proc) _wrap_nlopt_opt_set_xtol_rel);
7673 scm_c_define_gsubr("nlopt-opt-get-xtol-abs", 0, 0, 1, (swig_guile_proc) _wrap_nlopt_opt_get_xtol_abs);
7674 scm_c_define_gsubr("nlopt-opt-set-xtol-abs", 0, 0, 1, (swig_guile_proc) _wrap_nlopt_opt_set_xtol_abs);
7675 scm_c_define_gsubr("nlopt-opt-get-maxeval", 1, 0, 0, (swig_guile_proc) _wrap_nlopt_opt_get_maxeval);
7676 scm_c_define_gsubr("nlopt-opt-set-maxeval", 2, 0, 0, (swig_guile_proc) _wrap_nlopt_opt_set_maxeval);
7677 scm_c_define_gsubr("nlopt-opt-get-maxtime", 1, 0, 0, (swig_guile_proc) _wrap_nlopt_opt_get_maxtime);
7678 scm_c_define_gsubr("nlopt-opt-set-maxtime", 2, 0, 0, (swig_guile_proc) _wrap_nlopt_opt_set_maxtime);
7679 scm_c_define_gsubr("nlopt-opt-get-force-stop", 1, 0, 0, (swig_guile_proc) _wrap_nlopt_opt_get_force_stop);
7680 scm_c_define_gsubr("nlopt-opt-set-force-stop", 2, 0, 0, (swig_guile_proc) _wrap_nlopt_opt_set_force_stop);
7681 scm_c_define_gsubr("nlopt-opt-force-stop", 1, 0, 0, (swig_guile_proc) _wrap_nlopt_opt_force_stop);
7682 scm_c_define_gsubr("nlopt-opt-set-local-optimizer", 2, 0, 0, (swig_guile_proc) _wrap_nlopt_opt_set_local_optimizer);
7683 scm_c_define_gsubr("nlopt-opt-get-population", 1, 0, 0, (swig_guile_proc) _wrap_nlopt_opt_get_population);
7684 scm_c_define_gsubr("nlopt-opt-set-population", 2, 0, 0, (swig_guile_proc) _wrap_nlopt_opt_set_population);
7685 scm_c_define_gsubr("nlopt-opt-get-vector-storage", 1, 0, 0, (swig_guile_proc) _wrap_nlopt_opt_get_vector_storage);
7686 scm_c_define_gsubr("nlopt-opt-set-vector-storage", 2, 0, 0, (swig_guile_proc) _wrap_nlopt_opt_set_vector_storage);
7687 scm_c_define_gsubr("nlopt-opt-set-initial-step", 0, 0, 1, (swig_guile_proc) _wrap_nlopt_opt_set_initial_step);
7688 scm_c_define_gsubr("nlopt-opt-set-default-initial-step", 2, 0, 0, (swig_guile_proc) _wrap_nlopt_opt_set_default_initial_step);
7689 scm_c_define_gsubr("nlopt-opt-get-initial-step", 0, 0, 1, (swig_guile_proc) _wrap_nlopt_opt_get_initial_step);
7690 scm_c_define_gsubr("nlopt-opt-get-initial-step-", 2, 0, 0, (swig_guile_proc) _wrap_nlopt_opt_get_initial_step_);
7691 scm_c_define_gsubr("nlopt-srand", 1, 0, 0, (swig_guile_proc) _wrap_nlopt_srand);
7692 scm_c_define_gsubr("nlopt-srand-time", 0, 0, 0, (swig_guile_proc) _wrap_nlopt_srand_time);
7693 scm_c_define_gsubr("nlopt-version", 3, 0, 0, (swig_guile_proc) _wrap_nlopt_version);
7694 scm_c_define_gsubr("nlopt-version-major", 0, 0, 0, (swig_guile_proc) _wrap_nlopt_version_major);
7695 scm_c_define_gsubr("nlopt-version-minor", 0, 0, 0, (swig_guile_proc) _wrap_nlopt_version_minor);
7696 scm_c_define_gsubr("nlopt-version-bugfix", 0, 0, 0, (swig_guile_proc) _wrap_nlopt_version_bugfix);
7697 scm_c_define_gsubr("nlopt-algorithm-name", 1, 0, 0, (swig_guile_proc) _wrap_nlopt_algorithm_name);
7704 /* Linkage: simple */