1 /* ----------------------------------------------------------------------------
2  * This file was automatically generated by SWIG (http://www.swig.org).
3  * Version 4.0.1
4  *
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  * ----------------------------------------------------------------------------- */
10 
11 
12 #ifndef SWIGPERL
13 #define SWIGPERL
14 #endif
15 
16 #define SWIG_CASTRANK_MODE
17 
18 /* -----------------------------------------------------------------------------
19  *  This section contains generic SWIG labels for method/variable
20  *  declarations/attributes, and other compiler dependent labels.
21  * ----------------------------------------------------------------------------- */
22 
23 /* template workaround for compilers that cannot correctly implement the C++ standard */
24 #ifndef SWIGTEMPLATEDISAMBIGUATOR
25 # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
26 #  define SWIGTEMPLATEDISAMBIGUATOR template
27 # elif defined(__HP_aCC)
28 /* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
29 /* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
30 #  define SWIGTEMPLATEDISAMBIGUATOR template
31 # else
32 #  define SWIGTEMPLATEDISAMBIGUATOR
33 # endif
34 #endif
35 
36 /* inline attribute */
37 #ifndef SWIGINLINE
38 # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
39 #   define SWIGINLINE inline
40 # else
41 #   define SWIGINLINE
42 # endif
43 #endif
44 
45 /* attribute recognised by some compilers to avoid 'unused' warnings */
46 #ifndef SWIGUNUSED
47 # if defined(__GNUC__)
48 #   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
49 #     define SWIGUNUSED __attribute__ ((__unused__))
50 #   else
51 #     define SWIGUNUSED
52 #   endif
53 # elif defined(__ICC)
54 #   define SWIGUNUSED __attribute__ ((__unused__))
55 # else
56 #   define SWIGUNUSED
57 # endif
58 #endif
59 
60 #ifndef SWIG_MSC_UNSUPPRESS_4505
61 # if defined(_MSC_VER)
62 #   pragma warning(disable : 4505) /* unreferenced local function has been removed */
63 # endif
64 #endif
65 
66 #ifndef SWIGUNUSEDPARM
67 # ifdef __cplusplus
68 #   define SWIGUNUSEDPARM(p)
69 # else
70 #   define SWIGUNUSEDPARM(p) p SWIGUNUSED
71 # endif
72 #endif
73 
74 /* internal SWIG method */
75 #ifndef SWIGINTERN
76 # define SWIGINTERN static SWIGUNUSED
77 #endif
78 
79 /* internal inline SWIG method */
80 #ifndef SWIGINTERNINLINE
81 # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
82 #endif
83 
84 /* exporting methods */
85 #if defined(__GNUC__)
86 #  if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
87 #    ifndef GCC_HASCLASSVISIBILITY
88 #      define GCC_HASCLASSVISIBILITY
89 #    endif
90 #  endif
91 #endif
92 
93 #ifndef SWIGEXPORT
94 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
95 #   if defined(STATIC_LINKED)
96 #     define SWIGEXPORT
97 #   else
98 #     define SWIGEXPORT __declspec(dllexport)
99 #   endif
100 # else
101 #   if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
102 #     define SWIGEXPORT __attribute__ ((visibility("default")))
103 #   else
104 #     define SWIGEXPORT
105 #   endif
106 # endif
107 #endif
108 
109 /* calling conventions for Windows */
110 #ifndef SWIGSTDCALL
111 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
112 #   define SWIGSTDCALL __stdcall
113 # else
114 #   define SWIGSTDCALL
115 # endif
116 #endif
117 
118 /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
119 #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
120 # define _CRT_SECURE_NO_DEPRECATE
121 #endif
122 
123 /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
124 #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
125 # define _SCL_SECURE_NO_DEPRECATE
126 #endif
127 
128 /* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */
129 #if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES)
130 # define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
131 #endif
132 
133 /* Intel's compiler complains if a variable which was never initialised is
134  * cast to void, which is a common idiom which we use to indicate that we
135  * are aware a variable isn't used.  So we just silence that warning.
136  * See: https://github.com/swig/swig/issues/192 for more discussion.
137  */
138 #ifdef __INTEL_COMPILER
139 # pragma warning disable 592
140 #endif
141 
142 /* -----------------------------------------------------------------------------
143  * swigrun.swg
144  *
145  * This file contains generic C API SWIG runtime support for pointer
146  * type checking.
147  * ----------------------------------------------------------------------------- */
148 
149 /* This should only be incremented when either the layout of swig_type_info changes,
150    or for whatever reason, the runtime changes incompatibly */
151 #define SWIG_RUNTIME_VERSION "4"
152 
153 /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
154 #ifdef SWIG_TYPE_TABLE
155 # define SWIG_QUOTE_STRING(x) #x
156 # define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
157 # define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
158 #else
159 # define SWIG_TYPE_TABLE_NAME
160 #endif
161 
162 /*
163   You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
164   creating a static or dynamic library from the SWIG runtime code.
165   In 99.9% of the cases, SWIG just needs to declare them as 'static'.
166 
167   But only do this if strictly necessary, ie, if you have problems
168   with your compiler or suchlike.
169 */
170 
171 #ifndef SWIGRUNTIME
172 # define SWIGRUNTIME SWIGINTERN
173 #endif
174 
175 #ifndef SWIGRUNTIMEINLINE
176 # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
177 #endif
178 
179 /*  Generic buffer size */
180 #ifndef SWIG_BUFFER_SIZE
181 # define SWIG_BUFFER_SIZE 1024
182 #endif
183 
184 /* Flags for pointer conversions */
185 #define SWIG_POINTER_DISOWN        0x1
186 #define SWIG_CAST_NEW_MEMORY       0x2
187 #define SWIG_POINTER_NO_NULL       0x4
188 
189 /* Flags for new pointer objects */
190 #define SWIG_POINTER_OWN           0x1
191 
192 
193 /*
194    Flags/methods for returning states.
195 
196    The SWIG conversion methods, as ConvertPtr, return an integer
197    that tells if the conversion was successful or not. And if not,
198    an error code can be returned (see swigerrors.swg for the codes).
199 
200    Use the following macros/flags to set or process the returning
201    states.
202 
203    In old versions of SWIG, code such as the following was usually written:
204 
205      if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
206        // success code
207      } else {
208        //fail code
209      }
210 
211    Now you can be more explicit:
212 
213     int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
214     if (SWIG_IsOK(res)) {
215       // success code
216     } else {
217       // fail code
218     }
219 
220    which is the same really, but now you can also do
221 
222     Type *ptr;
223     int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
224     if (SWIG_IsOK(res)) {
225       // success code
226       if (SWIG_IsNewObj(res) {
227         ...
228 	delete *ptr;
229       } else {
230         ...
231       }
232     } else {
233       // fail code
234     }
235 
236    I.e., now SWIG_ConvertPtr can return new objects and you can
237    identify the case and take care of the deallocation. Of course that
238    also requires SWIG_ConvertPtr to return new result values, such as
239 
240       int SWIG_ConvertPtr(obj, ptr,...) {
241         if (<obj is ok>) {
242           if (<need new object>) {
243             *ptr = <ptr to new allocated object>;
244             return SWIG_NEWOBJ;
245           } else {
246             *ptr = <ptr to old object>;
247             return SWIG_OLDOBJ;
248           }
249         } else {
250           return SWIG_BADOBJ;
251         }
252       }
253 
254    Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
255    more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
256    SWIG errors code.
257 
258    Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
259    allows to return the 'cast rank', for example, if you have this
260 
261        int food(double)
262        int fooi(int);
263 
264    and you call
265 
266       food(1)   // cast rank '1'  (1 -> 1.0)
267       fooi(1)   // cast rank '0'
268 
269    just use the SWIG_AddCast()/SWIG_CheckState()
270 */
271 
272 #define SWIG_OK                    (0)
273 #define SWIG_ERROR                 (-1)
274 #define SWIG_IsOK(r)               (r >= 0)
275 #define SWIG_ArgError(r)           ((r != SWIG_ERROR) ? r : SWIG_TypeError)
276 
277 /* The CastRankLimit says how many bits are used for the cast rank */
278 #define SWIG_CASTRANKLIMIT         (1 << 8)
279 /* The NewMask denotes the object was created (using new/malloc) */
280 #define SWIG_NEWOBJMASK            (SWIG_CASTRANKLIMIT  << 1)
281 /* The TmpMask is for in/out typemaps that use temporal objects */
282 #define SWIG_TMPOBJMASK            (SWIG_NEWOBJMASK << 1)
283 /* Simple returning values */
284 #define SWIG_BADOBJ                (SWIG_ERROR)
285 #define SWIG_OLDOBJ                (SWIG_OK)
286 #define SWIG_NEWOBJ                (SWIG_OK | SWIG_NEWOBJMASK)
287 #define SWIG_TMPOBJ                (SWIG_OK | SWIG_TMPOBJMASK)
288 /* Check, add and del mask methods */
289 #define SWIG_AddNewMask(r)         (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
290 #define SWIG_DelNewMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
291 #define SWIG_IsNewObj(r)           (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
292 #define SWIG_AddTmpMask(r)         (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
293 #define SWIG_DelTmpMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
294 #define SWIG_IsTmpObj(r)           (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
295 
296 /* Cast-Rank Mode */
297 #if defined(SWIG_CASTRANK_MODE)
298 #  ifndef SWIG_TypeRank
299 #    define SWIG_TypeRank             unsigned long
300 #  endif
301 #  ifndef SWIG_MAXCASTRANK            /* Default cast allowed */
302 #    define SWIG_MAXCASTRANK          (2)
303 #  endif
304 #  define SWIG_CASTRANKMASK          ((SWIG_CASTRANKLIMIT) -1)
305 #  define SWIG_CastRank(r)           (r & SWIG_CASTRANKMASK)
SWIG_AddCast(int r)306 SWIGINTERNINLINE int SWIG_AddCast(int r) {
307   return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
308 }
SWIG_CheckState(int r)309 SWIGINTERNINLINE int SWIG_CheckState(int r) {
310   return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
311 }
312 #else /* no cast-rank mode */
313 #  define SWIG_AddCast(r) (r)
314 #  define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
315 #endif
316 
317 
318 #include <string.h>
319 
320 #ifdef __cplusplus
321 extern "C" {
322 #endif
323 
324 typedef void *(*swig_converter_func)(void *, int *);
325 typedef struct swig_type_info *(*swig_dycast_func)(void **);
326 
327 /* Structure to store information on one type */
328 typedef struct swig_type_info {
329   const char             *name;			/* mangled name of this type */
330   const char             *str;			/* human readable name of this type */
331   swig_dycast_func        dcast;		/* dynamic cast function down a hierarchy */
332   struct swig_cast_info  *cast;			/* linked list of types that can cast into this type */
333   void                   *clientdata;		/* language specific type data */
334   int                    owndata;		/* flag if the structure owns the clientdata */
335 } swig_type_info;
336 
337 /* Structure to store a type and conversion function used for casting */
338 typedef struct swig_cast_info {
339   swig_type_info         *type;			/* pointer to type that is equivalent to this type */
340   swig_converter_func     converter;		/* function to cast the void pointers */
341   struct swig_cast_info  *next;			/* pointer to next cast in linked list */
342   struct swig_cast_info  *prev;			/* pointer to the previous cast */
343 } swig_cast_info;
344 
345 /* Structure used to store module information
346  * Each module generates one structure like this, and the runtime collects
347  * all of these structures and stores them in a circularly linked list.*/
348 typedef struct swig_module_info {
349   swig_type_info         **types;		/* Array of pointers to swig_type_info structures that are in this module */
350   size_t                 size;		        /* Number of types in this module */
351   struct swig_module_info *next;		/* Pointer to next element in circularly linked list */
352   swig_type_info         **type_initial;	/* Array of initially generated type structures */
353   swig_cast_info         **cast_initial;	/* Array of initially generated casting structures */
354   void                    *clientdata;		/* Language specific module data */
355 } swig_module_info;
356 
357 /*
358   Compare two type names skipping the space characters, therefore
359   "char*" == "char *" and "Class<int>" == "Class<int >", etc.
360 
361   Return 0 when the two name types are equivalent, as in
362   strncmp, but skipping ' '.
363 */
364 SWIGRUNTIME int
SWIG_TypeNameComp(const char * f1,const char * l1,const char * f2,const char * l2)365 SWIG_TypeNameComp(const char *f1, const char *l1,
366 		  const char *f2, const char *l2) {
367   for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
368     while ((*f1 == ' ') && (f1 != l1)) ++f1;
369     while ((*f2 == ' ') && (f2 != l2)) ++f2;
370     if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
371   }
372   return (int)((l1 - f1) - (l2 - f2));
373 }
374 
375 /*
376   Check type equivalence in a name list like <name1>|<name2>|...
377   Return 0 if equal, -1 if nb < tb, 1 if nb > tb
378 */
379 SWIGRUNTIME int
SWIG_TypeCmp(const char * nb,const char * tb)380 SWIG_TypeCmp(const char *nb, const char *tb) {
381   int equiv = 1;
382   const char* te = tb + strlen(tb);
383   const char* ne = nb;
384   while (equiv != 0 && *ne) {
385     for (nb = ne; *ne; ++ne) {
386       if (*ne == '|') break;
387     }
388     equiv = SWIG_TypeNameComp(nb, ne, tb, te);
389     if (*ne) ++ne;
390   }
391   return equiv;
392 }
393 
394 /*
395   Check type equivalence in a name list like <name1>|<name2>|...
396   Return 0 if not equal, 1 if equal
397 */
398 SWIGRUNTIME int
SWIG_TypeEquiv(const char * nb,const char * tb)399 SWIG_TypeEquiv(const char *nb, const char *tb) {
400   return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0;
401 }
402 
403 /*
404   Check the typename
405 */
406 SWIGRUNTIME swig_cast_info *
SWIG_TypeCheck(const char * c,swig_type_info * ty)407 SWIG_TypeCheck(const char *c, swig_type_info *ty) {
408   if (ty) {
409     swig_cast_info *iter = ty->cast;
410     while (iter) {
411       if (strcmp(iter->type->name, c) == 0) {
412         if (iter == ty->cast)
413           return iter;
414         /* Move iter to the top of the linked list */
415         iter->prev->next = iter->next;
416         if (iter->next)
417           iter->next->prev = iter->prev;
418         iter->next = ty->cast;
419         iter->prev = 0;
420         if (ty->cast) ty->cast->prev = iter;
421         ty->cast = iter;
422         return iter;
423       }
424       iter = iter->next;
425     }
426   }
427   return 0;
428 }
429 
430 /*
431   Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
432 */
433 SWIGRUNTIME swig_cast_info *
SWIG_TypeCheckStruct(swig_type_info * from,swig_type_info * ty)434 SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
435   if (ty) {
436     swig_cast_info *iter = ty->cast;
437     while (iter) {
438       if (iter->type == from) {
439         if (iter == ty->cast)
440           return iter;
441         /* Move iter to the top of the linked list */
442         iter->prev->next = iter->next;
443         if (iter->next)
444           iter->next->prev = iter->prev;
445         iter->next = ty->cast;
446         iter->prev = 0;
447         if (ty->cast) ty->cast->prev = iter;
448         ty->cast = iter;
449         return iter;
450       }
451       iter = iter->next;
452     }
453   }
454   return 0;
455 }
456 
457 /*
458   Cast a pointer up an inheritance hierarchy
459 */
460 SWIGRUNTIMEINLINE void *
SWIG_TypeCast(swig_cast_info * ty,void * ptr,int * newmemory)461 SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
462   return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
463 }
464 
465 /*
466    Dynamic pointer casting. Down an inheritance hierarchy
467 */
468 SWIGRUNTIME swig_type_info *
SWIG_TypeDynamicCast(swig_type_info * ty,void ** ptr)469 SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
470   swig_type_info *lastty = ty;
471   if (!ty || !ty->dcast) return ty;
472   while (ty && (ty->dcast)) {
473     ty = (*ty->dcast)(ptr);
474     if (ty) lastty = ty;
475   }
476   return lastty;
477 }
478 
479 /*
480   Return the name associated with this type
481 */
482 SWIGRUNTIMEINLINE const char *
SWIG_TypeName(const swig_type_info * ty)483 SWIG_TypeName(const swig_type_info *ty) {
484   return ty->name;
485 }
486 
487 /*
488   Return the pretty name associated with this type,
489   that is an unmangled type name in a form presentable to the user.
490 */
491 SWIGRUNTIME const char *
SWIG_TypePrettyName(const swig_type_info * type)492 SWIG_TypePrettyName(const swig_type_info *type) {
493   /* The "str" field contains the equivalent pretty names of the
494      type, separated by vertical-bar characters.  We choose
495      to print the last name, as it is often (?) the most
496      specific. */
497   if (!type) return NULL;
498   if (type->str != NULL) {
499     const char *last_name = type->str;
500     const char *s;
501     for (s = type->str; *s; s++)
502       if (*s == '|') last_name = s+1;
503     return last_name;
504   }
505   else
506     return type->name;
507 }
508 
509 /*
510    Set the clientdata field for a type
511 */
512 SWIGRUNTIME void
SWIG_TypeClientData(swig_type_info * ti,void * clientdata)513 SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
514   swig_cast_info *cast = ti->cast;
515   /* if (ti->clientdata == clientdata) return; */
516   ti->clientdata = clientdata;
517 
518   while (cast) {
519     if (!cast->converter) {
520       swig_type_info *tc = cast->type;
521       if (!tc->clientdata) {
522 	SWIG_TypeClientData(tc, clientdata);
523       }
524     }
525     cast = cast->next;
526   }
527 }
528 SWIGRUNTIME void
SWIG_TypeNewClientData(swig_type_info * ti,void * clientdata)529 SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
530   SWIG_TypeClientData(ti, clientdata);
531   ti->owndata = 1;
532 }
533 
534 /*
535   Search for a swig_type_info structure only by mangled name
536   Search is a O(log #types)
537 
538   We start searching at module start, and finish searching when start == end.
539   Note: if start == end at the beginning of the function, we go all the way around
540   the circular list.
541 */
542 SWIGRUNTIME swig_type_info *
SWIG_MangledTypeQueryModule(swig_module_info * start,swig_module_info * end,const char * name)543 SWIG_MangledTypeQueryModule(swig_module_info *start,
544                             swig_module_info *end,
545 		            const char *name) {
546   swig_module_info *iter = start;
547   do {
548     if (iter->size) {
549       size_t l = 0;
550       size_t r = iter->size - 1;
551       do {
552 	/* since l+r >= 0, we can (>> 1) instead (/ 2) */
553 	size_t i = (l + r) >> 1;
554 	const char *iname = iter->types[i]->name;
555 	if (iname) {
556 	  int compare = strcmp(name, iname);
557 	  if (compare == 0) {
558 	    return iter->types[i];
559 	  } else if (compare < 0) {
560 	    if (i) {
561 	      r = i - 1;
562 	    } else {
563 	      break;
564 	    }
565 	  } else if (compare > 0) {
566 	    l = i + 1;
567 	  }
568 	} else {
569 	  break; /* should never happen */
570 	}
571       } while (l <= r);
572     }
573     iter = iter->next;
574   } while (iter != end);
575   return 0;
576 }
577 
578 /*
579   Search for a swig_type_info structure for either a mangled name or a human readable name.
580   It first searches the mangled names of the types, which is a O(log #types)
581   If a type is not found it then searches the human readable names, which is O(#types).
582 
583   We start searching at module start, and finish searching when start == end.
584   Note: if start == end at the beginning of the function, we go all the way around
585   the circular list.
586 */
587 SWIGRUNTIME swig_type_info *
SWIG_TypeQueryModule(swig_module_info * start,swig_module_info * end,const char * name)588 SWIG_TypeQueryModule(swig_module_info *start,
589                      swig_module_info *end,
590 		     const char *name) {
591   /* STEP 1: Search the name field using binary search */
592   swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
593   if (ret) {
594     return ret;
595   } else {
596     /* STEP 2: If the type hasn't been found, do a complete search
597        of the str field (the human readable name) */
598     swig_module_info *iter = start;
599     do {
600       size_t i = 0;
601       for (; i < iter->size; ++i) {
602 	if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
603 	  return iter->types[i];
604       }
605       iter = iter->next;
606     } while (iter != end);
607   }
608 
609   /* neither found a match */
610   return 0;
611 }
612 
613 /*
614    Pack binary data into a string
615 */
616 SWIGRUNTIME char *
SWIG_PackData(char * c,void * ptr,size_t sz)617 SWIG_PackData(char *c, void *ptr, size_t sz) {
618   static const char hex[17] = "0123456789abcdef";
619   const unsigned char *u = (unsigned char *) ptr;
620   const unsigned char *eu =  u + sz;
621   for (; u != eu; ++u) {
622     unsigned char uu = *u;
623     *(c++) = hex[(uu & 0xf0) >> 4];
624     *(c++) = hex[uu & 0xf];
625   }
626   return c;
627 }
628 
629 /*
630    Unpack binary data from a string
631 */
632 SWIGRUNTIME const char *
SWIG_UnpackData(const char * c,void * ptr,size_t sz)633 SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
634   unsigned char *u = (unsigned char *) ptr;
635   const unsigned char *eu = u + sz;
636   for (; u != eu; ++u) {
637     char d = *(c++);
638     unsigned char uu;
639     if ((d >= '0') && (d <= '9'))
640       uu = (unsigned char)((d - '0') << 4);
641     else if ((d >= 'a') && (d <= 'f'))
642       uu = (unsigned char)((d - ('a'-10)) << 4);
643     else
644       return (char *) 0;
645     d = *(c++);
646     if ((d >= '0') && (d <= '9'))
647       uu |= (unsigned char)(d - '0');
648     else if ((d >= 'a') && (d <= 'f'))
649       uu |= (unsigned char)(d - ('a'-10));
650     else
651       return (char *) 0;
652     *u = uu;
653   }
654   return c;
655 }
656 
657 /*
658    Pack 'void *' into a string buffer.
659 */
660 SWIGRUNTIME char *
SWIG_PackVoidPtr(char * buff,void * ptr,const char * name,size_t bsz)661 SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
662   char *r = buff;
663   if ((2*sizeof(void *) + 2) > bsz) return 0;
664   *(r++) = '_';
665   r = SWIG_PackData(r,&ptr,sizeof(void *));
666   if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
667   strcpy(r,name);
668   return buff;
669 }
670 
671 SWIGRUNTIME const char *
SWIG_UnpackVoidPtr(const char * c,void ** ptr,const char * name)672 SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
673   if (*c != '_') {
674     if (strcmp(c,"NULL") == 0) {
675       *ptr = (void *) 0;
676       return name;
677     } else {
678       return 0;
679     }
680   }
681   return SWIG_UnpackData(++c,ptr,sizeof(void *));
682 }
683 
684 SWIGRUNTIME char *
SWIG_PackDataName(char * buff,void * ptr,size_t sz,const char * name,size_t bsz)685 SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
686   char *r = buff;
687   size_t lname = (name ? strlen(name) : 0);
688   if ((2*sz + 2 + lname) > bsz) return 0;
689   *(r++) = '_';
690   r = SWIG_PackData(r,ptr,sz);
691   if (lname) {
692     strncpy(r,name,lname+1);
693   } else {
694     *r = 0;
695   }
696   return buff;
697 }
698 
699 SWIGRUNTIME const char *
SWIG_UnpackDataName(const char * c,void * ptr,size_t sz,const char * name)700 SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
701   if (*c != '_') {
702     if (strcmp(c,"NULL") == 0) {
703       memset(ptr,0,sz);
704       return name;
705     } else {
706       return 0;
707     }
708   }
709   return SWIG_UnpackData(++c,ptr,sz);
710 }
711 
712 #ifdef __cplusplus
713 }
714 #endif
715 
716 /*  Errors in SWIG */
717 #define  SWIG_UnknownError    	   -1
718 #define  SWIG_IOError        	   -2
719 #define  SWIG_RuntimeError   	   -3
720 #define  SWIG_IndexError     	   -4
721 #define  SWIG_TypeError      	   -5
722 #define  SWIG_DivisionByZero 	   -6
723 #define  SWIG_OverflowError  	   -7
724 #define  SWIG_SyntaxError    	   -8
725 #define  SWIG_ValueError     	   -9
726 #define  SWIG_SystemError    	   -10
727 #define  SWIG_AttributeError 	   -11
728 #define  SWIG_MemoryError    	   -12
729 #define  SWIG_NullReferenceError   -13
730 
731 
732 
733 #ifdef __cplusplus
734 /* Needed on some windows machines---since MS plays funny games with the header files under C++ */
735 #include <math.h>
736 #include <stdlib.h>
737 extern "C" {
738 #endif
739 #include "EXTERN.h"
740 #include "perl.h"
741 #include "XSUB.h"
742 
743 /* Add in functionality missing in older versions of Perl. Much of this is based on Devel-PPPort on cpan. */
744 
745 /* Add PERL_REVISION, PERL_VERSION, PERL_SUBVERSION if missing */
746 #ifndef PERL_REVISION
747 #  if !defined(__PATCHLEVEL_H_INCLUDED__) && !(defined(PATCHLEVEL) && defined(SUBVERSION))
748 #    define PERL_PATCHLEVEL_H_IMPLICIT
749 #    include <patchlevel.h>
750 #  endif
751 #  if !(defined(PERL_VERSION) || (defined(SUBVERSION) && defined(PATCHLEVEL)))
752 #    include <could_not_find_Perl_patchlevel.h>
753 #  endif
754 #  ifndef PERL_REVISION
755 #    define PERL_REVISION       (5)
756 #    define PERL_VERSION        PATCHLEVEL
757 #    define PERL_SUBVERSION     SUBVERSION
758 #  endif
759 #endif
760 
761 #if defined(WIN32) && defined(PERL_OBJECT) && !defined(PerlIO_exportFILE)
762 #define PerlIO_exportFILE(fh,fl) (FILE*)(fh)
763 #endif
764 
765 #ifndef SvIOK_UV
766 # define SvIOK_UV(sv)       (SvIOK(sv) && (SvUVX(sv) == SvIVX(sv)))
767 #endif
768 
769 #ifndef SvUOK
770 # define SvUOK(sv)           SvIOK_UV(sv)
771 #endif
772 
773 #if ((PERL_VERSION < 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION <= 5)))
774 #  define PL_sv_undef               sv_undef
775 #  define PL_na	                    na
776 #  define PL_errgv                  errgv
777 #  define PL_sv_no                  sv_no
778 #  define PL_sv_yes                 sv_yes
779 #  define PL_markstack_ptr          markstack_ptr
780 #endif
781 
782 #ifndef IVSIZE
783 #  ifdef LONGSIZE
784 #    define IVSIZE LONGSIZE
785 #  else
786 #    define IVSIZE 4 /* A bold guess, but the best we can make. */
787 #  endif
788 #endif
789 
790 #ifndef INT2PTR
791 #  if (IVSIZE == PTRSIZE) && (UVSIZE == PTRSIZE)
792 #    define PTRV                  UV
793 #    define INT2PTR(any,d)        (any)(d)
794 #  else
795 #    if PTRSIZE == LONGSIZE
796 #      define PTRV                unsigned long
797 #    else
798 #      define PTRV                unsigned
799 #    endif
800 #    define INT2PTR(any,d)        (any)(PTRV)(d)
801 #  endif
802 
803 #  define NUM2PTR(any,d)  (any)(PTRV)(d)
804 #  define PTR2IV(p)       INT2PTR(IV,p)
805 #  define PTR2UV(p)       INT2PTR(UV,p)
806 #  define PTR2NV(p)       NUM2PTR(NV,p)
807 
808 #  if PTRSIZE == LONGSIZE
809 #    define PTR2ul(p)     (unsigned long)(p)
810 #  else
811 #    define PTR2ul(p)     INT2PTR(unsigned long,p)
812 #  endif
813 #endif /* !INT2PTR */
814 
815 #ifndef SvPV_nolen
816 # define SvPV_nolen(x) SvPV(x,PL_na)
817 #endif
818 
819 #ifndef get_sv
820 #  define get_sv perl_get_sv
821 #endif
822 
823 #ifndef ERRSV
824 #  define ERRSV get_sv("@",FALSE)
825 #endif
826 
827 #ifndef pTHX_
828 #define pTHX_
829 #endif
830 
831 #include <string.h>
832 #ifdef __cplusplus
833 }
834 #endif
835 
836 /* -----------------------------------------------------------------------------
837  * error manipulation
838  * ----------------------------------------------------------------------------- */
839 
840 SWIGINTERN const char*
SWIG_Perl_ErrorType(int code)841 SWIG_Perl_ErrorType(int code) {
842   switch(code) {
843   case SWIG_MemoryError:
844     return "MemoryError";
845   case SWIG_IOError:
846     return "IOError";
847   case SWIG_RuntimeError:
848     return "RuntimeError";
849   case SWIG_IndexError:
850     return "IndexError";
851   case SWIG_TypeError:
852     return "TypeError";
853   case SWIG_DivisionByZero:
854     return "ZeroDivisionError";
855   case SWIG_OverflowError:
856     return "OverflowError";
857   case SWIG_SyntaxError:
858     return "SyntaxError";
859   case SWIG_ValueError:
860     return "ValueError";
861   case SWIG_SystemError:
862     return "SystemError";
863   case SWIG_AttributeError:
864     return "AttributeError";
865   default:
866     return "RuntimeError";
867   }
868 }
869 
870 
871 /* -----------------------------------------------------------------------------
872  * perlrun.swg
873  *
874  * This file contains the runtime support for Perl modules
875  * and includes code for managing global variables and pointer
876  * type checking.
877  * ----------------------------------------------------------------------------- */
878 
879 #ifdef PERL_OBJECT
880 #define SWIG_PERL_OBJECT_DECL CPerlObj *SWIGUNUSEDPARM(pPerl),
881 #define SWIG_PERL_OBJECT_CALL pPerl,
882 #else
883 #define SWIG_PERL_OBJECT_DECL
884 #define SWIG_PERL_OBJECT_CALL
885 #endif
886 
887 /* Common SWIG API */
888 
889 /* for raw pointers */
890 #define SWIG_ConvertPtr(obj, pp, type, flags)           SWIG_Perl_ConvertPtr(SWIG_PERL_OBJECT_CALL obj, pp, type, flags)
891 #define SWIG_ConvertPtrAndOwn(obj, pp, type, flags,own) SWIG_Perl_ConvertPtrAndOwn(SWIG_PERL_OBJECT_CALL obj, pp, type, flags, own)
892 #define SWIG_NewPointerObj(p, type, flags)              SWIG_Perl_NewPointerObj(SWIG_PERL_OBJECT_CALL p, type, flags)
893 #define SWIG_AcquirePtr(ptr, src)                       SWIG_Perl_AcquirePtr(ptr, src)
894 #define swig_owntype                                    int
895 
896 /* for raw packed data */
897 #define SWIG_ConvertPacked(obj, p, s, type)             SWIG_Perl_ConvertPacked(SWIG_PERL_OBJECT_CALL obj, p, s, type)
898 #define SWIG_NewPackedObj(p, s, type)	                SWIG_Perl_NewPackedObj(SWIG_PERL_OBJECT_CALL p, s, type)
899 
900 /* for class or struct pointers */
901 #define SWIG_ConvertInstance(obj, pptr, type, flags)    SWIG_ConvertPtr(obj, pptr, type, flags)
902 #define SWIG_NewInstanceObj(ptr, type, flags)           SWIG_NewPointerObj(ptr, type, flags)
903 
904 /* for C or C++ function pointers */
905 #define SWIG_ConvertFunctionPtr(obj, pptr, type)        SWIG_ConvertPtr(obj, pptr, type, 0)
906 #define SWIG_NewFunctionPtrObj(ptr, type)               SWIG_NewPointerObj(ptr, type, 0)
907 
908 /* for C++ member pointers, ie, member methods */
909 #define SWIG_ConvertMember(obj, ptr, sz, ty)            SWIG_ConvertPacked(obj, ptr, sz, ty)
910 #define SWIG_NewMemberObj(ptr, sz, type)                SWIG_NewPackedObj(ptr, sz, type)
911 
912 
913 /* Runtime API */
914 
915 #define SWIG_GetModule(clientdata)                      SWIG_Perl_GetModule(clientdata)
916 #define SWIG_SetModule(clientdata, pointer)             SWIG_Perl_SetModule(pointer)
917 
918 
919 /* Error manipulation */
920 
921 #define SWIG_ErrorType(code)                            SWIG_Perl_ErrorType(code)
922 #define SWIG_Error(code, msg)            		sv_setpvf(get_sv("@", GV_ADD), "%s %s", SWIG_ErrorType(code), msg)
923 #define SWIG_fail                        		goto fail
924 
925 /* Perl-specific SWIG API */
926 
927 #define SWIG_MakePtr(sv, ptr, type, flags)              SWIG_Perl_MakePtr(SWIG_PERL_OBJECT_CALL sv, ptr, type, flags)
928 #define SWIG_MakePackedObj(sv, p, s, type)	        SWIG_Perl_MakePackedObj(SWIG_PERL_OBJECT_CALL sv, p, s, type)
929 #define SWIG_SetError(str)                              SWIG_Error(SWIG_RuntimeError, str)
930 
931 
932 #define SWIG_PERL_DECL_ARGS_1(arg1)                     (SWIG_PERL_OBJECT_DECL arg1)
933 #define SWIG_PERL_CALL_ARGS_1(arg1)                     (SWIG_PERL_OBJECT_CALL arg1)
934 #define SWIG_PERL_DECL_ARGS_2(arg1, arg2)               (SWIG_PERL_OBJECT_DECL arg1, arg2)
935 #define SWIG_PERL_CALL_ARGS_2(arg1, arg2)               (SWIG_PERL_OBJECT_CALL arg1, arg2)
936 
937 /* -----------------------------------------------------------------------------
938  * pointers/data manipulation
939  * ----------------------------------------------------------------------------- */
940 
941 /* For backward compatibility only */
942 #define SWIG_POINTER_EXCEPTION  0
943 
944 #ifdef __cplusplus
945 extern "C" {
946 #endif
947 
948 #define SWIG_OWNER   SWIG_POINTER_OWN
949 #define SWIG_SHADOW  SWIG_OWNER << 1
950 
951 #define SWIG_MAYBE_PERL_OBJECT SWIG_PERL_OBJECT_DECL
952 
953 /* SWIG Perl macros */
954 
955 /* Macro to declare an XS function */
956 #ifndef XSPROTO
957 #   define XSPROTO(name) void name(pTHX_ CV* cv)
958 #endif
959 
960 /* Macro to call an XS function */
961 #ifdef PERL_OBJECT
962 #  define SWIG_CALLXS(_name) _name(cv,pPerl)
963 #else
964 #  ifndef MULTIPLICITY
965 #    define SWIG_CALLXS(_name) _name(cv)
966 #  else
967 #    define SWIG_CALLXS(_name) _name(PERL_GET_THX, cv)
968 #  endif
969 #endif
970 
971 #ifdef PERL_OBJECT
972 #define MAGIC_PPERL  CPerlObj *pPerl = (CPerlObj *) this;
973 
974 #ifdef __cplusplus
975 extern "C" {
976 #endif
977 typedef int (CPerlObj::*SwigMagicFunc)(SV *, MAGIC *);
978 #ifdef __cplusplus
979 }
980 #endif
981 
982 #define SWIG_MAGIC(a,b) (SV *a, MAGIC *b)
983 #define SWIGCLASS_STATIC
984 
985 #else /* PERL_OBJECT */
986 
987 #define MAGIC_PPERL
988 #define SWIGCLASS_STATIC static SWIGUNUSED
989 
990 #ifndef MULTIPLICITY
991 #define SWIG_MAGIC(a,b) (SV *a, MAGIC *b)
992 
993 #ifdef __cplusplus
994 extern "C" {
995 #endif
996 typedef int (*SwigMagicFunc)(SV *, MAGIC *);
997 #ifdef __cplusplus
998 }
999 #endif
1000 
1001 #else /* MULTIPLICITY */
1002 
1003 #define SWIG_MAGIC(a,b) (struct interpreter *interp, SV *a, MAGIC *b)
1004 
1005 #ifdef __cplusplus
1006 extern "C" {
1007 #endif
1008 typedef int (*SwigMagicFunc)(struct interpreter *, SV *, MAGIC *);
1009 #ifdef __cplusplus
1010 }
1011 #endif
1012 
1013 #endif /* MULTIPLICITY */
1014 #endif /* PERL_OBJECT */
1015 
1016 #  ifdef PERL_OBJECT
1017 #    define SWIG_croak_null() SWIG_Perl_croak_null(pPerl)
SWIG_Perl_croak_null(CPerlObj * pPerl)1018 static void SWIGUNUSED SWIG_Perl_croak_null(CPerlObj *pPerl)
1019 #  else
1020 static void SWIGUNUSED SWIG_croak_null()
1021 #  endif
1022 {
1023   SV *err = get_sv("@", GV_ADD);
1024 #  if (PERL_VERSION < 6)
1025   croak("%_", err);
1026 #  else
1027   if (sv_isobject(err))
1028     croak(0);
1029   else
1030     croak("%s", SvPV_nolen(err));
1031 #  endif
1032 }
1033 
1034 
1035 /*
1036    Define how strict is the cast between strings and integers/doubles
1037    when overloading between these types occurs.
1038 
1039    The default is making it as strict as possible by using SWIG_AddCast
1040    when needed.
1041 
1042    You can use -DSWIG_PERL_NO_STRICT_STR2NUM at compilation time to
1043    disable the SWIG_AddCast, making the casting between string and
1044    numbers less strict.
1045 
1046    In the end, we try to solve the overloading between strings and
1047    numerical types in the more natural way, but if you can avoid it,
1048    well, avoid it using %rename, for example.
1049 */
1050 #ifndef SWIG_PERL_NO_STRICT_STR2NUM
1051 # ifndef SWIG_PERL_STRICT_STR2NUM
1052 #  define SWIG_PERL_STRICT_STR2NUM
1053 # endif
1054 #endif
1055 #ifdef SWIG_PERL_STRICT_STR2NUM
1056 /* string takes precedence */
1057 #define SWIG_Str2NumCast(x) SWIG_AddCast(x)
1058 #else
1059 /* number takes precedence */
1060 #define SWIG_Str2NumCast(x) x
1061 #endif
1062 
1063 
1064 
1065 #include <stdlib.h>
1066 
1067 SWIGRUNTIME const char *
SWIG_Perl_TypeProxyName(const swig_type_info * type)1068 SWIG_Perl_TypeProxyName(const swig_type_info *type) {
1069   if (!type) return NULL;
1070   if (type->clientdata != NULL) {
1071     return (const char*) type->clientdata;
1072   }
1073   else {
1074     return type->name;
1075   }
1076 }
1077 
1078 /* Identical to SWIG_TypeCheck, except for strcmp comparison */
1079 SWIGRUNTIME swig_cast_info *
SWIG_TypeProxyCheck(const char * c,swig_type_info * ty)1080 SWIG_TypeProxyCheck(const char *c, swig_type_info *ty) {
1081   if (ty) {
1082     swig_cast_info *iter = ty->cast;
1083     while (iter) {
1084       if (strcmp(SWIG_Perl_TypeProxyName(iter->type), c) == 0) {
1085         if (iter == ty->cast)
1086           return iter;
1087         /* Move iter to the top of the linked list */
1088         iter->prev->next = iter->next;
1089         if (iter->next)
1090           iter->next->prev = iter->prev;
1091         iter->next = ty->cast;
1092         iter->prev = 0;
1093         if (ty->cast) ty->cast->prev = iter;
1094         ty->cast = iter;
1095         return iter;
1096       }
1097       iter = iter->next;
1098     }
1099   }
1100   return 0;
1101 }
1102 
1103 /* Acquire a pointer value */
1104 
1105 SWIGRUNTIME int
SWIG_Perl_AcquirePtr(SWIG_MAYBE_PERL_OBJECT SV * sv,int own)1106 SWIG_Perl_AcquirePtr(SWIG_MAYBE_PERL_OBJECT SV *sv, int own) {
1107   /* TODO */
1108   return 0;
1109 }
1110 
1111 /* Function for getting a pointer value */
1112 
1113 SWIGRUNTIME int
SWIG_Perl_ConvertPtrAndOwn(SWIG_MAYBE_PERL_OBJECT SV * sv,void ** ptr,swig_type_info * _t,int flags,int * own)1114 SWIG_Perl_ConvertPtrAndOwn(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *_t, int flags, int *own) {
1115   swig_cast_info *tc;
1116   void *voidptr = (void *)0;
1117   SV *tsv = 0;
1118 
1119   if (own)
1120     *own = 0;
1121 
1122   /* If magical, apply more magic */
1123   if (SvGMAGICAL(sv))
1124     mg_get(sv);
1125 
1126   /* Check to see if this is an object */
1127   if (sv_isobject(sv)) {
1128     IV tmp = 0;
1129     tsv = (SV*) SvRV(sv);
1130     if ((SvTYPE(tsv) == SVt_PVHV)) {
1131       MAGIC *mg;
1132       if (SvMAGICAL(tsv)) {
1133         mg = mg_find(tsv,'P');
1134         if (mg) {
1135           sv = mg->mg_obj;
1136           if (sv_isobject(sv)) {
1137 	    tsv = (SV*)SvRV(sv);
1138             tmp = SvIV(tsv);
1139           }
1140         }
1141       } else {
1142         return SWIG_ERROR;
1143       }
1144     } else {
1145       tmp = SvIV(tsv);
1146     }
1147     voidptr = INT2PTR(void *,tmp);
1148   } else if (! SvOK(sv)) {            /* Check for undef */
1149     *(ptr) = (void *) 0;
1150     return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK;
1151   } else if (SvTYPE(sv) == SVt_RV) {  /* Check for NULL pointer */
1152     if (!SvROK(sv)) {
1153       /* In Perl 5.12 and later, SVt_RV == SVt_IV, so sv could be a valid integer value.  */
1154       if (SvIOK(sv)) {
1155         return SWIG_ERROR;
1156       } else {
1157         /* NULL pointer (reference to undef). */
1158         *(ptr) = (void *) 0;
1159         return SWIG_OK;
1160       }
1161     } else {
1162       return SWIG_ERROR;
1163     }
1164   } else {                            /* Don't know what it is */
1165     return SWIG_ERROR;
1166   }
1167   if (_t) {
1168     /* Now see if the types match */
1169     char *_c = HvNAME(SvSTASH(SvRV(sv)));
1170     tc = SWIG_TypeProxyCheck(_c,_t);
1171 #ifdef SWIG_DIRECTORS
1172     if (!tc && !sv_derived_from(sv,SWIG_Perl_TypeProxyName(_t))) {
1173 #else
1174     if (!tc) {
1175 #endif
1176       return SWIG_ERROR;
1177     }
1178     {
1179       int newmemory = 0;
1180       *ptr = SWIG_TypeCast(tc,voidptr,&newmemory);
1181       if (newmemory == SWIG_CAST_NEW_MEMORY) {
1182         assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */
1183         if (own)
1184           *own = *own | SWIG_CAST_NEW_MEMORY;
1185       }
1186     }
1187   } else {
1188     *ptr = voidptr;
1189   }
1190 
1191   /*
1192    *  DISOWN implementation: we need a perl guru to check this one.
1193    */
1194   if (tsv && (flags & SWIG_POINTER_DISOWN)) {
1195     /*
1196      *  almost copy paste code from below SWIG_POINTER_OWN setting
1197      */
1198     SV *obj = sv;
1199     HV *stash = SvSTASH(SvRV(obj));
1200     GV *gv = *(GV**)hv_fetch(stash, "OWNER", 5, TRUE);
1201     if (isGV(gv)) {
1202       HV *hv = GvHVn(gv);
1203       /*
1204        * To set ownership (see below), a newSViv(1) entry is added.
1205        * Hence, to remove ownership, we delete the entry.
1206        */
1207       if (hv_exists_ent(hv, obj, 0)) {
1208 	hv_delete_ent(hv, obj, 0, 0);
1209       }
1210     }
1211   }
1212   return SWIG_OK;
1213 }
1214 
1215 SWIGRUNTIME int
1216 SWIG_Perl_ConvertPtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *_t, int flags) {
1217   return SWIG_Perl_ConvertPtrAndOwn(sv, ptr, _t, flags, 0);
1218 }
1219 
1220 SWIGRUNTIME void
1221 SWIG_Perl_MakePtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, swig_type_info *t, int flags) {
1222   if (ptr && (flags & (SWIG_SHADOW | SWIG_POINTER_OWN))) {
1223     SV *self;
1224     SV *obj=newSV(0);
1225     HV *hash=newHV();
1226     HV *stash;
1227     sv_setref_pv(obj, SWIG_Perl_TypeProxyName(t), ptr);
1228     stash=SvSTASH(SvRV(obj));
1229     if (flags & SWIG_POINTER_OWN) {
1230       HV *hv;
1231       GV *gv = *(GV**)hv_fetch(stash, "OWNER", 5, TRUE);
1232       if (!isGV(gv))
1233         gv_init(gv, stash, "OWNER", 5, FALSE);
1234       hv=GvHVn(gv);
1235       hv_store_ent(hv, obj, newSViv(1), 0);
1236     }
1237     sv_magic((SV *)hash, (SV *)obj, 'P', Nullch, 0);
1238     SvREFCNT_dec(obj);
1239     self=newRV_noinc((SV *)hash);
1240     sv_setsv(sv, self);
1241     SvREFCNT_dec((SV *)self);
1242     sv_bless(sv, stash);
1243   }
1244   else {
1245     sv_setref_pv(sv, SWIG_Perl_TypeProxyName(t), ptr);
1246   }
1247 }
1248 
1249 SWIGRUNTIMEINLINE SV *
1250 SWIG_Perl_NewPointerObj(SWIG_MAYBE_PERL_OBJECT void *ptr, swig_type_info *t, int flags) {
1251   SV *result = sv_newmortal();
1252   SWIG_MakePtr(result, ptr, t, flags);
1253   return result;
1254 }
1255 
1256 SWIGRUNTIME void
1257 SWIG_Perl_MakePackedObj(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, int sz, swig_type_info *type) {
1258   char result[1024];
1259   char *r = result;
1260   if ((2*sz + 1 + strlen(SWIG_Perl_TypeProxyName(type))) > 1000) return;
1261   *(r++) = '_';
1262   r = SWIG_PackData(r,ptr,sz);
1263   strcpy(r,SWIG_Perl_TypeProxyName(type));
1264   sv_setpv(sv, result);
1265 }
1266 
1267 SWIGRUNTIME SV *
1268 SWIG_Perl_NewPackedObj(SWIG_MAYBE_PERL_OBJECT void *ptr, int sz, swig_type_info *type) {
1269   SV *result = sv_newmortal();
1270   SWIG_Perl_MakePackedObj(result, ptr, sz, type);
1271   return result;
1272 }
1273 
1274 /* Convert a packed pointer value */
1275 SWIGRUNTIME int
1276 SWIG_Perl_ConvertPacked(SWIG_MAYBE_PERL_OBJECT SV *obj, void *ptr, int sz, swig_type_info *ty) {
1277   swig_cast_info *tc;
1278   const char  *c = 0;
1279 
1280   if ((!obj) || (!SvOK(obj))) return SWIG_ERROR;
1281   c = SvPV_nolen(obj);
1282   /* Pointer values must start with leading underscore */
1283   if (*c != '_') return SWIG_ERROR;
1284   c++;
1285   c = SWIG_UnpackData(c,ptr,sz);
1286   if (ty) {
1287     tc = SWIG_TypeCheck(c,ty);
1288     if (!tc) return SWIG_ERROR;
1289   }
1290   return SWIG_OK;
1291 }
1292 
1293 
1294 /* Macros for low-level exception handling */
1295 #define SWIG_croak(x)    { SWIG_Error(SWIG_RuntimeError, x); SWIG_fail; }
1296 
1297 
1298 typedef XSPROTO(SwigPerlWrapper);
1299 typedef SwigPerlWrapper *SwigPerlWrapperPtr;
1300 
1301 /* Structure for command table */
1302 typedef struct {
1303   const char         *name;
1304   SwigPerlWrapperPtr  wrapper;
1305 } swig_command_info;
1306 
1307 /* Information for constant table */
1308 
1309 #define SWIG_INT     1
1310 #define SWIG_FLOAT   2
1311 #define SWIG_STRING  3
1312 #define SWIG_POINTER 4
1313 #define SWIG_BINARY  5
1314 
1315 /* Constant information structure */
1316 typedef struct swig_constant_info {
1317     int              type;
1318     const char      *name;
1319     long             lvalue;
1320     double           dvalue;
1321     void            *pvalue;
1322     swig_type_info **ptype;
1323 } swig_constant_info;
1324 
1325 
1326 /* Structure for variable table */
1327 typedef struct {
1328   const char   *name;
1329   SwigMagicFunc   set;
1330   SwigMagicFunc   get;
1331   swig_type_info  **type;
1332 } swig_variable_info;
1333 
1334 /* Magic variable code */
1335 #ifndef PERL_OBJECT
1336 # ifdef __cplusplus
1337 #  define swig_create_magic(s,a,b,c) _swig_create_magic(s,const_cast<char*>(a),b,c)
1338 # else
1339 #  define swig_create_magic(s,a,b,c) _swig_create_magic(s,(char*)(a),b,c)
1340 # endif
1341 # ifndef MULTIPLICITY
1342 SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(SV *, MAGIC *), int (*get)(SV *,MAGIC *))
1343 # else
1344 SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(struct interpreter*, SV *, MAGIC *), int (*get)(struct interpreter*, SV *,MAGIC *))
1345 # endif
1346 #else
1347 #  define swig_create_magic(s,a,b,c) _swig_create_magic(pPerl,s,a,b,c)
1348 SWIGRUNTIME void _swig_create_magic(CPerlObj *pPerl, SV *sv, const char *name, int (CPerlObj::*set)(SV *, MAGIC *), int (CPerlObj::*get)(SV *, MAGIC *))
1349 #endif
1350 {
1351   MAGIC *mg;
1352   sv_magic(sv,sv,'U',name,strlen(name));
1353   mg = mg_find(sv,'U');
1354   mg->mg_virtual = (MGVTBL *) malloc(sizeof(MGVTBL));
1355   mg->mg_virtual->svt_get = (SwigMagicFunc) get;
1356   mg->mg_virtual->svt_set = (SwigMagicFunc) set;
1357   mg->mg_virtual->svt_len = 0;
1358   mg->mg_virtual->svt_clear = 0;
1359   mg->mg_virtual->svt_free = 0;
1360 }
1361 
1362 
1363 SWIGRUNTIME swig_module_info *
1364 SWIG_Perl_GetModule(void *SWIGUNUSEDPARM(clientdata)) {
1365   static void *type_pointer = (void *)0;
1366   SV *pointer;
1367 
1368   /* first check if pointer already created */
1369   if (!type_pointer) {
1370     pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, FALSE | GV_ADDMULTI);
1371     if (pointer && SvOK(pointer)) {
1372       type_pointer = INT2PTR(swig_type_info **, SvIV(pointer));
1373     }
1374   }
1375 
1376   return (swig_module_info *) type_pointer;
1377 }
1378 
1379 SWIGRUNTIME void
1380 SWIG_Perl_SetModule(swig_module_info *module) {
1381   SV *pointer;
1382 
1383   /* create a new pointer */
1384   pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, TRUE | GV_ADDMULTI);
1385   sv_setiv(pointer, PTR2IV(module));
1386 }
1387 
1388 #ifdef __cplusplus
1389 }
1390 #endif
1391 
1392 /* Workaround perl5 global namespace pollution. Note that undefining library
1393  * functions like fopen will not solve the problem on all platforms as fopen
1394  * might be a macro on Windows but not necessarily on other operating systems. */
1395 #ifdef do_open
1396   #undef do_open
1397 #endif
1398 #ifdef do_close
1399   #undef do_close
1400 #endif
1401 #ifdef do_exec
1402   #undef do_exec
1403 #endif
1404 #ifdef scalar
1405   #undef scalar
1406 #endif
1407 #ifdef list
1408   #undef list
1409 #endif
1410 #ifdef apply
1411   #undef apply
1412 #endif
1413 #ifdef convert
1414   #undef convert
1415 #endif
1416 #ifdef Error
1417   #undef Error
1418 #endif
1419 #ifdef form
1420   #undef form
1421 #endif
1422 #ifdef vform
1423   #undef vform
1424 #endif
1425 #ifdef LABEL
1426   #undef LABEL
1427 #endif
1428 #ifdef METHOD
1429   #undef METHOD
1430 #endif
1431 #ifdef Move
1432   #undef Move
1433 #endif
1434 #ifdef yylex
1435   #undef yylex
1436 #endif
1437 #ifdef yyparse
1438   #undef yyparse
1439 #endif
1440 #ifdef yyerror
1441   #undef yyerror
1442 #endif
1443 #ifdef invert
1444   #undef invert
1445 #endif
1446 #ifdef ref
1447   #undef ref
1448 #endif
1449 #ifdef read
1450   #undef read
1451 #endif
1452 #ifdef write
1453   #undef write
1454 #endif
1455 #ifdef eof
1456   #undef eof
1457 #endif
1458 #ifdef close
1459   #undef close
1460 #endif
1461 #ifdef rewind
1462   #undef rewind
1463 #endif
1464 #ifdef free
1465   #undef free
1466 #endif
1467 #ifdef malloc
1468   #undef malloc
1469 #endif
1470 #ifdef calloc
1471   #undef calloc
1472 #endif
1473 #ifdef Stat
1474   #undef Stat
1475 #endif
1476 #ifdef check
1477   #undef check
1478 #endif
1479 #ifdef seekdir
1480   #undef seekdir
1481 #endif
1482 #ifdef open
1483   #undef open
1484 #endif
1485 #ifdef readdir
1486   #undef readdir
1487 #endif
1488 #ifdef bind
1489   #undef bind
1490 #endif
1491 #ifdef access
1492   #undef access
1493 #endif
1494 #ifdef stat
1495   #undef stat
1496 #endif
1497 #ifdef seed
1498   #undef seed
1499 #endif
1500 
1501 #ifdef bool
1502   /* Leave if macro is from C99 stdbool.h */
1503   #ifndef __bool_true_false_are_defined
1504     #undef bool
1505   #endif
1506 #endif
1507 
1508 
1509 
1510 
1511 #define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0)
1512 
1513 #define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else
1514 
1515 
1516 
1517 /* -------- TYPES TABLE (BEGIN) -------- */
1518 
1519 #define SWIGTYPE_p_FILE swig_types[0]
1520 #define SWIGTYPE_p_char swig_types[1]
1521 #define SWIGTYPE_p_f_p_q_const__char_p_q_const__char_int_int__void swig_types[2]
1522 #define SWIGTYPE_p_f_p_q_const__char_p_q_const__char_int_p_q_const__char__void swig_types[3]
1523 #define SWIGTYPE_p_f_p_void_p_gsl_function_fdf_p_double__int swig_types[4]
1524 #define SWIGTYPE_p_f_p_void_p_gsl_function_p_double_double_double__int swig_types[5]
1525 #define SWIGTYPE_p_f_p_void_p_gsl_function_p_double_p_double_p_double__int swig_types[6]
1526 #define SWIGTYPE_p_gsl_function swig_types[7]
1527 #define SWIGTYPE_p_gsl_function_fdf swig_types[8]
1528 #define SWIGTYPE_p_gsl_root_fdfsolver swig_types[9]
1529 #define SWIGTYPE_p_gsl_root_fdfsolver_type swig_types[10]
1530 #define SWIGTYPE_p_gsl_root_fsolver swig_types[11]
1531 #define SWIGTYPE_p_gsl_root_fsolver_type swig_types[12]
1532 #define SWIGTYPE_p_void swig_types[13]
1533 static swig_type_info *swig_types[15];
1534 static swig_module_info swig_module = {swig_types, 14, 0, 0, 0, 0};
1535 #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
1536 #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
1537 
1538 /* -------- TYPES TABLE (END) -------- */
1539 
1540 #define SWIG_init    boot_Math__GSL__Roots
1541 
1542 #define SWIG_name   "Math::GSL::Rootsc::boot_Math__GSL__Roots"
1543 #define SWIG_prefix "Math::GSL::Rootsc::"
1544 
1545 #define SWIGVERSION 0x040001
1546 #define SWIG_VERSION SWIGVERSION
1547 
1548 
1549 #define SWIG_as_voidptr(a) (void *)((const void *)(a))
1550 #define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),(void**)(a))
1551 
1552 
1553 #ifdef __cplusplus
1554 extern "C"
1555 #endif
1556 #ifndef PERL_OBJECT
1557 #ifndef MULTIPLICITY
1558 SWIGEXPORT void SWIG_init (CV* cv);
1559 #else
1560 SWIGEXPORT void SWIG_init (pTHXo_ CV* cv);
1561 #endif
1562 #else
1563 SWIGEXPORT void SWIG_init (CV *cv, CPerlObj *);
1564 #endif
1565 
1566 
1567 SWIGINTERNINLINE SV *
SWIG_PERL_DECL_ARGS_1(double value)1568 SWIG_From_double  SWIG_PERL_DECL_ARGS_1(double value)
1569 {
1570   return sv_2mortal(newSVnv(value));
1571 }
1572 
1573 
1574 SWIGINTERNINLINE SV *
SWIG_PERL_DECL_ARGS_1(long value)1575 SWIG_From_long  SWIG_PERL_DECL_ARGS_1(long value)
1576 {
1577   SV *sv;
1578   if (IVSIZE >= sizeof(value) || (value >= IV_MIN && value <= IV_MAX))
1579     sv = newSViv(value);
1580   else
1581     sv = newSVpvf("%ld", value);
1582   return sv_2mortal(sv);
1583 }
1584 
1585 
1586 SWIGINTERNINLINE SV *
SWIG_PERL_DECL_ARGS_1(int value)1587 SWIG_From_int  SWIG_PERL_DECL_ARGS_1(int value)
1588 {
1589   return SWIG_From_long  SWIG_PERL_CALL_ARGS_1(value);
1590 }
1591 
1592 
1593 SWIGINTERN swig_type_info*
SWIG_pchar_descriptor(void)1594 SWIG_pchar_descriptor(void)
1595 {
1596   static int init = 0;
1597   static swig_type_info* info = 0;
1598   if (!init) {
1599     info = SWIG_TypeQuery("_p_char");
1600     init = 1;
1601   }
1602   return info;
1603 }
1604 
1605 
1606 SWIGINTERN int
SWIG_AsCharPtrAndSize(SV * obj,char ** cptr,size_t * psize,int * alloc)1607 SWIG_AsCharPtrAndSize(SV *obj, char** cptr, size_t* psize, int *alloc)
1608 {
1609   if (SvMAGICAL(obj)) {
1610      SV *tmp = sv_newmortal();
1611      SvSetSV(tmp, obj);
1612      obj = tmp;
1613   }
1614   if (SvPOK(obj)) {
1615     STRLEN len = 0;
1616     char *cstr = SvPV(obj, len);
1617     size_t size = len + 1;
1618     if (cptr)  {
1619       if (alloc) {
1620 	if (*alloc == SWIG_NEWOBJ) {
1621 	  *cptr = (char *)memcpy(malloc((size)*sizeof(char)), cstr, sizeof(char)*(size));
1622 	} else {
1623 	  *cptr = cstr;
1624 	  *alloc = SWIG_OLDOBJ;
1625 	}
1626       }
1627     }
1628     if (psize) *psize = size;
1629     return SWIG_OK;
1630   } else {
1631     swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
1632     if (pchar_descriptor) {
1633       char* vptr = 0;
1634       if (SWIG_ConvertPtr(obj, (void**)&vptr, pchar_descriptor, 0) == SWIG_OK) {
1635 	if (cptr) *cptr = vptr;
1636 	if (psize) *psize = vptr ? (strlen(vptr) + 1) : 0;
1637 	if (alloc) *alloc = SWIG_OLDOBJ;
1638 	return SWIG_OK;
1639       }
1640     }
1641   }
1642   return SWIG_TypeError;
1643 }
1644 
1645 
1646 
1647 
1648 
1649 #include <limits.h>
1650 #if !defined(SWIG_NO_LLONG_MAX)
1651 # if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
1652 #   define LLONG_MAX __LONG_LONG_MAX__
1653 #   define LLONG_MIN (-LLONG_MAX - 1LL)
1654 #   define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
1655 # endif
1656 #endif
1657 
1658 
1659 #include <stdlib.h>
1660 #ifdef _MSC_VER
1661 # ifndef strtoull
1662 #  define strtoull _strtoui64
1663 # endif
1664 # ifndef strtoll
1665 #  define strtoll _strtoi64
1666 # endif
1667 #endif
1668 
1669 
1670 SWIGINTERN int
SWIG_PERL_DECL_ARGS_2(SV * obj,double * val)1671 SWIG_AsVal_double SWIG_PERL_DECL_ARGS_2(SV *obj, double *val)
1672 {
1673   if (SvNIOK(obj)) {
1674     if (val) *val = SvNV(obj);
1675     return SWIG_OK;
1676   } else if (SvIOK(obj)) {
1677     if (val) *val = (double) SvIV(obj);
1678     return SWIG_AddCast(SWIG_OK);
1679   } else {
1680     const char *nptr = SvPV_nolen(obj);
1681     if (nptr) {
1682       char *endptr;
1683       double v;
1684       errno = 0;
1685       v = strtod(nptr, &endptr);
1686       if (errno == ERANGE) {
1687 	errno = 0;
1688 	return SWIG_OverflowError;
1689       } else {
1690 	if (*endptr == '\0') {
1691 	  if (val) *val = v;
1692 	  return SWIG_Str2NumCast(SWIG_OK);
1693 	}
1694       }
1695     }
1696   }
1697   return SWIG_TypeError;
1698 }
1699 
1700 
1701 #include <float.h>
1702 
1703 
1704 #include <math.h>
1705 
1706 
1707 SWIGINTERNINLINE int
SWIG_CanCastAsInteger(double * d,double min,double max)1708 SWIG_CanCastAsInteger(double *d, double min, double max) {
1709   double x = *d;
1710   if ((min <= x && x <= max)) {
1711    double fx = floor(x);
1712    double cx = ceil(x);
1713    double rd =  ((x - fx) < 0.5) ? fx : cx; /* simple rint */
1714    if ((errno == EDOM) || (errno == ERANGE)) {
1715      errno = 0;
1716    } else {
1717      double summ, reps, diff;
1718      if (rd < x) {
1719        diff = x - rd;
1720      } else if (rd > x) {
1721        diff = rd - x;
1722      } else {
1723        return 1;
1724      }
1725      summ = rd + x;
1726      reps = diff/summ;
1727      if (reps < 8*DBL_EPSILON) {
1728        *d = rd;
1729        return 1;
1730      }
1731    }
1732   }
1733   return 0;
1734 }
1735 
1736 
1737 SWIGINTERN int
SWIG_PERL_DECL_ARGS_2(SV * obj,long * val)1738 SWIG_AsVal_long SWIG_PERL_DECL_ARGS_2(SV *obj, long* val)
1739 {
1740   if (SvUOK(obj)) {
1741     UV v = SvUV(obj);
1742     if (UVSIZE < sizeof(*val) || v <= LONG_MAX) {
1743       if (val) *val = v;
1744       return SWIG_OK;
1745     }
1746     return SWIG_OverflowError;
1747   } else if (SvIOK(obj)) {
1748     IV v = SvIV(obj);
1749     if (IVSIZE <= sizeof(*val) || (v >= LONG_MIN && v <= LONG_MAX)) {
1750       if(val) *val = v;
1751       return SWIG_OK;
1752     }
1753     return SWIG_OverflowError;
1754   } else {
1755     int dispatch = 0;
1756     const char *nptr = SvPV_nolen(obj);
1757     if (nptr) {
1758       char *endptr;
1759       long v;
1760       errno = 0;
1761       v = strtol(nptr, &endptr,0);
1762       if (errno == ERANGE) {
1763 	errno = 0;
1764 	return SWIG_OverflowError;
1765       } else {
1766 	if (*endptr == '\0') {
1767 	  if (val) *val = v;
1768 	  return SWIG_Str2NumCast(SWIG_OK);
1769 	}
1770       }
1771     }
1772     if (!dispatch) {
1773       double d;
1774       int res = SWIG_AddCast(SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(obj,&d));
1775       if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) {
1776 	if (val) *val = (long)(d);
1777 	return res;
1778       }
1779     }
1780   }
1781   return SWIG_TypeError;
1782 }
1783 
1784 
1785 SWIGINTERN int
SWIG_PERL_DECL_ARGS_2(SV * obj,int * val)1786 SWIG_AsVal_int SWIG_PERL_DECL_ARGS_2(SV * obj, int *val)
1787 {
1788   long v;
1789   int res = SWIG_AsVal_long SWIG_PERL_CALL_ARGS_2(obj, &v);
1790   if (SWIG_IsOK(res)) {
1791     if ((v < INT_MIN || v > INT_MAX)) {
1792       return SWIG_OverflowError;
1793     } else {
1794       if (val) *val = (int)(v);
1795     }
1796   }
1797   return res;
1798 }
1799 
1800 
1801 SWIGINTERNINLINE SV *
SWIG_FromCharPtrAndSize(const char * carray,size_t size)1802 SWIG_FromCharPtrAndSize(const char* carray, size_t size)
1803 {
1804   SV *obj = sv_newmortal();
1805   if (carray) {
1806     sv_setpvn(obj, carray, size);
1807   } else {
1808     sv_setsv(obj, &PL_sv_undef);
1809   }
1810   return obj;
1811 }
1812 
1813 
1814 SWIGINTERNINLINE SV *
SWIG_FromCharPtr(const char * cptr)1815 SWIG_FromCharPtr(const char *cptr)
1816 {
1817   return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0));
1818 }
1819 
1820 
1821     #include "gsl/gsl_nan.h"
1822     #include "gsl/gsl_errno.h"
1823     #include "gsl/gsl_math.h"
1824     #include "gsl/gsl_monte.h"
1825 
1826 
1827     struct perl_array {
1828         I32 len;
1829         AV *array;
1830     };
1831 
1832 
1833 
1834 enum awType { awDouble, awFloat, awInt, awUnsigned };
1835 
1836 typedef struct {
1837     I32 size;
1838     enum awType type;
1839     void * data;
1840 } array_wrapper;
1841 
array_wrapper_alloc(int numelem,enum awType type)1842 array_wrapper * array_wrapper_alloc(int numelem, enum awType type){
1843     array_wrapper * rv =  malloc(sizeof(array_wrapper));
1844 
1845     if (rv == NULL)
1846         croak("array_wrapper_alloc: can't malloc wrapper\n");
1847 
1848     switch (type){
1849         case awDouble:
1850             rv->data = malloc(sizeof(double) * numelem);
1851             break;
1852         case awFloat:
1853             rv->data = malloc(sizeof(float) * numelem);
1854             break;
1855         case awInt:
1856             rv->data = malloc(sizeof(int) * numelem);
1857             break;
1858         case awUnsigned:
1859             rv->data = malloc(sizeof(unsigned int) * numelem);
1860             break;
1861         default:
1862             croak("array_wrapper_alloc: type should be awDouble, awFloat, awInt, or awUnsigned");
1863     }
1864 
1865     if (rv->data == NULL)
1866         croak("array_wrapper_alloc: can't malloc data");
1867 
1868     rv->size = numelem;
1869     rv->type = type;
1870     return rv;
1871 }
1872 
array_wrapper_free(array_wrapper * daw)1873 void array_wrapper_free(array_wrapper * daw){
1874     free(daw->data);
1875     free(daw);
1876 }
1877 
1878 
1879     /* structure to hold required information while the gsl function call
1880        for each callback
1881      */
1882     struct gsl_function_perl {
1883         gsl_function C_gsl_function;
1884         SV * function;
1885         SV * params;
1886     };
1887 
1888     struct gsl_function_fdf_perl {
1889         gsl_function_fdf C_gsl_function_fdf;
1890         SV * f;
1891         SV * df;
1892         SV * fdf;
1893         SV * params;
1894     };
1895 
1896     struct gsl_monte_function_perl {
1897         gsl_monte_function C_gsl_monte_function;
1898         SV * f;
1899         SV * dim;
1900         SV * params;
1901     };
1902 
gsl_function_perl_free(struct gsl_function_perl * perl_f)1903     void gsl_function_perl_free(struct gsl_function_perl * perl_f){
1904         if (perl_f != NULL) {
1905             SvREFCNT_dec(perl_f->function);
1906             SvREFCNT_dec(perl_f->params);
1907             Safefree(perl_f);
1908         }
1909     }
1910 
gsl_function_fdf_perl_free(struct gsl_function_fdf_perl * perl_fdf)1911     void gsl_function_fdf_perl_free(struct gsl_function_fdf_perl * perl_fdf){
1912         if (perl_fdf != NULL) {
1913 	  SvREFCNT_dec(perl_fdf->f);
1914 	  SvREFCNT_dec(perl_fdf->df);
1915 	  SvREFCNT_dec(perl_fdf->fdf);
1916 	  SvREFCNT_dec(perl_fdf->params);
1917 	  Safefree(perl_fdf);
1918         }
1919     }
1920 
1921     /* These functions (C callbacks) calls the perl callbacks.
1922        Info for perl callback can be found using the 'void*params' parameter
1923     */
call_gsl_function_x_params(SV * function,double x,SV * params)1924     double call_gsl_function_x_params(SV* function, double x, SV *params){
1925         unsigned int count;
1926         double y;
1927         dSP;
1928 
1929         //fprintf(stderr, "LOOKUP CALLBACK\n");
1930         ENTER;
1931         SAVETMPS;
1932 
1933         PUSHMARK(SP);
1934         XPUSHs(sv_2mortal(newSVnv((double)x)));
1935         XPUSHs(params);
1936         PUTBACK;                                /* make local stack pointer global */
1937 
1938         count = call_sv(function, G_SCALAR);
1939         SPAGAIN;
1940 
1941         if (count != 1)
1942                 croak("Expected to call subroutine in scalar context!");
1943 
1944         y = POPn;
1945 
1946         PUTBACK;                                /* make local stack pointer global */
1947         FREETMPS;
1948         LEAVE;
1949 
1950         return y;
1951     }
1952 
call_gsl_function(double x,void * params)1953     double call_gsl_function(double x , void *params){
1954         struct gsl_function_perl *F=(struct gsl_function_perl*)params;
1955 	return call_gsl_function_x_params( F->function, x, F->params );
1956     }
1957 
call_gsl_function_fdf_f(double x,void * params)1958     double call_gsl_function_fdf_f(double x , void *params){
1959         struct gsl_function_fdf_perl *F=(struct gsl_function_fdf_perl*)params;
1960 	return call_gsl_function_x_params( F->f, x, F->params );
1961     }
1962 
call_gsl_function_fdf_df(double x,void * params)1963     double call_gsl_function_fdf_df(double x , void *params){
1964         struct gsl_function_fdf_perl *F=(struct gsl_function_fdf_perl*)params;
1965 	return call_gsl_function_x_params( F->df, x, F->params );
1966     }
1967 
call_gsl_function_fdf_fdf(double x,void * params,double * f,double * df)1968     void call_gsl_function_fdf_fdf(double x , void *params, double *f, double *df ){
1969         struct gsl_function_fdf_perl *F=(struct gsl_function_fdf_perl*)params;
1970 
1971         dSP;
1972 
1973         ENTER;
1974         SAVETMPS;
1975 
1976         PUSHMARK(SP);
1977 	EXTEND(SP, 2);
1978         PUSHs(sv_2mortal(newSVnv((double)x)));
1979         PUSHs(F->params);
1980         PUTBACK;                                /* make local stack pointer global */
1981 
1982 	{
1983 	  unsigned int count = call_sv(F->fdf, G_ARRAY);
1984 	  SPAGAIN;
1985 
1986 	  if (count != 2)
1987 	    croak( "Expected two return values, got %d", count );
1988 	}
1989 
1990 	*df = POPn;
1991         *f = POPn;
1992 
1993         PUTBACK;                                /* make local stack pointer global */
1994         FREETMPS;
1995         LEAVE;
1996     }
1997 
call_gsl_monte_function(double * x_array,size_t dim,void * params)1998     double call_gsl_monte_function(double *x_array , size_t dim, void *params){
1999         struct gsl_monte_function_perl *F=(struct gsl_monte_function_perl*)params;
2000         unsigned int count;
2001         unsigned int i;
2002         AV* perl_array;
2003         double y;
2004         dSP;
2005 
2006         //fprintf(stderr, "LOOKUP CALLBACK\n");
2007         ENTER;
2008         SAVETMPS;
2009 
2010         PUSHMARK(SP);
2011         perl_array=newAV();
2012         sv_2mortal((SV*)perl_array);
2013         XPUSHs(sv_2mortal(newRV((SV *)perl_array)));
2014         for(i=0; i<dim; i++) {
2015                 /* no mortal : it is referenced by the array */
2016                 av_push(perl_array, newSVnv(x_array[i]));
2017         }
2018         XPUSHs(sv_2mortal(newSViv(dim)));
2019         XPUSHs(F->params);
2020         PUTBACK;                                /* make local stack pointer global */
2021 
2022         count = call_sv(F->f, G_SCALAR);
2023         SPAGAIN;
2024 
2025         if (count != 1)
2026                 croak("Expected to call subroutine in scalar context!");
2027 
2028         y = POPn;
2029 
2030         PUTBACK;                                /* make local stack pointer global */
2031         FREETMPS;
2032         LEAVE;
2033 
2034         return y;
2035     }
2036 
2037 
gsl_function_fdf_extract(char * param_name,HV * hash,SV * func[])2038   void gsl_function_fdf_extract( char* param_name, HV* hash, SV* func[] ) {
2039     static const char *keys[3] = { "f", "df", "fdf" };
2040 
2041     int ikey;
2042 
2043     for ( ikey = 0 ; ikey < 3 ; ++ikey ) {
2044       func[ikey] = 0;
2045       const char* key = keys[ikey];
2046       /* it just so happens that strlen(keys[ikey]) == ikey + 1 */
2047       SV** pp_sv = hv_fetch( hash, key, ikey+1, 0 );
2048       SV* function;
2049 
2050       if ( !pp_sv )
2051 	croak("Math::GSL : %s: missing key %s!", param_name, key);
2052 
2053       function = *pp_sv;
2054 
2055       if ( SvPOK(function) || ( SvROK( function ) && SvTYPE(SvRV(function)) == SVt_PVCV ) ) {
2056         /* hold on to SV after the enclosing hash goes away */
2057         SvREFCNT_inc( function );
2058 	func[ikey] = function;
2059       }
2060       else {
2061 	croak( "Math::GSL : %s:  key %s is not a reference to code!", param_name, key);
2062       }
2063     }
2064   }
2065 
2066 
2067 
2068     #include "gsl/gsl_types.h"
2069     #include "gsl/gsl_roots.h"
2070 
2071 
2072 SWIGINTERN int
SWIG_PERL_DECL_ARGS_2(SV * obj,unsigned long * val)2073 SWIG_AsVal_unsigned_SS_long SWIG_PERL_DECL_ARGS_2(SV *obj, unsigned long *val)
2074 {
2075   if (SvUOK(obj)) {
2076     UV v = SvUV(obj);
2077     if (UVSIZE <= sizeof(*val) || v <= ULONG_MAX) {
2078       if (val) *val = v;
2079       return SWIG_OK;
2080     }
2081     return SWIG_OverflowError;
2082   } else if (SvIOK(obj)) {
2083     IV v = SvIV(obj);
2084     if (v >= 0 && (IVSIZE <= sizeof(*val) || v <= ULONG_MAX)) {
2085       if (val) *val = v;
2086       return SWIG_OK;
2087     }
2088     return SWIG_OverflowError;
2089   } else {
2090     int dispatch = 0;
2091     const char *nptr = SvPV_nolen(obj);
2092     if (nptr) {
2093       char *endptr;
2094       unsigned long v;
2095       errno = 0;
2096       v = strtoul(nptr, &endptr,0);
2097       if (errno == ERANGE) {
2098 	errno = 0;
2099 	return SWIG_OverflowError;
2100       } else {
2101 	if (*endptr == '\0') {
2102 	  if (val) *val = v;
2103 	  return SWIG_Str2NumCast(SWIG_OK);
2104 	}
2105       }
2106     }
2107     if (!dispatch) {
2108       double d;
2109       int res = SWIG_AddCast(SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(obj,&d));
2110       if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, ULONG_MAX)) {
2111 	if (val) *val = (unsigned long)(d);
2112 	return res;
2113       }
2114     }
2115   }
2116   return SWIG_TypeError;
2117 }
2118 
2119 
2120 #if defined(LLONG_MAX) && !defined(SWIG_LONG_LONG_AVAILABLE)
2121 #  define SWIG_LONG_LONG_AVAILABLE
2122 #endif
2123 
2124 
2125 #ifdef SWIG_LONG_LONG_AVAILABLE
2126 SWIGINTERN int
SWIG_PERL_DECL_ARGS_2(SV * obj,unsigned long long * val)2127 SWIG_AsVal_unsigned_SS_long_SS_long SWIG_PERL_DECL_ARGS_2(SV *obj, unsigned long long *val)
2128 {
2129   if (SvUOK(obj)) {
2130     /* pretty sure this should be conditional on
2131      * (UVSIZE <= sizeof(*val) || v <= ULLONG_MAX) */
2132     if (val) *val = SvUV(obj);
2133     return SWIG_OK;
2134   } else  if (SvIOK(obj)) {
2135     IV v = SvIV(obj);
2136     if (v >= 0 && (IVSIZE <= sizeof(*val) || v <= ULLONG_MAX)) {
2137       if (val) *val = v;
2138       return SWIG_OK;
2139     } else {
2140       return SWIG_OverflowError;
2141     }
2142   } else {
2143     int dispatch = 0;
2144     const char *nptr = SvPV_nolen(obj);
2145     if (nptr) {
2146       char *endptr;
2147       unsigned long long v;
2148       errno = 0;
2149       v = strtoull(nptr, &endptr,0);
2150       if (errno == ERANGE) {
2151 	errno = 0;
2152 	return SWIG_OverflowError;
2153       } else {
2154 	if (*endptr == '\0') {
2155 	  if (val) *val = v;
2156 	  return SWIG_Str2NumCast(SWIG_OK);
2157 	}
2158       }
2159     }
2160     if (!dispatch) {
2161       const double mant_max = 1LL << DBL_MANT_DIG;
2162       double d;
2163       int res = SWIG_AddCast(SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(obj,&d));
2164       if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, mant_max)) {
2165 	if (val) *val = (unsigned long long)(d);
2166 	return res;
2167       }
2168     }
2169   }
2170   return SWIG_TypeError;
2171 }
2172 #endif
2173 
2174 
2175 SWIGINTERNINLINE int
SWIG_PERL_DECL_ARGS_2(SV * obj,size_t * val)2176 SWIG_AsVal_size_t SWIG_PERL_DECL_ARGS_2(SV * obj, size_t *val)
2177 {
2178   int res = SWIG_TypeError;
2179 #ifdef SWIG_LONG_LONG_AVAILABLE
2180   if (sizeof(size_t) <= sizeof(unsigned long)) {
2181 #endif
2182     unsigned long v;
2183     res = SWIG_AsVal_unsigned_SS_long SWIG_PERL_CALL_ARGS_2(obj, val ? &v : 0);
2184     if (SWIG_IsOK(res) && val) *val = (size_t)(v);
2185 #ifdef SWIG_LONG_LONG_AVAILABLE
2186   } else if (sizeof(size_t) <= sizeof(unsigned long long)) {
2187     unsigned long long v;
2188     res = SWIG_AsVal_unsigned_SS_long_SS_long SWIG_PERL_CALL_ARGS_2(obj, val ? &v : 0);
2189     if (SWIG_IsOK(res) && val) *val = (size_t)(v);
2190   }
2191 #endif
2192   return res;
2193 }
2194 
2195 
2196 SWIGINTERNINLINE SV *
SWIG_PERL_DECL_ARGS_1(unsigned long value)2197 SWIG_From_unsigned_SS_long  SWIG_PERL_DECL_ARGS_1(unsigned long value)
2198 {
2199   SV *sv;
2200   if (UVSIZE >= sizeof(value) || value <= UV_MAX)
2201     sv = newSVuv(value);
2202   else
2203     sv = newSVpvf("%lu", value);
2204   return sv_2mortal(sv);
2205 }
2206 
2207 
2208 #include <stdio.h>
2209 #if (defined(_MSC_VER) && (_MSC_VER < 1900)) || defined(__BORLANDC__) || defined(_WATCOM)
2210 # ifndef snprintf
2211 #  define snprintf _snprintf
2212 # endif
2213 #endif
2214 
2215 
2216 #ifdef SWIG_LONG_LONG_AVAILABLE
2217 SWIGINTERNINLINE SV *
SWIG_PERL_DECL_ARGS_1(unsigned long long value)2218 SWIG_From_unsigned_SS_long_SS_long  SWIG_PERL_DECL_ARGS_1(unsigned long long value)
2219 {
2220   SV *sv;
2221   if (UVSIZE >= sizeof(value) || value <= UV_MAX)
2222     sv = newSVuv((UV)(value));
2223   else {
2224     //sv = newSVpvf("%llu", value); doesn't work in non 64bit Perl
2225     char temp[256];
2226     sprintf(temp, "%llu", value);
2227     sv = newSVpv(temp, 0);
2228   }
2229   return sv_2mortal(sv);
2230 }
2231 #endif
2232 
2233 
2234 SWIGINTERNINLINE SV *
SWIG_PERL_DECL_ARGS_1(size_t value)2235 SWIG_From_size_t  SWIG_PERL_DECL_ARGS_1(size_t value)
2236 {
2237 #ifdef SWIG_LONG_LONG_AVAILABLE
2238   if (sizeof(size_t) <= sizeof(unsigned long)) {
2239 #endif
2240     return SWIG_From_unsigned_SS_long  SWIG_PERL_CALL_ARGS_1((unsigned long)(value));
2241 #ifdef SWIG_LONG_LONG_AVAILABLE
2242   } else {
2243     /* assume sizeof(size_t) <= sizeof(unsigned long long) */
2244     return SWIG_From_unsigned_SS_long_SS_long  SWIG_PERL_CALL_ARGS_1((unsigned long long)(value));
2245   }
2246 #endif
2247 }
2248 
delete_gsl_root_fsolver(gsl_root_fsolver * self)2249 SWIGINTERN void delete_gsl_root_fsolver(gsl_root_fsolver *self){
2250         struct gsl_function *gsl_f = (struct gsl_function *) self->function;
2251         if (gsl_f != NULL) {
2252             struct gsl_function_perl *perl_f = (struct gsl_function_perl *) self->function->params;
2253             gsl_function_perl_free(perl_f);
2254         }
2255         gsl_root_fsolver_free(self);
2256     }
delete_gsl_root_fdfsolver(gsl_root_fdfsolver * self)2257 SWIGINTERN void delete_gsl_root_fdfsolver(gsl_root_fdfsolver *self){
2258         if (self->fdf != NULL) {
2259             struct gsl_function_fdf_perl *perl_fdf = (struct gsl_function_fdf_perl *) self->fdf->params;
2260             gsl_function_fdf_perl_free(perl_fdf);
2261         }
2262         gsl_root_fdfsolver_free(self);
2263     }
2264 #ifdef __cplusplus
2265 extern "C" {
2266 #endif
2267 
2268 #ifdef PERL_OBJECT
2269 #define MAGIC_CLASS _wrap_Math__GSL__Roots_var::
2270 class _wrap_Math__GSL__Roots_var : public CPerlObj {
2271 public:
2272 #else
2273 #define MAGIC_CLASS
2274 #endif
swig_magic_readonly(pTHX_ SV * SWIGUNUSEDPARM (sv),MAGIC * SWIGUNUSEDPARM (mg))2275 SWIGCLASS_STATIC int swig_magic_readonly(pTHX_ SV *SWIGUNUSEDPARM(sv), MAGIC *SWIGUNUSEDPARM(mg)) {
2276     MAGIC_PPERL
2277     croak("Value is read-only.");
2278     return 0;
2279 }
_wrap_gsl_root_fsolver_bisection_set(pTHX_ SV * sv,MAGIC * SWIGUNUSEDPARM (mg))2280 SWIGCLASS_STATIC int _wrap_gsl_root_fsolver_bisection_set(pTHX_ SV* sv, MAGIC * SWIGUNUSEDPARM(mg)) {
2281   MAGIC_PPERL
2282   {
2283     void *argp = 0;
2284     int res = SWIG_ConvertPtr(sv, &argp, SWIGTYPE_p_gsl_root_fsolver_type,  0 );
2285     if (!SWIG_IsOK(res)) {
2286       SWIG_exception_fail(SWIG_ArgError(res), "in variable '""gsl_root_fsolver_bisection""' of type '""gsl_root_fsolver_type const *""'");
2287     }
2288     gsl_root_fsolver_bisection = (gsl_root_fsolver_type *)(argp);
2289   }
2290 fail:
2291   return 1;
2292 }
2293 
2294 
_wrap_gsl_root_fsolver_bisection_get(pTHX_ SV * sv,MAGIC * SWIGUNUSEDPARM (mg))2295 SWIGCLASS_STATIC int _wrap_gsl_root_fsolver_bisection_get(pTHX_ SV *sv, MAGIC *SWIGUNUSEDPARM(mg)) {
2296   MAGIC_PPERL
2297   sv_setiv(SvRV(sv),PTR2IV(gsl_root_fsolver_bisection));
2298   return 1;
2299 }
2300 
2301 
_wrap_gsl_root_fsolver_brent_set(pTHX_ SV * sv,MAGIC * SWIGUNUSEDPARM (mg))2302 SWIGCLASS_STATIC int _wrap_gsl_root_fsolver_brent_set(pTHX_ SV* sv, MAGIC * SWIGUNUSEDPARM(mg)) {
2303   MAGIC_PPERL
2304   {
2305     void *argp = 0;
2306     int res = SWIG_ConvertPtr(sv, &argp, SWIGTYPE_p_gsl_root_fsolver_type,  0 );
2307     if (!SWIG_IsOK(res)) {
2308       SWIG_exception_fail(SWIG_ArgError(res), "in variable '""gsl_root_fsolver_brent""' of type '""gsl_root_fsolver_type const *""'");
2309     }
2310     gsl_root_fsolver_brent = (gsl_root_fsolver_type *)(argp);
2311   }
2312 fail:
2313   return 1;
2314 }
2315 
2316 
_wrap_gsl_root_fsolver_brent_get(pTHX_ SV * sv,MAGIC * SWIGUNUSEDPARM (mg))2317 SWIGCLASS_STATIC int _wrap_gsl_root_fsolver_brent_get(pTHX_ SV *sv, MAGIC *SWIGUNUSEDPARM(mg)) {
2318   MAGIC_PPERL
2319   sv_setiv(SvRV(sv),PTR2IV(gsl_root_fsolver_brent));
2320   return 1;
2321 }
2322 
2323 
_wrap_gsl_root_fsolver_falsepos_set(pTHX_ SV * sv,MAGIC * SWIGUNUSEDPARM (mg))2324 SWIGCLASS_STATIC int _wrap_gsl_root_fsolver_falsepos_set(pTHX_ SV* sv, MAGIC * SWIGUNUSEDPARM(mg)) {
2325   MAGIC_PPERL
2326   {
2327     void *argp = 0;
2328     int res = SWIG_ConvertPtr(sv, &argp, SWIGTYPE_p_gsl_root_fsolver_type,  0 );
2329     if (!SWIG_IsOK(res)) {
2330       SWIG_exception_fail(SWIG_ArgError(res), "in variable '""gsl_root_fsolver_falsepos""' of type '""gsl_root_fsolver_type const *""'");
2331     }
2332     gsl_root_fsolver_falsepos = (gsl_root_fsolver_type *)(argp);
2333   }
2334 fail:
2335   return 1;
2336 }
2337 
2338 
_wrap_gsl_root_fsolver_falsepos_get(pTHX_ SV * sv,MAGIC * SWIGUNUSEDPARM (mg))2339 SWIGCLASS_STATIC int _wrap_gsl_root_fsolver_falsepos_get(pTHX_ SV *sv, MAGIC *SWIGUNUSEDPARM(mg)) {
2340   MAGIC_PPERL
2341   sv_setiv(SvRV(sv),PTR2IV(gsl_root_fsolver_falsepos));
2342   return 1;
2343 }
2344 
2345 
_wrap_gsl_root_fdfsolver_newton_set(pTHX_ SV * sv,MAGIC * SWIGUNUSEDPARM (mg))2346 SWIGCLASS_STATIC int _wrap_gsl_root_fdfsolver_newton_set(pTHX_ SV* sv, MAGIC * SWIGUNUSEDPARM(mg)) {
2347   MAGIC_PPERL
2348   {
2349     void *argp = 0;
2350     int res = SWIG_ConvertPtr(sv, &argp, SWIGTYPE_p_gsl_root_fdfsolver_type,  0 );
2351     if (!SWIG_IsOK(res)) {
2352       SWIG_exception_fail(SWIG_ArgError(res), "in variable '""gsl_root_fdfsolver_newton""' of type '""gsl_root_fdfsolver_type const *""'");
2353     }
2354     gsl_root_fdfsolver_newton = (gsl_root_fdfsolver_type *)(argp);
2355   }
2356 fail:
2357   return 1;
2358 }
2359 
2360 
_wrap_gsl_root_fdfsolver_newton_get(pTHX_ SV * sv,MAGIC * SWIGUNUSEDPARM (mg))2361 SWIGCLASS_STATIC int _wrap_gsl_root_fdfsolver_newton_get(pTHX_ SV *sv, MAGIC *SWIGUNUSEDPARM(mg)) {
2362   MAGIC_PPERL
2363   sv_setiv(SvRV(sv),PTR2IV(gsl_root_fdfsolver_newton));
2364   return 1;
2365 }
2366 
2367 
_wrap_gsl_root_fdfsolver_secant_set(pTHX_ SV * sv,MAGIC * SWIGUNUSEDPARM (mg))2368 SWIGCLASS_STATIC int _wrap_gsl_root_fdfsolver_secant_set(pTHX_ SV* sv, MAGIC * SWIGUNUSEDPARM(mg)) {
2369   MAGIC_PPERL
2370   {
2371     void *argp = 0;
2372     int res = SWIG_ConvertPtr(sv, &argp, SWIGTYPE_p_gsl_root_fdfsolver_type,  0 );
2373     if (!SWIG_IsOK(res)) {
2374       SWIG_exception_fail(SWIG_ArgError(res), "in variable '""gsl_root_fdfsolver_secant""' of type '""gsl_root_fdfsolver_type const *""'");
2375     }
2376     gsl_root_fdfsolver_secant = (gsl_root_fdfsolver_type *)(argp);
2377   }
2378 fail:
2379   return 1;
2380 }
2381 
2382 
_wrap_gsl_root_fdfsolver_secant_get(pTHX_ SV * sv,MAGIC * SWIGUNUSEDPARM (mg))2383 SWIGCLASS_STATIC int _wrap_gsl_root_fdfsolver_secant_get(pTHX_ SV *sv, MAGIC *SWIGUNUSEDPARM(mg)) {
2384   MAGIC_PPERL
2385   sv_setiv(SvRV(sv),PTR2IV(gsl_root_fdfsolver_secant));
2386   return 1;
2387 }
2388 
2389 
_wrap_gsl_root_fdfsolver_steffenson_set(pTHX_ SV * sv,MAGIC * SWIGUNUSEDPARM (mg))2390 SWIGCLASS_STATIC int _wrap_gsl_root_fdfsolver_steffenson_set(pTHX_ SV* sv, MAGIC * SWIGUNUSEDPARM(mg)) {
2391   MAGIC_PPERL
2392   {
2393     void *argp = 0;
2394     int res = SWIG_ConvertPtr(sv, &argp, SWIGTYPE_p_gsl_root_fdfsolver_type,  0 );
2395     if (!SWIG_IsOK(res)) {
2396       SWIG_exception_fail(SWIG_ArgError(res), "in variable '""gsl_root_fdfsolver_steffenson""' of type '""gsl_root_fdfsolver_type const *""'");
2397     }
2398     gsl_root_fdfsolver_steffenson = (gsl_root_fdfsolver_type *)(argp);
2399   }
2400 fail:
2401   return 1;
2402 }
2403 
2404 
_wrap_gsl_root_fdfsolver_steffenson_get(pTHX_ SV * sv,MAGIC * SWIGUNUSEDPARM (mg))2405 SWIGCLASS_STATIC int _wrap_gsl_root_fdfsolver_steffenson_get(pTHX_ SV *sv, MAGIC *SWIGUNUSEDPARM(mg)) {
2406   MAGIC_PPERL
2407   sv_setiv(SvRV(sv),PTR2IV(gsl_root_fdfsolver_steffenson));
2408   return 1;
2409 }
2410 
2411 
2412 
2413 
2414 #ifdef PERL_OBJECT
2415 };
2416 #endif
2417 
2418 #ifdef __cplusplus
2419 }
2420 #endif
2421 
2422 #ifdef __cplusplus
2423 extern "C" {
2424 #endif
XS(_wrap_gsl_error)2425 XS(_wrap_gsl_error) {
2426   {
2427     char *arg1 = (char *) 0 ;
2428     char *arg2 = (char *) 0 ;
2429     int arg3 ;
2430     int arg4 ;
2431     int res1 ;
2432     char *buf1 = 0 ;
2433     int alloc1 = 0 ;
2434     int res2 ;
2435     char *buf2 = 0 ;
2436     int alloc2 = 0 ;
2437     int val3 ;
2438     int ecode3 = 0 ;
2439     int val4 ;
2440     int ecode4 = 0 ;
2441     int argvi = 0;
2442     dXSARGS;
2443 
2444     if ((items < 4) || (items > 4)) {
2445       SWIG_croak("Usage: gsl_error(reason,file,line,gsl_errno);");
2446     }
2447     res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
2448     if (!SWIG_IsOK(res1)) {
2449       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gsl_error" "', argument " "1"" of type '" "char const *""'");
2450     }
2451     arg1 = (char *)(buf1);
2452     res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
2453     if (!SWIG_IsOK(res2)) {
2454       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "gsl_error" "', argument " "2"" of type '" "char const *""'");
2455     }
2456     arg2 = (char *)(buf2);
2457     ecode3 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
2458     if (!SWIG_IsOK(ecode3)) {
2459       SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "gsl_error" "', argument " "3"" of type '" "int""'");
2460     }
2461     arg3 = (int)(val3);
2462     ecode4 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(3), &val4);
2463     if (!SWIG_IsOK(ecode4)) {
2464       SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "gsl_error" "', argument " "4"" of type '" "int""'");
2465     }
2466     arg4 = (int)(val4);
2467     gsl_error((char const *)arg1,(char const *)arg2,arg3,arg4);
2468     ST(argvi) = &PL_sv_undef;
2469     if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
2470     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
2471 
2472 
2473     XSRETURN(argvi);
2474   fail:
2475     if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
2476     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
2477 
2478 
2479     SWIG_croak_null();
2480   }
2481 }
2482 
2483 
XS(_wrap_gsl_stream_printf)2484 XS(_wrap_gsl_stream_printf) {
2485   {
2486     char *arg1 = (char *) 0 ;
2487     char *arg2 = (char *) 0 ;
2488     int arg3 ;
2489     char *arg4 = (char *) 0 ;
2490     int res1 ;
2491     char *buf1 = 0 ;
2492     int alloc1 = 0 ;
2493     int res2 ;
2494     char *buf2 = 0 ;
2495     int alloc2 = 0 ;
2496     int val3 ;
2497     int ecode3 = 0 ;
2498     int res4 ;
2499     char *buf4 = 0 ;
2500     int alloc4 = 0 ;
2501     int argvi = 0;
2502     dXSARGS;
2503 
2504     if ((items < 4) || (items > 4)) {
2505       SWIG_croak("Usage: gsl_stream_printf(label,file,line,reason);");
2506     }
2507     res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
2508     if (!SWIG_IsOK(res1)) {
2509       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gsl_stream_printf" "', argument " "1"" of type '" "char const *""'");
2510     }
2511     arg1 = (char *)(buf1);
2512     res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
2513     if (!SWIG_IsOK(res2)) {
2514       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "gsl_stream_printf" "', argument " "2"" of type '" "char const *""'");
2515     }
2516     arg2 = (char *)(buf2);
2517     ecode3 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
2518     if (!SWIG_IsOK(ecode3)) {
2519       SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "gsl_stream_printf" "', argument " "3"" of type '" "int""'");
2520     }
2521     arg3 = (int)(val3);
2522     res4 = SWIG_AsCharPtrAndSize(ST(3), &buf4, NULL, &alloc4);
2523     if (!SWIG_IsOK(res4)) {
2524       SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "gsl_stream_printf" "', argument " "4"" of type '" "char const *""'");
2525     }
2526     arg4 = (char *)(buf4);
2527     gsl_stream_printf((char const *)arg1,(char const *)arg2,arg3,(char const *)arg4);
2528     ST(argvi) = &PL_sv_undef;
2529     if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
2530     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
2531 
2532     if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
2533     XSRETURN(argvi);
2534   fail:
2535     if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
2536     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
2537 
2538     if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
2539     SWIG_croak_null();
2540   }
2541 }
2542 
2543 
XS(_wrap_gsl_strerror)2544 XS(_wrap_gsl_strerror) {
2545   {
2546     int arg1 ;
2547     int val1 ;
2548     int ecode1 = 0 ;
2549     int argvi = 0;
2550     char *result = 0 ;
2551     dXSARGS;
2552 
2553     if ((items < 1) || (items > 1)) {
2554       SWIG_croak("Usage: gsl_strerror(gsl_errno);");
2555     }
2556     ecode1 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(0), &val1);
2557     if (!SWIG_IsOK(ecode1)) {
2558       SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gsl_strerror" "', argument " "1"" of type '" "int""'");
2559     }
2560     arg1 = (int)(val1);
2561     result = (char *)gsl_strerror(arg1);
2562     ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
2563 
2564     XSRETURN(argvi);
2565   fail:
2566 
2567     SWIG_croak_null();
2568   }
2569 }
2570 
2571 
XS(_wrap_gsl_set_error_handler)2572 XS(_wrap_gsl_set_error_handler) {
2573   {
2574     gsl_error_handler_t *arg1 = (gsl_error_handler_t *) 0 ;
2575     int argvi = 0;
2576     gsl_error_handler_t *result = 0 ;
2577     dXSARGS;
2578 
2579     if ((items < 1) || (items > 1)) {
2580       SWIG_croak("Usage: gsl_set_error_handler(new_handler);");
2581     }
2582     {
2583       int res = SWIG_ConvertFunctionPtr(ST(0), (void**)(&arg1), SWIGTYPE_p_f_p_q_const__char_p_q_const__char_int_int__void);
2584       if (!SWIG_IsOK(res)) {
2585         SWIG_exception_fail(SWIG_ArgError(res), "in method '" "gsl_set_error_handler" "', argument " "1"" of type '" "gsl_error_handler_t *""'");
2586       }
2587     }
2588     result = (gsl_error_handler_t *)gsl_set_error_handler(arg1);
2589     ST(argvi) = SWIG_NewFunctionPtrObj((void *)(result), SWIGTYPE_p_f_p_q_const__char_p_q_const__char_int_int__void); argvi++ ;
2590 
2591     XSRETURN(argvi);
2592   fail:
2593 
2594     SWIG_croak_null();
2595   }
2596 }
2597 
2598 
XS(_wrap_gsl_set_error_handler_off)2599 XS(_wrap_gsl_set_error_handler_off) {
2600   {
2601     int argvi = 0;
2602     gsl_error_handler_t *result = 0 ;
2603     dXSARGS;
2604 
2605     if ((items < 0) || (items > 0)) {
2606       SWIG_croak("Usage: gsl_set_error_handler_off();");
2607     }
2608     result = (gsl_error_handler_t *)gsl_set_error_handler_off();
2609     ST(argvi) = SWIG_NewFunctionPtrObj((void *)(result), SWIGTYPE_p_f_p_q_const__char_p_q_const__char_int_int__void); argvi++ ;
2610     XSRETURN(argvi);
2611   fail:
2612     SWIG_croak_null();
2613   }
2614 }
2615 
2616 
XS(_wrap_gsl_set_stream_handler)2617 XS(_wrap_gsl_set_stream_handler) {
2618   {
2619     gsl_stream_handler_t *arg1 = (gsl_stream_handler_t *) 0 ;
2620     int argvi = 0;
2621     gsl_stream_handler_t *result = 0 ;
2622     dXSARGS;
2623 
2624     if ((items < 1) || (items > 1)) {
2625       SWIG_croak("Usage: gsl_set_stream_handler(new_handler);");
2626     }
2627     {
2628       int res = SWIG_ConvertFunctionPtr(ST(0), (void**)(&arg1), SWIGTYPE_p_f_p_q_const__char_p_q_const__char_int_p_q_const__char__void);
2629       if (!SWIG_IsOK(res)) {
2630         SWIG_exception_fail(SWIG_ArgError(res), "in method '" "gsl_set_stream_handler" "', argument " "1"" of type '" "gsl_stream_handler_t *""'");
2631       }
2632     }
2633     result = (gsl_stream_handler_t *)gsl_set_stream_handler(arg1);
2634     ST(argvi) = SWIG_NewFunctionPtrObj((void *)(result), SWIGTYPE_p_f_p_q_const__char_p_q_const__char_int_p_q_const__char__void); argvi++ ;
2635 
2636     XSRETURN(argvi);
2637   fail:
2638 
2639     SWIG_croak_null();
2640   }
2641 }
2642 
2643 
XS(_wrap_gsl_set_stream)2644 XS(_wrap_gsl_set_stream) {
2645   {
2646     FILE *arg1 = (FILE *) 0 ;
2647     void *argp1 = 0 ;
2648     int res1 = 0 ;
2649     int argvi = 0;
2650     FILE *result = 0 ;
2651     dXSARGS;
2652 
2653     if ((items < 1) || (items > 1)) {
2654       SWIG_croak("Usage: gsl_set_stream(new_stream);");
2655     }
2656     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_FILE, 0 |  0 );
2657     if (!SWIG_IsOK(res1)) {
2658       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gsl_set_stream" "', argument " "1"" of type '" "FILE *""'");
2659     }
2660     arg1 = (FILE *)(argp1);
2661     result = (FILE *)gsl_set_stream(arg1);
2662     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_FILE, 0 | 0); argvi++ ;
2663 
2664     XSRETURN(argvi);
2665   fail:
2666 
2667     SWIG_croak_null();
2668   }
2669 }
2670 
2671 
XS(_wrap_gsl_root_fsolver_type_name_set)2672 XS(_wrap_gsl_root_fsolver_type_name_set) {
2673   {
2674     gsl_root_fsolver_type *arg1 = (gsl_root_fsolver_type *) 0 ;
2675     char *arg2 = (char *) 0 ;
2676     void *argp1 = 0 ;
2677     int res1 = 0 ;
2678     int res2 ;
2679     char *buf2 = 0 ;
2680     int alloc2 = 0 ;
2681     int argvi = 0;
2682     dXSARGS;
2683 
2684     if ((items < 2) || (items > 2)) {
2685       SWIG_croak("Usage: gsl_root_fsolver_type_name_set(self,name);");
2686     }
2687     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_gsl_root_fsolver_type, 0 |  0 );
2688     if (!SWIG_IsOK(res1)) {
2689       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gsl_root_fsolver_type_name_set" "', argument " "1"" of type '" "gsl_root_fsolver_type *""'");
2690     }
2691     arg1 = (gsl_root_fsolver_type *)(argp1);
2692     res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
2693     if (!SWIG_IsOK(res2)) {
2694       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "gsl_root_fsolver_type_name_set" "', argument " "2"" of type '" "char const *""'");
2695     }
2696     arg2 = (char *)(buf2);
2697     if (arg2) {
2698       size_t size = strlen((const char *)((const char *)(arg2))) + 1;
2699       arg1->name = (char const *)(char *)memcpy(malloc((size)*sizeof(char)), arg2, sizeof(char)*(size));
2700     } else {
2701       arg1->name = 0;
2702     }
2703     ST(argvi) = &PL_sv_undef;
2704 
2705     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
2706     XSRETURN(argvi);
2707   fail:
2708 
2709     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
2710     SWIG_croak_null();
2711   }
2712 }
2713 
2714 
XS(_wrap_gsl_root_fsolver_type_name_get)2715 XS(_wrap_gsl_root_fsolver_type_name_get) {
2716   {
2717     gsl_root_fsolver_type *arg1 = (gsl_root_fsolver_type *) 0 ;
2718     void *argp1 = 0 ;
2719     int res1 = 0 ;
2720     int argvi = 0;
2721     char *result = 0 ;
2722     dXSARGS;
2723 
2724     if ((items < 1) || (items > 1)) {
2725       SWIG_croak("Usage: gsl_root_fsolver_type_name_get(self);");
2726     }
2727     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_gsl_root_fsolver_type, 0 |  0 );
2728     if (!SWIG_IsOK(res1)) {
2729       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gsl_root_fsolver_type_name_get" "', argument " "1"" of type '" "gsl_root_fsolver_type *""'");
2730     }
2731     arg1 = (gsl_root_fsolver_type *)(argp1);
2732     result = (char *) ((arg1)->name);
2733     ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
2734 
2735     XSRETURN(argvi);
2736   fail:
2737 
2738     SWIG_croak_null();
2739   }
2740 }
2741 
2742 
XS(_wrap_gsl_root_fsolver_type_size_set)2743 XS(_wrap_gsl_root_fsolver_type_size_set) {
2744   {
2745     gsl_root_fsolver_type *arg1 = (gsl_root_fsolver_type *) 0 ;
2746     size_t arg2 ;
2747     void *argp1 = 0 ;
2748     int res1 = 0 ;
2749     size_t val2 ;
2750     int ecode2 = 0 ;
2751     int argvi = 0;
2752     dXSARGS;
2753 
2754     if ((items < 2) || (items > 2)) {
2755       SWIG_croak("Usage: gsl_root_fsolver_type_size_set(self,size);");
2756     }
2757     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_gsl_root_fsolver_type, 0 |  0 );
2758     if (!SWIG_IsOK(res1)) {
2759       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gsl_root_fsolver_type_size_set" "', argument " "1"" of type '" "gsl_root_fsolver_type *""'");
2760     }
2761     arg1 = (gsl_root_fsolver_type *)(argp1);
2762     ecode2 = SWIG_AsVal_size_t SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
2763     if (!SWIG_IsOK(ecode2)) {
2764       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "gsl_root_fsolver_type_size_set" "', argument " "2"" of type '" "size_t""'");
2765     }
2766     arg2 = (size_t)(val2);
2767     if (arg1) (arg1)->size = arg2;
2768     ST(argvi) = &PL_sv_undef;
2769 
2770 
2771     XSRETURN(argvi);
2772   fail:
2773 
2774 
2775     SWIG_croak_null();
2776   }
2777 }
2778 
2779 
XS(_wrap_gsl_root_fsolver_type_size_get)2780 XS(_wrap_gsl_root_fsolver_type_size_get) {
2781   {
2782     gsl_root_fsolver_type *arg1 = (gsl_root_fsolver_type *) 0 ;
2783     void *argp1 = 0 ;
2784     int res1 = 0 ;
2785     int argvi = 0;
2786     size_t result;
2787     dXSARGS;
2788 
2789     if ((items < 1) || (items > 1)) {
2790       SWIG_croak("Usage: gsl_root_fsolver_type_size_get(self);");
2791     }
2792     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_gsl_root_fsolver_type, 0 |  0 );
2793     if (!SWIG_IsOK(res1)) {
2794       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gsl_root_fsolver_type_size_get" "', argument " "1"" of type '" "gsl_root_fsolver_type *""'");
2795     }
2796     arg1 = (gsl_root_fsolver_type *)(argp1);
2797     result =  ((arg1)->size);
2798     ST(argvi) = SWIG_From_size_t  SWIG_PERL_CALL_ARGS_1((size_t)(result)); argvi++ ;
2799 
2800     XSRETURN(argvi);
2801   fail:
2802 
2803     SWIG_croak_null();
2804   }
2805 }
2806 
2807 
XS(_wrap_gsl_root_fsolver_type_set_set)2808 XS(_wrap_gsl_root_fsolver_type_set_set) {
2809   {
2810     gsl_root_fsolver_type *arg1 = (gsl_root_fsolver_type *) 0 ;
2811     int (*arg2)(void *,gsl_function *,double *,double,double) = (int (*)(void *,gsl_function *,double *,double,double)) 0 ;
2812     void *argp1 = 0 ;
2813     int res1 = 0 ;
2814     int argvi = 0;
2815     dXSARGS;
2816 
2817     if ((items < 2) || (items > 2)) {
2818       SWIG_croak("Usage: gsl_root_fsolver_type_set_set(self,set);");
2819     }
2820     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_gsl_root_fsolver_type, 0 |  0 );
2821     if (!SWIG_IsOK(res1)) {
2822       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gsl_root_fsolver_type_set_set" "', argument " "1"" of type '" "gsl_root_fsolver_type *""'");
2823     }
2824     arg1 = (gsl_root_fsolver_type *)(argp1);
2825     {
2826       int res = SWIG_ConvertFunctionPtr(ST(1), (void**)(&arg2), SWIGTYPE_p_f_p_void_p_gsl_function_p_double_double_double__int);
2827       if (!SWIG_IsOK(res)) {
2828         SWIG_exception_fail(SWIG_ArgError(res), "in method '" "gsl_root_fsolver_type_set_set" "', argument " "2"" of type '" "int (*)(void *,gsl_function *,double *,double,double)""'");
2829       }
2830     }
2831     if (arg1) (arg1)->set = arg2;
2832     ST(argvi) = &PL_sv_undef;
2833 
2834 
2835     XSRETURN(argvi);
2836   fail:
2837 
2838 
2839     SWIG_croak_null();
2840   }
2841 }
2842 
2843 
XS(_wrap_gsl_root_fsolver_type_set_get)2844 XS(_wrap_gsl_root_fsolver_type_set_get) {
2845   {
2846     gsl_root_fsolver_type *arg1 = (gsl_root_fsolver_type *) 0 ;
2847     void *argp1 = 0 ;
2848     int res1 = 0 ;
2849     int argvi = 0;
2850     int (*result)(void *,gsl_function *,double *,double,double) = 0 ;
2851     dXSARGS;
2852 
2853     if ((items < 1) || (items > 1)) {
2854       SWIG_croak("Usage: gsl_root_fsolver_type_set_get(self);");
2855     }
2856     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_gsl_root_fsolver_type, 0 |  0 );
2857     if (!SWIG_IsOK(res1)) {
2858       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gsl_root_fsolver_type_set_get" "', argument " "1"" of type '" "gsl_root_fsolver_type *""'");
2859     }
2860     arg1 = (gsl_root_fsolver_type *)(argp1);
2861     result = (int (*)(void *,gsl_function *,double *,double,double)) ((arg1)->set);
2862     ST(argvi) = SWIG_NewFunctionPtrObj((void *)(result), SWIGTYPE_p_f_p_void_p_gsl_function_p_double_double_double__int); argvi++ ;
2863 
2864     XSRETURN(argvi);
2865   fail:
2866 
2867     SWIG_croak_null();
2868   }
2869 }
2870 
2871 
XS(_wrap_gsl_root_fsolver_type_iterate_set)2872 XS(_wrap_gsl_root_fsolver_type_iterate_set) {
2873   {
2874     gsl_root_fsolver_type *arg1 = (gsl_root_fsolver_type *) 0 ;
2875     int (*arg2)(void *,gsl_function *,double *,double *,double *) = (int (*)(void *,gsl_function *,double *,double *,double *)) 0 ;
2876     void *argp1 = 0 ;
2877     int res1 = 0 ;
2878     int argvi = 0;
2879     dXSARGS;
2880 
2881     if ((items < 2) || (items > 2)) {
2882       SWIG_croak("Usage: gsl_root_fsolver_type_iterate_set(self,iterate);");
2883     }
2884     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_gsl_root_fsolver_type, 0 |  0 );
2885     if (!SWIG_IsOK(res1)) {
2886       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gsl_root_fsolver_type_iterate_set" "', argument " "1"" of type '" "gsl_root_fsolver_type *""'");
2887     }
2888     arg1 = (gsl_root_fsolver_type *)(argp1);
2889     {
2890       int res = SWIG_ConvertFunctionPtr(ST(1), (void**)(&arg2), SWIGTYPE_p_f_p_void_p_gsl_function_p_double_p_double_p_double__int);
2891       if (!SWIG_IsOK(res)) {
2892         SWIG_exception_fail(SWIG_ArgError(res), "in method '" "gsl_root_fsolver_type_iterate_set" "', argument " "2"" of type '" "int (*)(void *,gsl_function *,double *,double *,double *)""'");
2893       }
2894     }
2895     if (arg1) (arg1)->iterate = arg2;
2896     ST(argvi) = &PL_sv_undef;
2897 
2898 
2899     XSRETURN(argvi);
2900   fail:
2901 
2902 
2903     SWIG_croak_null();
2904   }
2905 }
2906 
2907 
XS(_wrap_gsl_root_fsolver_type_iterate_get)2908 XS(_wrap_gsl_root_fsolver_type_iterate_get) {
2909   {
2910     gsl_root_fsolver_type *arg1 = (gsl_root_fsolver_type *) 0 ;
2911     void *argp1 = 0 ;
2912     int res1 = 0 ;
2913     int argvi = 0;
2914     int (*result)(void *,gsl_function *,double *,double *,double *) = 0 ;
2915     dXSARGS;
2916 
2917     if ((items < 1) || (items > 1)) {
2918       SWIG_croak("Usage: gsl_root_fsolver_type_iterate_get(self);");
2919     }
2920     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_gsl_root_fsolver_type, 0 |  0 );
2921     if (!SWIG_IsOK(res1)) {
2922       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gsl_root_fsolver_type_iterate_get" "', argument " "1"" of type '" "gsl_root_fsolver_type *""'");
2923     }
2924     arg1 = (gsl_root_fsolver_type *)(argp1);
2925     result = (int (*)(void *,gsl_function *,double *,double *,double *)) ((arg1)->iterate);
2926     ST(argvi) = SWIG_NewFunctionPtrObj((void *)(result), SWIGTYPE_p_f_p_void_p_gsl_function_p_double_p_double_p_double__int); argvi++ ;
2927 
2928     XSRETURN(argvi);
2929   fail:
2930 
2931     SWIG_croak_null();
2932   }
2933 }
2934 
2935 
XS(_wrap_new_gsl_root_fsolver_type)2936 XS(_wrap_new_gsl_root_fsolver_type) {
2937   {
2938     int argvi = 0;
2939     gsl_root_fsolver_type *result = 0 ;
2940     dXSARGS;
2941 
2942     if ((items < 0) || (items > 0)) {
2943       SWIG_croak("Usage: new_gsl_root_fsolver_type();");
2944     }
2945     result = (gsl_root_fsolver_type *)calloc(1, sizeof(gsl_root_fsolver_type));
2946     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_gsl_root_fsolver_type, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
2947     XSRETURN(argvi);
2948   fail:
2949     SWIG_croak_null();
2950   }
2951 }
2952 
2953 
XS(_wrap_delete_gsl_root_fsolver_type)2954 XS(_wrap_delete_gsl_root_fsolver_type) {
2955   {
2956     gsl_root_fsolver_type *arg1 = (gsl_root_fsolver_type *) 0 ;
2957     void *argp1 = 0 ;
2958     int res1 = 0 ;
2959     int argvi = 0;
2960     dXSARGS;
2961 
2962     if ((items < 1) || (items > 1)) {
2963       SWIG_croak("Usage: delete_gsl_root_fsolver_type(self);");
2964     }
2965     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_gsl_root_fsolver_type, SWIG_POINTER_DISOWN |  0 );
2966     if (!SWIG_IsOK(res1)) {
2967       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_gsl_root_fsolver_type" "', argument " "1"" of type '" "gsl_root_fsolver_type *""'");
2968     }
2969     arg1 = (gsl_root_fsolver_type *)(argp1);
2970     free((char *) arg1);
2971     ST(argvi) = &PL_sv_undef;
2972 
2973     XSRETURN(argvi);
2974   fail:
2975 
2976     SWIG_croak_null();
2977   }
2978 }
2979 
2980 
XS(_wrap_delete_gsl_root_fsolver)2981 XS(_wrap_delete_gsl_root_fsolver) {
2982   {
2983     gsl_root_fsolver *arg1 = (gsl_root_fsolver *) 0 ;
2984     void *argp1 = 0 ;
2985     int res1 = 0 ;
2986     int argvi = 0;
2987     dXSARGS;
2988 
2989     if ((items < 1) || (items > 1)) {
2990       SWIG_croak("Usage: delete_gsl_root_fsolver(self);");
2991     }
2992     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_gsl_root_fsolver, SWIG_POINTER_DISOWN |  0 );
2993     if (!SWIG_IsOK(res1)) {
2994       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_gsl_root_fsolver" "', argument " "1"" of type '" "gsl_root_fsolver *""'");
2995     }
2996     arg1 = (gsl_root_fsolver *)(argp1);
2997     delete_gsl_root_fsolver(arg1);
2998     ST(argvi) = &PL_sv_undef;
2999 
3000     XSRETURN(argvi);
3001   fail:
3002 
3003     SWIG_croak_null();
3004   }
3005 }
3006 
3007 
XS(_wrap_gsl_root_fsolver_type_set)3008 XS(_wrap_gsl_root_fsolver_type_set) {
3009   {
3010     gsl_root_fsolver *arg1 = (gsl_root_fsolver *) 0 ;
3011     gsl_root_fsolver_type *arg2 = (gsl_root_fsolver_type *) 0 ;
3012     void *argp1 = 0 ;
3013     int res1 = 0 ;
3014     void *argp2 = 0 ;
3015     int res2 = 0 ;
3016     int argvi = 0;
3017     dXSARGS;
3018 
3019     if ((items < 2) || (items > 2)) {
3020       SWIG_croak("Usage: gsl_root_fsolver_type_set(self,type);");
3021     }
3022     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_gsl_root_fsolver, 0 |  0 );
3023     if (!SWIG_IsOK(res1)) {
3024       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gsl_root_fsolver_type_set" "', argument " "1"" of type '" "gsl_root_fsolver *""'");
3025     }
3026     arg1 = (gsl_root_fsolver *)(argp1);
3027     res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_gsl_root_fsolver_type, SWIG_POINTER_DISOWN |  0 );
3028     if (!SWIG_IsOK(res2)) {
3029       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "gsl_root_fsolver_type_set" "', argument " "2"" of type '" "gsl_root_fsolver_type const *""'");
3030     }
3031     arg2 = (gsl_root_fsolver_type *)(argp2);
3032     if (arg1) (arg1)->type = (gsl_root_fsolver_type const *)arg2;
3033     ST(argvi) = &PL_sv_undef;
3034 
3035 
3036     XSRETURN(argvi);
3037   fail:
3038 
3039 
3040     SWIG_croak_null();
3041   }
3042 }
3043 
3044 
XS(_wrap_gsl_root_fsolver_type_get)3045 XS(_wrap_gsl_root_fsolver_type_get) {
3046   {
3047     gsl_root_fsolver *arg1 = (gsl_root_fsolver *) 0 ;
3048     void *argp1 = 0 ;
3049     int res1 = 0 ;
3050     int argvi = 0;
3051     gsl_root_fsolver_type *result = 0 ;
3052     dXSARGS;
3053 
3054     if ((items < 1) || (items > 1)) {
3055       SWIG_croak("Usage: gsl_root_fsolver_type_get(self);");
3056     }
3057     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_gsl_root_fsolver, 0 |  0 );
3058     if (!SWIG_IsOK(res1)) {
3059       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gsl_root_fsolver_type_get" "', argument " "1"" of type '" "gsl_root_fsolver *""'");
3060     }
3061     arg1 = (gsl_root_fsolver *)(argp1);
3062     result = (gsl_root_fsolver_type *) ((arg1)->type);
3063     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_gsl_root_fsolver_type, 0 | SWIG_SHADOW); argvi++ ;
3064 
3065     XSRETURN(argvi);
3066   fail:
3067 
3068     SWIG_croak_null();
3069   }
3070 }
3071 
3072 
XS(_wrap_gsl_root_fsolver_function_set)3073 XS(_wrap_gsl_root_fsolver_function_set) {
3074   {
3075     gsl_root_fsolver *arg1 = (gsl_root_fsolver *) 0 ;
3076     gsl_function *arg2 = (gsl_function *) 0 ;
3077     void *argp1 = 0 ;
3078     int res1 = 0 ;
3079     int argvi = 0;
3080     dXSARGS;
3081 
3082     if ((items < 2) || (items > 2)) {
3083       SWIG_croak("Usage: gsl_root_fsolver_function_set(self,function);");
3084     }
3085     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_gsl_root_fsolver, 0 |  0 );
3086     if (!SWIG_IsOK(res1)) {
3087       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gsl_root_fsolver_function_set" "', argument " "1"" of type '" "gsl_root_fsolver *""'");
3088     }
3089     arg1 = (gsl_root_fsolver *)(argp1);
3090     {
3091       SV * function = 0;
3092       SV * params = 0;
3093       struct gsl_function_perl *w_gsl_function;
3094       Newx(w_gsl_function, 1, struct gsl_function_perl);
3095 
3096       if (SvROK(ST(1)) && (SvTYPE(SvRV(ST(1))) == SVt_PVAV)) {
3097         AV* array=(AV*)SvRV(ST(1));
3098         SV ** p_function = 0;
3099         if (av_len(array)<0) {
3100           croak("Math::GSL : $function is an empty array!");
3101         }
3102         if (av_len(array)>1) {
3103           croak("Math::GSL : $function is an array with more than 2 elements!");
3104         }
3105         p_function = av_fetch(array, 0, 0);
3106         function = *p_function;
3107         if (av_len(array)>0) {
3108           SV ** p_params = 0;
3109           p_params = av_fetch(array, 1, 0);
3110           params = *p_params;
3111         }
3112       } else {
3113         function = ST(1);
3114       }
3115 
3116       if (!function || !(SvPOK(function) || (SvROK(function) && (SvTYPE(SvRV(function)) == SVt_PVCV)))) {
3117         croak("Math::GSL : $function is not a reference to code!");
3118       }
3119 
3120       function = newSVsv(function);
3121 
3122       if (! params) {
3123         params=&PL_sv_undef;
3124       }
3125       params = newSVsv(params);
3126 
3127       w_gsl_function->params = params;
3128       w_gsl_function->function = function;
3129       w_gsl_function->C_gsl_function.params = w_gsl_function;
3130       w_gsl_function->C_gsl_function.function = &call_gsl_function;
3131 
3132       arg2 = &(w_gsl_function->C_gsl_function);
3133     }
3134     if (arg1) (arg1)->function = arg2;
3135     ST(argvi) = &PL_sv_undef;
3136 
3137 
3138     XSRETURN(argvi);
3139   fail:
3140 
3141 
3142     SWIG_croak_null();
3143   }
3144 }
3145 
3146 
XS(_wrap_gsl_root_fsolver_function_get)3147 XS(_wrap_gsl_root_fsolver_function_get) {
3148   {
3149     gsl_root_fsolver *arg1 = (gsl_root_fsolver *) 0 ;
3150     void *argp1 = 0 ;
3151     int res1 = 0 ;
3152     int argvi = 0;
3153     gsl_function *result = 0 ;
3154     dXSARGS;
3155 
3156     if ((items < 1) || (items > 1)) {
3157       SWIG_croak("Usage: gsl_root_fsolver_function_get(self);");
3158     }
3159     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_gsl_root_fsolver, 0 |  0 );
3160     if (!SWIG_IsOK(res1)) {
3161       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gsl_root_fsolver_function_get" "', argument " "1"" of type '" "gsl_root_fsolver *""'");
3162     }
3163     arg1 = (gsl_root_fsolver *)(argp1);
3164     result = (gsl_function *) ((arg1)->function);
3165     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_gsl_function, 0 | 0); argvi++ ;
3166 
3167     XSRETURN(argvi);
3168   fail:
3169 
3170     SWIG_croak_null();
3171   }
3172 }
3173 
3174 
XS(_wrap_gsl_root_fsolver_root_set)3175 XS(_wrap_gsl_root_fsolver_root_set) {
3176   {
3177     gsl_root_fsolver *arg1 = (gsl_root_fsolver *) 0 ;
3178     double arg2 ;
3179     void *argp1 = 0 ;
3180     int res1 = 0 ;
3181     double val2 ;
3182     int ecode2 = 0 ;
3183     int argvi = 0;
3184     dXSARGS;
3185 
3186     if ((items < 2) || (items > 2)) {
3187       SWIG_croak("Usage: gsl_root_fsolver_root_set(self,root);");
3188     }
3189     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_gsl_root_fsolver, 0 |  0 );
3190     if (!SWIG_IsOK(res1)) {
3191       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gsl_root_fsolver_root_set" "', argument " "1"" of type '" "gsl_root_fsolver *""'");
3192     }
3193     arg1 = (gsl_root_fsolver *)(argp1);
3194     ecode2 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
3195     if (!SWIG_IsOK(ecode2)) {
3196       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "gsl_root_fsolver_root_set" "', argument " "2"" of type '" "double""'");
3197     }
3198     arg2 = (double)(val2);
3199     if (arg1) (arg1)->root = arg2;
3200     ST(argvi) = &PL_sv_undef;
3201 
3202 
3203     XSRETURN(argvi);
3204   fail:
3205 
3206 
3207     SWIG_croak_null();
3208   }
3209 }
3210 
3211 
XS(_wrap_gsl_root_fsolver_root_get)3212 XS(_wrap_gsl_root_fsolver_root_get) {
3213   {
3214     gsl_root_fsolver *arg1 = (gsl_root_fsolver *) 0 ;
3215     void *argp1 = 0 ;
3216     int res1 = 0 ;
3217     int argvi = 0;
3218     double result;
3219     dXSARGS;
3220 
3221     if ((items < 1) || (items > 1)) {
3222       SWIG_croak("Usage: gsl_root_fsolver_root_get(self);");
3223     }
3224     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_gsl_root_fsolver, 0 |  0 );
3225     if (!SWIG_IsOK(res1)) {
3226       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gsl_root_fsolver_root_get" "', argument " "1"" of type '" "gsl_root_fsolver *""'");
3227     }
3228     arg1 = (gsl_root_fsolver *)(argp1);
3229     result = (double) ((arg1)->root);
3230     ST(argvi) = SWIG_From_double  SWIG_PERL_CALL_ARGS_1((double)(result)); argvi++ ;
3231 
3232     XSRETURN(argvi);
3233   fail:
3234 
3235     SWIG_croak_null();
3236   }
3237 }
3238 
3239 
XS(_wrap_gsl_root_fsolver_x_lower_set)3240 XS(_wrap_gsl_root_fsolver_x_lower_set) {
3241   {
3242     gsl_root_fsolver *arg1 = (gsl_root_fsolver *) 0 ;
3243     double arg2 ;
3244     void *argp1 = 0 ;
3245     int res1 = 0 ;
3246     double val2 ;
3247     int ecode2 = 0 ;
3248     int argvi = 0;
3249     dXSARGS;
3250 
3251     if ((items < 2) || (items > 2)) {
3252       SWIG_croak("Usage: gsl_root_fsolver_x_lower_set(self,x_lower);");
3253     }
3254     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_gsl_root_fsolver, 0 |  0 );
3255     if (!SWIG_IsOK(res1)) {
3256       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gsl_root_fsolver_x_lower_set" "', argument " "1"" of type '" "gsl_root_fsolver *""'");
3257     }
3258     arg1 = (gsl_root_fsolver *)(argp1);
3259     ecode2 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
3260     if (!SWIG_IsOK(ecode2)) {
3261       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "gsl_root_fsolver_x_lower_set" "', argument " "2"" of type '" "double""'");
3262     }
3263     arg2 = (double)(val2);
3264     if (arg1) (arg1)->x_lower = arg2;
3265     ST(argvi) = &PL_sv_undef;
3266 
3267 
3268     XSRETURN(argvi);
3269   fail:
3270 
3271 
3272     SWIG_croak_null();
3273   }
3274 }
3275 
3276 
XS(_wrap_gsl_root_fsolver_x_lower_get)3277 XS(_wrap_gsl_root_fsolver_x_lower_get) {
3278   {
3279     gsl_root_fsolver *arg1 = (gsl_root_fsolver *) 0 ;
3280     void *argp1 = 0 ;
3281     int res1 = 0 ;
3282     int argvi = 0;
3283     double result;
3284     dXSARGS;
3285 
3286     if ((items < 1) || (items > 1)) {
3287       SWIG_croak("Usage: gsl_root_fsolver_x_lower_get(self);");
3288     }
3289     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_gsl_root_fsolver, 0 |  0 );
3290     if (!SWIG_IsOK(res1)) {
3291       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gsl_root_fsolver_x_lower_get" "', argument " "1"" of type '" "gsl_root_fsolver *""'");
3292     }
3293     arg1 = (gsl_root_fsolver *)(argp1);
3294     result = (double) ((arg1)->x_lower);
3295     ST(argvi) = SWIG_From_double  SWIG_PERL_CALL_ARGS_1((double)(result)); argvi++ ;
3296 
3297     XSRETURN(argvi);
3298   fail:
3299 
3300     SWIG_croak_null();
3301   }
3302 }
3303 
3304 
XS(_wrap_gsl_root_fsolver_x_upper_set)3305 XS(_wrap_gsl_root_fsolver_x_upper_set) {
3306   {
3307     gsl_root_fsolver *arg1 = (gsl_root_fsolver *) 0 ;
3308     double arg2 ;
3309     void *argp1 = 0 ;
3310     int res1 = 0 ;
3311     double val2 ;
3312     int ecode2 = 0 ;
3313     int argvi = 0;
3314     dXSARGS;
3315 
3316     if ((items < 2) || (items > 2)) {
3317       SWIG_croak("Usage: gsl_root_fsolver_x_upper_set(self,x_upper);");
3318     }
3319     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_gsl_root_fsolver, 0 |  0 );
3320     if (!SWIG_IsOK(res1)) {
3321       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gsl_root_fsolver_x_upper_set" "', argument " "1"" of type '" "gsl_root_fsolver *""'");
3322     }
3323     arg1 = (gsl_root_fsolver *)(argp1);
3324     ecode2 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
3325     if (!SWIG_IsOK(ecode2)) {
3326       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "gsl_root_fsolver_x_upper_set" "', argument " "2"" of type '" "double""'");
3327     }
3328     arg2 = (double)(val2);
3329     if (arg1) (arg1)->x_upper = arg2;
3330     ST(argvi) = &PL_sv_undef;
3331 
3332 
3333     XSRETURN(argvi);
3334   fail:
3335 
3336 
3337     SWIG_croak_null();
3338   }
3339 }
3340 
3341 
XS(_wrap_gsl_root_fsolver_x_upper_get)3342 XS(_wrap_gsl_root_fsolver_x_upper_get) {
3343   {
3344     gsl_root_fsolver *arg1 = (gsl_root_fsolver *) 0 ;
3345     void *argp1 = 0 ;
3346     int res1 = 0 ;
3347     int argvi = 0;
3348     double result;
3349     dXSARGS;
3350 
3351     if ((items < 1) || (items > 1)) {
3352       SWIG_croak("Usage: gsl_root_fsolver_x_upper_get(self);");
3353     }
3354     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_gsl_root_fsolver, 0 |  0 );
3355     if (!SWIG_IsOK(res1)) {
3356       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gsl_root_fsolver_x_upper_get" "', argument " "1"" of type '" "gsl_root_fsolver *""'");
3357     }
3358     arg1 = (gsl_root_fsolver *)(argp1);
3359     result = (double) ((arg1)->x_upper);
3360     ST(argvi) = SWIG_From_double  SWIG_PERL_CALL_ARGS_1((double)(result)); argvi++ ;
3361 
3362     XSRETURN(argvi);
3363   fail:
3364 
3365     SWIG_croak_null();
3366   }
3367 }
3368 
3369 
XS(_wrap_gsl_root_fsolver_state_set)3370 XS(_wrap_gsl_root_fsolver_state_set) {
3371   {
3372     gsl_root_fsolver *arg1 = (gsl_root_fsolver *) 0 ;
3373     void *arg2 = (void *) 0 ;
3374     void *argp1 = 0 ;
3375     int res1 = 0 ;
3376     int res2 ;
3377     int argvi = 0;
3378     dXSARGS;
3379 
3380     if ((items < 2) || (items > 2)) {
3381       SWIG_croak("Usage: gsl_root_fsolver_state_set(self,state);");
3382     }
3383     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_gsl_root_fsolver, 0 |  0 );
3384     if (!SWIG_IsOK(res1)) {
3385       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gsl_root_fsolver_state_set" "', argument " "1"" of type '" "gsl_root_fsolver *""'");
3386     }
3387     arg1 = (gsl_root_fsolver *)(argp1);
3388     res2 = SWIG_ConvertPtr(ST(1),SWIG_as_voidptrptr(&arg2), 0, SWIG_POINTER_DISOWN);
3389     if (!SWIG_IsOK(res2)) {
3390       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "gsl_root_fsolver_state_set" "', argument " "2"" of type '" "void *""'");
3391     }
3392     if (arg1) (arg1)->state = arg2;
3393     ST(argvi) = &PL_sv_undef;
3394 
3395 
3396     XSRETURN(argvi);
3397   fail:
3398 
3399 
3400     SWIG_croak_null();
3401   }
3402 }
3403 
3404 
XS(_wrap_gsl_root_fsolver_state_get)3405 XS(_wrap_gsl_root_fsolver_state_get) {
3406   {
3407     gsl_root_fsolver *arg1 = (gsl_root_fsolver *) 0 ;
3408     void *argp1 = 0 ;
3409     int res1 = 0 ;
3410     int argvi = 0;
3411     void *result = 0 ;
3412     dXSARGS;
3413 
3414     if ((items < 1) || (items > 1)) {
3415       SWIG_croak("Usage: gsl_root_fsolver_state_get(self);");
3416     }
3417     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_gsl_root_fsolver, 0 |  0 );
3418     if (!SWIG_IsOK(res1)) {
3419       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gsl_root_fsolver_state_get" "', argument " "1"" of type '" "gsl_root_fsolver *""'");
3420     }
3421     arg1 = (gsl_root_fsolver *)(argp1);
3422     result = (void *) ((arg1)->state);
3423     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 | 0); argvi++ ;
3424 
3425     XSRETURN(argvi);
3426   fail:
3427 
3428     SWIG_croak_null();
3429   }
3430 }
3431 
3432 
XS(_wrap_new_gsl_root_fsolver)3433 XS(_wrap_new_gsl_root_fsolver) {
3434   {
3435     int argvi = 0;
3436     gsl_root_fsolver *result = 0 ;
3437     dXSARGS;
3438 
3439     if ((items < 0) || (items > 0)) {
3440       SWIG_croak("Usage: new_gsl_root_fsolver();");
3441     }
3442     result = (gsl_root_fsolver *)calloc(1, sizeof(gsl_root_fsolver));
3443     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_gsl_root_fsolver, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
3444     XSRETURN(argvi);
3445   fail:
3446     SWIG_croak_null();
3447   }
3448 }
3449 
3450 
XS(_wrap_gsl_root_fdfsolver_type_name_set)3451 XS(_wrap_gsl_root_fdfsolver_type_name_set) {
3452   {
3453     gsl_root_fdfsolver_type *arg1 = (gsl_root_fdfsolver_type *) 0 ;
3454     char *arg2 = (char *) 0 ;
3455     void *argp1 = 0 ;
3456     int res1 = 0 ;
3457     int res2 ;
3458     char *buf2 = 0 ;
3459     int alloc2 = 0 ;
3460     int argvi = 0;
3461     dXSARGS;
3462 
3463     if ((items < 2) || (items > 2)) {
3464       SWIG_croak("Usage: gsl_root_fdfsolver_type_name_set(self,name);");
3465     }
3466     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_gsl_root_fdfsolver_type, 0 |  0 );
3467     if (!SWIG_IsOK(res1)) {
3468       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gsl_root_fdfsolver_type_name_set" "', argument " "1"" of type '" "gsl_root_fdfsolver_type *""'");
3469     }
3470     arg1 = (gsl_root_fdfsolver_type *)(argp1);
3471     res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
3472     if (!SWIG_IsOK(res2)) {
3473       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "gsl_root_fdfsolver_type_name_set" "', argument " "2"" of type '" "char const *""'");
3474     }
3475     arg2 = (char *)(buf2);
3476     if (arg2) {
3477       size_t size = strlen((const char *)((const char *)(arg2))) + 1;
3478       arg1->name = (char const *)(char *)memcpy(malloc((size)*sizeof(char)), arg2, sizeof(char)*(size));
3479     } else {
3480       arg1->name = 0;
3481     }
3482     ST(argvi) = &PL_sv_undef;
3483 
3484     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
3485     XSRETURN(argvi);
3486   fail:
3487 
3488     if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
3489     SWIG_croak_null();
3490   }
3491 }
3492 
3493 
XS(_wrap_gsl_root_fdfsolver_type_name_get)3494 XS(_wrap_gsl_root_fdfsolver_type_name_get) {
3495   {
3496     gsl_root_fdfsolver_type *arg1 = (gsl_root_fdfsolver_type *) 0 ;
3497     void *argp1 = 0 ;
3498     int res1 = 0 ;
3499     int argvi = 0;
3500     char *result = 0 ;
3501     dXSARGS;
3502 
3503     if ((items < 1) || (items > 1)) {
3504       SWIG_croak("Usage: gsl_root_fdfsolver_type_name_get(self);");
3505     }
3506     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_gsl_root_fdfsolver_type, 0 |  0 );
3507     if (!SWIG_IsOK(res1)) {
3508       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gsl_root_fdfsolver_type_name_get" "', argument " "1"" of type '" "gsl_root_fdfsolver_type *""'");
3509     }
3510     arg1 = (gsl_root_fdfsolver_type *)(argp1);
3511     result = (char *) ((arg1)->name);
3512     ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
3513 
3514     XSRETURN(argvi);
3515   fail:
3516 
3517     SWIG_croak_null();
3518   }
3519 }
3520 
3521 
XS(_wrap_gsl_root_fdfsolver_type_size_set)3522 XS(_wrap_gsl_root_fdfsolver_type_size_set) {
3523   {
3524     gsl_root_fdfsolver_type *arg1 = (gsl_root_fdfsolver_type *) 0 ;
3525     size_t arg2 ;
3526     void *argp1 = 0 ;
3527     int res1 = 0 ;
3528     size_t val2 ;
3529     int ecode2 = 0 ;
3530     int argvi = 0;
3531     dXSARGS;
3532 
3533     if ((items < 2) || (items > 2)) {
3534       SWIG_croak("Usage: gsl_root_fdfsolver_type_size_set(self,size);");
3535     }
3536     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_gsl_root_fdfsolver_type, 0 |  0 );
3537     if (!SWIG_IsOK(res1)) {
3538       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gsl_root_fdfsolver_type_size_set" "', argument " "1"" of type '" "gsl_root_fdfsolver_type *""'");
3539     }
3540     arg1 = (gsl_root_fdfsolver_type *)(argp1);
3541     ecode2 = SWIG_AsVal_size_t SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
3542     if (!SWIG_IsOK(ecode2)) {
3543       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "gsl_root_fdfsolver_type_size_set" "', argument " "2"" of type '" "size_t""'");
3544     }
3545     arg2 = (size_t)(val2);
3546     if (arg1) (arg1)->size = arg2;
3547     ST(argvi) = &PL_sv_undef;
3548 
3549 
3550     XSRETURN(argvi);
3551   fail:
3552 
3553 
3554     SWIG_croak_null();
3555   }
3556 }
3557 
3558 
XS(_wrap_gsl_root_fdfsolver_type_size_get)3559 XS(_wrap_gsl_root_fdfsolver_type_size_get) {
3560   {
3561     gsl_root_fdfsolver_type *arg1 = (gsl_root_fdfsolver_type *) 0 ;
3562     void *argp1 = 0 ;
3563     int res1 = 0 ;
3564     int argvi = 0;
3565     size_t result;
3566     dXSARGS;
3567 
3568     if ((items < 1) || (items > 1)) {
3569       SWIG_croak("Usage: gsl_root_fdfsolver_type_size_get(self);");
3570     }
3571     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_gsl_root_fdfsolver_type, 0 |  0 );
3572     if (!SWIG_IsOK(res1)) {
3573       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gsl_root_fdfsolver_type_size_get" "', argument " "1"" of type '" "gsl_root_fdfsolver_type *""'");
3574     }
3575     arg1 = (gsl_root_fdfsolver_type *)(argp1);
3576     result =  ((arg1)->size);
3577     ST(argvi) = SWIG_From_size_t  SWIG_PERL_CALL_ARGS_1((size_t)(result)); argvi++ ;
3578 
3579     XSRETURN(argvi);
3580   fail:
3581 
3582     SWIG_croak_null();
3583   }
3584 }
3585 
3586 
XS(_wrap_gsl_root_fdfsolver_type_set_set)3587 XS(_wrap_gsl_root_fdfsolver_type_set_set) {
3588   {
3589     gsl_root_fdfsolver_type *arg1 = (gsl_root_fdfsolver_type *) 0 ;
3590     int (*arg2)(void *,gsl_function_fdf *,double *) = (int (*)(void *,gsl_function_fdf *,double *)) 0 ;
3591     void *argp1 = 0 ;
3592     int res1 = 0 ;
3593     int argvi = 0;
3594     dXSARGS;
3595 
3596     if ((items < 2) || (items > 2)) {
3597       SWIG_croak("Usage: gsl_root_fdfsolver_type_set_set(self,set);");
3598     }
3599     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_gsl_root_fdfsolver_type, 0 |  0 );
3600     if (!SWIG_IsOK(res1)) {
3601       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gsl_root_fdfsolver_type_set_set" "', argument " "1"" of type '" "gsl_root_fdfsolver_type *""'");
3602     }
3603     arg1 = (gsl_root_fdfsolver_type *)(argp1);
3604     {
3605       int res = SWIG_ConvertFunctionPtr(ST(1), (void**)(&arg2), SWIGTYPE_p_f_p_void_p_gsl_function_fdf_p_double__int);
3606       if (!SWIG_IsOK(res)) {
3607         SWIG_exception_fail(SWIG_ArgError(res), "in method '" "gsl_root_fdfsolver_type_set_set" "', argument " "2"" of type '" "int (*)(void *,gsl_function_fdf *,double *)""'");
3608       }
3609     }
3610     if (arg1) (arg1)->set = arg2;
3611     ST(argvi) = &PL_sv_undef;
3612 
3613 
3614     XSRETURN(argvi);
3615   fail:
3616 
3617 
3618     SWIG_croak_null();
3619   }
3620 }
3621 
3622 
XS(_wrap_gsl_root_fdfsolver_type_set_get)3623 XS(_wrap_gsl_root_fdfsolver_type_set_get) {
3624   {
3625     gsl_root_fdfsolver_type *arg1 = (gsl_root_fdfsolver_type *) 0 ;
3626     void *argp1 = 0 ;
3627     int res1 = 0 ;
3628     int argvi = 0;
3629     int (*result)(void *,gsl_function_fdf *,double *) = 0 ;
3630     dXSARGS;
3631 
3632     if ((items < 1) || (items > 1)) {
3633       SWIG_croak("Usage: gsl_root_fdfsolver_type_set_get(self);");
3634     }
3635     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_gsl_root_fdfsolver_type, 0 |  0 );
3636     if (!SWIG_IsOK(res1)) {
3637       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gsl_root_fdfsolver_type_set_get" "', argument " "1"" of type '" "gsl_root_fdfsolver_type *""'");
3638     }
3639     arg1 = (gsl_root_fdfsolver_type *)(argp1);
3640     result = (int (*)(void *,gsl_function_fdf *,double *)) ((arg1)->set);
3641     ST(argvi) = SWIG_NewFunctionPtrObj((void *)(result), SWIGTYPE_p_f_p_void_p_gsl_function_fdf_p_double__int); argvi++ ;
3642 
3643     XSRETURN(argvi);
3644   fail:
3645 
3646     SWIG_croak_null();
3647   }
3648 }
3649 
3650 
XS(_wrap_gsl_root_fdfsolver_type_iterate_set)3651 XS(_wrap_gsl_root_fdfsolver_type_iterate_set) {
3652   {
3653     gsl_root_fdfsolver_type *arg1 = (gsl_root_fdfsolver_type *) 0 ;
3654     int (*arg2)(void *,gsl_function_fdf *,double *) = (int (*)(void *,gsl_function_fdf *,double *)) 0 ;
3655     void *argp1 = 0 ;
3656     int res1 = 0 ;
3657     int argvi = 0;
3658     dXSARGS;
3659 
3660     if ((items < 2) || (items > 2)) {
3661       SWIG_croak("Usage: gsl_root_fdfsolver_type_iterate_set(self,iterate);");
3662     }
3663     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_gsl_root_fdfsolver_type, 0 |  0 );
3664     if (!SWIG_IsOK(res1)) {
3665       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gsl_root_fdfsolver_type_iterate_set" "', argument " "1"" of type '" "gsl_root_fdfsolver_type *""'");
3666     }
3667     arg1 = (gsl_root_fdfsolver_type *)(argp1);
3668     {
3669       int res = SWIG_ConvertFunctionPtr(ST(1), (void**)(&arg2), SWIGTYPE_p_f_p_void_p_gsl_function_fdf_p_double__int);
3670       if (!SWIG_IsOK(res)) {
3671         SWIG_exception_fail(SWIG_ArgError(res), "in method '" "gsl_root_fdfsolver_type_iterate_set" "', argument " "2"" of type '" "int (*)(void *,gsl_function_fdf *,double *)""'");
3672       }
3673     }
3674     if (arg1) (arg1)->iterate = arg2;
3675     ST(argvi) = &PL_sv_undef;
3676 
3677 
3678     XSRETURN(argvi);
3679   fail:
3680 
3681 
3682     SWIG_croak_null();
3683   }
3684 }
3685 
3686 
XS(_wrap_gsl_root_fdfsolver_type_iterate_get)3687 XS(_wrap_gsl_root_fdfsolver_type_iterate_get) {
3688   {
3689     gsl_root_fdfsolver_type *arg1 = (gsl_root_fdfsolver_type *) 0 ;
3690     void *argp1 = 0 ;
3691     int res1 = 0 ;
3692     int argvi = 0;
3693     int (*result)(void *,gsl_function_fdf *,double *) = 0 ;
3694     dXSARGS;
3695 
3696     if ((items < 1) || (items > 1)) {
3697       SWIG_croak("Usage: gsl_root_fdfsolver_type_iterate_get(self);");
3698     }
3699     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_gsl_root_fdfsolver_type, 0 |  0 );
3700     if (!SWIG_IsOK(res1)) {
3701       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gsl_root_fdfsolver_type_iterate_get" "', argument " "1"" of type '" "gsl_root_fdfsolver_type *""'");
3702     }
3703     arg1 = (gsl_root_fdfsolver_type *)(argp1);
3704     result = (int (*)(void *,gsl_function_fdf *,double *)) ((arg1)->iterate);
3705     ST(argvi) = SWIG_NewFunctionPtrObj((void *)(result), SWIGTYPE_p_f_p_void_p_gsl_function_fdf_p_double__int); argvi++ ;
3706 
3707     XSRETURN(argvi);
3708   fail:
3709 
3710     SWIG_croak_null();
3711   }
3712 }
3713 
3714 
XS(_wrap_new_gsl_root_fdfsolver_type)3715 XS(_wrap_new_gsl_root_fdfsolver_type) {
3716   {
3717     int argvi = 0;
3718     gsl_root_fdfsolver_type *result = 0 ;
3719     dXSARGS;
3720 
3721     if ((items < 0) || (items > 0)) {
3722       SWIG_croak("Usage: new_gsl_root_fdfsolver_type();");
3723     }
3724     result = (gsl_root_fdfsolver_type *)calloc(1, sizeof(gsl_root_fdfsolver_type));
3725     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_gsl_root_fdfsolver_type, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
3726     XSRETURN(argvi);
3727   fail:
3728     SWIG_croak_null();
3729   }
3730 }
3731 
3732 
XS(_wrap_delete_gsl_root_fdfsolver_type)3733 XS(_wrap_delete_gsl_root_fdfsolver_type) {
3734   {
3735     gsl_root_fdfsolver_type *arg1 = (gsl_root_fdfsolver_type *) 0 ;
3736     void *argp1 = 0 ;
3737     int res1 = 0 ;
3738     int argvi = 0;
3739     dXSARGS;
3740 
3741     if ((items < 1) || (items > 1)) {
3742       SWIG_croak("Usage: delete_gsl_root_fdfsolver_type(self);");
3743     }
3744     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_gsl_root_fdfsolver_type, SWIG_POINTER_DISOWN |  0 );
3745     if (!SWIG_IsOK(res1)) {
3746       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_gsl_root_fdfsolver_type" "', argument " "1"" of type '" "gsl_root_fdfsolver_type *""'");
3747     }
3748     arg1 = (gsl_root_fdfsolver_type *)(argp1);
3749     free((char *) arg1);
3750     ST(argvi) = &PL_sv_undef;
3751 
3752     XSRETURN(argvi);
3753   fail:
3754 
3755     SWIG_croak_null();
3756   }
3757 }
3758 
3759 
XS(_wrap_delete_gsl_root_fdfsolver)3760 XS(_wrap_delete_gsl_root_fdfsolver) {
3761   {
3762     gsl_root_fdfsolver *arg1 = (gsl_root_fdfsolver *) 0 ;
3763     void *argp1 = 0 ;
3764     int res1 = 0 ;
3765     int argvi = 0;
3766     dXSARGS;
3767 
3768     if ((items < 1) || (items > 1)) {
3769       SWIG_croak("Usage: delete_gsl_root_fdfsolver(self);");
3770     }
3771     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_gsl_root_fdfsolver, SWIG_POINTER_DISOWN |  0 );
3772     if (!SWIG_IsOK(res1)) {
3773       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_gsl_root_fdfsolver" "', argument " "1"" of type '" "gsl_root_fdfsolver *""'");
3774     }
3775     arg1 = (gsl_root_fdfsolver *)(argp1);
3776     delete_gsl_root_fdfsolver(arg1);
3777     ST(argvi) = &PL_sv_undef;
3778 
3779     XSRETURN(argvi);
3780   fail:
3781 
3782     SWIG_croak_null();
3783   }
3784 }
3785 
3786 
XS(_wrap_gsl_root_fdfsolver_type_set)3787 XS(_wrap_gsl_root_fdfsolver_type_set) {
3788   {
3789     gsl_root_fdfsolver *arg1 = (gsl_root_fdfsolver *) 0 ;
3790     gsl_root_fdfsolver_type *arg2 = (gsl_root_fdfsolver_type *) 0 ;
3791     void *argp1 = 0 ;
3792     int res1 = 0 ;
3793     void *argp2 = 0 ;
3794     int res2 = 0 ;
3795     int argvi = 0;
3796     dXSARGS;
3797 
3798     if ((items < 2) || (items > 2)) {
3799       SWIG_croak("Usage: gsl_root_fdfsolver_type_set(self,type);");
3800     }
3801     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_gsl_root_fdfsolver, 0 |  0 );
3802     if (!SWIG_IsOK(res1)) {
3803       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gsl_root_fdfsolver_type_set" "', argument " "1"" of type '" "gsl_root_fdfsolver *""'");
3804     }
3805     arg1 = (gsl_root_fdfsolver *)(argp1);
3806     res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_gsl_root_fdfsolver_type, SWIG_POINTER_DISOWN |  0 );
3807     if (!SWIG_IsOK(res2)) {
3808       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "gsl_root_fdfsolver_type_set" "', argument " "2"" of type '" "gsl_root_fdfsolver_type const *""'");
3809     }
3810     arg2 = (gsl_root_fdfsolver_type *)(argp2);
3811     if (arg1) (arg1)->type = (gsl_root_fdfsolver_type const *)arg2;
3812     ST(argvi) = &PL_sv_undef;
3813 
3814 
3815     XSRETURN(argvi);
3816   fail:
3817 
3818 
3819     SWIG_croak_null();
3820   }
3821 }
3822 
3823 
XS(_wrap_gsl_root_fdfsolver_type_get)3824 XS(_wrap_gsl_root_fdfsolver_type_get) {
3825   {
3826     gsl_root_fdfsolver *arg1 = (gsl_root_fdfsolver *) 0 ;
3827     void *argp1 = 0 ;
3828     int res1 = 0 ;
3829     int argvi = 0;
3830     gsl_root_fdfsolver_type *result = 0 ;
3831     dXSARGS;
3832 
3833     if ((items < 1) || (items > 1)) {
3834       SWIG_croak("Usage: gsl_root_fdfsolver_type_get(self);");
3835     }
3836     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_gsl_root_fdfsolver, 0 |  0 );
3837     if (!SWIG_IsOK(res1)) {
3838       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gsl_root_fdfsolver_type_get" "', argument " "1"" of type '" "gsl_root_fdfsolver *""'");
3839     }
3840     arg1 = (gsl_root_fdfsolver *)(argp1);
3841     result = (gsl_root_fdfsolver_type *) ((arg1)->type);
3842     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_gsl_root_fdfsolver_type, 0 | SWIG_SHADOW); argvi++ ;
3843 
3844     XSRETURN(argvi);
3845   fail:
3846 
3847     SWIG_croak_null();
3848   }
3849 }
3850 
3851 
XS(_wrap_gsl_root_fdfsolver_fdf_set)3852 XS(_wrap_gsl_root_fdfsolver_fdf_set) {
3853   {
3854     gsl_root_fdfsolver *arg1 = (gsl_root_fdfsolver *) 0 ;
3855     gsl_function_fdf *arg2 = (gsl_function_fdf *) 0 ;
3856     void *argp1 = 0 ;
3857     int res1 = 0 ;
3858     int argvi = 0;
3859     dXSARGS;
3860 
3861     if ((items < 2) || (items > 2)) {
3862       SWIG_croak("Usage: gsl_root_fdfsolver_fdf_set(self,fdf);");
3863     }
3864     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_gsl_root_fdfsolver, 0 |  0 );
3865     if (!SWIG_IsOK(res1)) {
3866       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gsl_root_fdfsolver_fdf_set" "', argument " "1"" of type '" "gsl_root_fdfsolver *""'");
3867     }
3868     arg1 = (gsl_root_fdfsolver *)(argp1);
3869     {
3870       SV* func[3];
3871       SV * params = 0;
3872 
3873       struct gsl_function_fdf_perl *w_gsl_function_fdf;
3874       Newx(w_gsl_function_fdf, 1, struct gsl_function_fdf_perl);
3875 
3876       if (SvROK(ST(1)) && (SvTYPE(SvRV(ST(1))) == SVt_PVAV)) {
3877         AV* array=(AV*)SvRV(ST(1));
3878 
3879         if (av_len(array)<0) {
3880           croak("Math::GSL : $fdf is an empty array!");
3881         }
3882         if (av_len(array)>1) {
3883           croak("Math::GSL : $fdf is an array with more than 2 elements!");
3884         }
3885 
3886         {
3887           SV** pp_sv = av_fetch(array, 0, 0);
3888           if ( ! SvROK( *pp_sv ) || SvTYPE(SvRV(*pp_sv)) != SVt_PVHV )
3889           croak("Math::GSL : first element of $fdf must be a hashref!");
3890 
3891           gsl_function_fdf_extract( "$fdf", (HV*) SvRV(*pp_sv), func );
3892         }
3893 
3894         if (av_len(array)>0) {
3895           SV ** p_params = 0;
3896           p_params = av_fetch(array, 1, 0);
3897           params = *p_params;
3898         }
3899       } else if (SvROK(ST(1)) && (SvTYPE(SvRV(ST(1))) == SVt_PVHV)) {
3900         HV* hash = (HV*) SvRV(ST(1) );
3901         gsl_function_fdf_extract( "$fdf", hash, func );
3902 
3903       } else {
3904         croak("Math::GSL : $fdf must be a hashref!");
3905       }
3906 
3907       if (! params) {
3908         params=&PL_sv_undef;
3909       }
3910       params = newSVsv(params);
3911 
3912       w_gsl_function_fdf->params = params;
3913       w_gsl_function_fdf->f   = func[0];
3914       w_gsl_function_fdf->df  = func[1];
3915       w_gsl_function_fdf->fdf = func[2];
3916 
3917 
3918       w_gsl_function_fdf->C_gsl_function_fdf.params = w_gsl_function_fdf;
3919       w_gsl_function_fdf->C_gsl_function_fdf.f   = &call_gsl_function_fdf_f;
3920       w_gsl_function_fdf->C_gsl_function_fdf.df  = &call_gsl_function_fdf_df;
3921       w_gsl_function_fdf->C_gsl_function_fdf.fdf = &call_gsl_function_fdf_fdf;
3922 
3923       arg2 = &w_gsl_function_fdf->C_gsl_function_fdf;
3924     }
3925     if (arg1) (arg1)->fdf = arg2;
3926     ST(argvi) = &PL_sv_undef;
3927 
3928 
3929     XSRETURN(argvi);
3930   fail:
3931 
3932 
3933     SWIG_croak_null();
3934   }
3935 }
3936 
3937 
XS(_wrap_gsl_root_fdfsolver_fdf_get)3938 XS(_wrap_gsl_root_fdfsolver_fdf_get) {
3939   {
3940     gsl_root_fdfsolver *arg1 = (gsl_root_fdfsolver *) 0 ;
3941     void *argp1 = 0 ;
3942     int res1 = 0 ;
3943     int argvi = 0;
3944     gsl_function_fdf *result = 0 ;
3945     dXSARGS;
3946 
3947     if ((items < 1) || (items > 1)) {
3948       SWIG_croak("Usage: gsl_root_fdfsolver_fdf_get(self);");
3949     }
3950     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_gsl_root_fdfsolver, 0 |  0 );
3951     if (!SWIG_IsOK(res1)) {
3952       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gsl_root_fdfsolver_fdf_get" "', argument " "1"" of type '" "gsl_root_fdfsolver *""'");
3953     }
3954     arg1 = (gsl_root_fdfsolver *)(argp1);
3955     result = (gsl_function_fdf *) ((arg1)->fdf);
3956     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_gsl_function_fdf, 0 | 0); argvi++ ;
3957 
3958     XSRETURN(argvi);
3959   fail:
3960 
3961     SWIG_croak_null();
3962   }
3963 }
3964 
3965 
XS(_wrap_gsl_root_fdfsolver_root_set)3966 XS(_wrap_gsl_root_fdfsolver_root_set) {
3967   {
3968     gsl_root_fdfsolver *arg1 = (gsl_root_fdfsolver *) 0 ;
3969     double arg2 ;
3970     void *argp1 = 0 ;
3971     int res1 = 0 ;
3972     double val2 ;
3973     int ecode2 = 0 ;
3974     int argvi = 0;
3975     dXSARGS;
3976 
3977     if ((items < 2) || (items > 2)) {
3978       SWIG_croak("Usage: gsl_root_fdfsolver_root_set(self,root);");
3979     }
3980     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_gsl_root_fdfsolver, 0 |  0 );
3981     if (!SWIG_IsOK(res1)) {
3982       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gsl_root_fdfsolver_root_set" "', argument " "1"" of type '" "gsl_root_fdfsolver *""'");
3983     }
3984     arg1 = (gsl_root_fdfsolver *)(argp1);
3985     ecode2 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
3986     if (!SWIG_IsOK(ecode2)) {
3987       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "gsl_root_fdfsolver_root_set" "', argument " "2"" of type '" "double""'");
3988     }
3989     arg2 = (double)(val2);
3990     if (arg1) (arg1)->root = arg2;
3991     ST(argvi) = &PL_sv_undef;
3992 
3993 
3994     XSRETURN(argvi);
3995   fail:
3996 
3997 
3998     SWIG_croak_null();
3999   }
4000 }
4001 
4002 
XS(_wrap_gsl_root_fdfsolver_root_get)4003 XS(_wrap_gsl_root_fdfsolver_root_get) {
4004   {
4005     gsl_root_fdfsolver *arg1 = (gsl_root_fdfsolver *) 0 ;
4006     void *argp1 = 0 ;
4007     int res1 = 0 ;
4008     int argvi = 0;
4009     double result;
4010     dXSARGS;
4011 
4012     if ((items < 1) || (items > 1)) {
4013       SWIG_croak("Usage: gsl_root_fdfsolver_root_get(self);");
4014     }
4015     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_gsl_root_fdfsolver, 0 |  0 );
4016     if (!SWIG_IsOK(res1)) {
4017       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gsl_root_fdfsolver_root_get" "', argument " "1"" of type '" "gsl_root_fdfsolver *""'");
4018     }
4019     arg1 = (gsl_root_fdfsolver *)(argp1);
4020     result = (double) ((arg1)->root);
4021     ST(argvi) = SWIG_From_double  SWIG_PERL_CALL_ARGS_1((double)(result)); argvi++ ;
4022 
4023     XSRETURN(argvi);
4024   fail:
4025 
4026     SWIG_croak_null();
4027   }
4028 }
4029 
4030 
XS(_wrap_gsl_root_fdfsolver_state_set)4031 XS(_wrap_gsl_root_fdfsolver_state_set) {
4032   {
4033     gsl_root_fdfsolver *arg1 = (gsl_root_fdfsolver *) 0 ;
4034     void *arg2 = (void *) 0 ;
4035     void *argp1 = 0 ;
4036     int res1 = 0 ;
4037     int res2 ;
4038     int argvi = 0;
4039     dXSARGS;
4040 
4041     if ((items < 2) || (items > 2)) {
4042       SWIG_croak("Usage: gsl_root_fdfsolver_state_set(self,state);");
4043     }
4044     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_gsl_root_fdfsolver, 0 |  0 );
4045     if (!SWIG_IsOK(res1)) {
4046       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gsl_root_fdfsolver_state_set" "', argument " "1"" of type '" "gsl_root_fdfsolver *""'");
4047     }
4048     arg1 = (gsl_root_fdfsolver *)(argp1);
4049     res2 = SWIG_ConvertPtr(ST(1),SWIG_as_voidptrptr(&arg2), 0, SWIG_POINTER_DISOWN);
4050     if (!SWIG_IsOK(res2)) {
4051       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "gsl_root_fdfsolver_state_set" "', argument " "2"" of type '" "void *""'");
4052     }
4053     if (arg1) (arg1)->state = arg2;
4054     ST(argvi) = &PL_sv_undef;
4055 
4056 
4057     XSRETURN(argvi);
4058   fail:
4059 
4060 
4061     SWIG_croak_null();
4062   }
4063 }
4064 
4065 
XS(_wrap_gsl_root_fdfsolver_state_get)4066 XS(_wrap_gsl_root_fdfsolver_state_get) {
4067   {
4068     gsl_root_fdfsolver *arg1 = (gsl_root_fdfsolver *) 0 ;
4069     void *argp1 = 0 ;
4070     int res1 = 0 ;
4071     int argvi = 0;
4072     void *result = 0 ;
4073     dXSARGS;
4074 
4075     if ((items < 1) || (items > 1)) {
4076       SWIG_croak("Usage: gsl_root_fdfsolver_state_get(self);");
4077     }
4078     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_gsl_root_fdfsolver, 0 |  0 );
4079     if (!SWIG_IsOK(res1)) {
4080       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gsl_root_fdfsolver_state_get" "', argument " "1"" of type '" "gsl_root_fdfsolver *""'");
4081     }
4082     arg1 = (gsl_root_fdfsolver *)(argp1);
4083     result = (void *) ((arg1)->state);
4084     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 | 0); argvi++ ;
4085 
4086     XSRETURN(argvi);
4087   fail:
4088 
4089     SWIG_croak_null();
4090   }
4091 }
4092 
4093 
XS(_wrap_new_gsl_root_fdfsolver)4094 XS(_wrap_new_gsl_root_fdfsolver) {
4095   {
4096     int argvi = 0;
4097     gsl_root_fdfsolver *result = 0 ;
4098     dXSARGS;
4099 
4100     if ((items < 0) || (items > 0)) {
4101       SWIG_croak("Usage: new_gsl_root_fdfsolver();");
4102     }
4103     result = (gsl_root_fdfsolver *)calloc(1, sizeof(gsl_root_fdfsolver));
4104     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_gsl_root_fdfsolver, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
4105     XSRETURN(argvi);
4106   fail:
4107     SWIG_croak_null();
4108   }
4109 }
4110 
4111 
XS(_wrap_gsl_root_fsolver_alloc)4112 XS(_wrap_gsl_root_fsolver_alloc) {
4113   {
4114     gsl_root_fsolver_type *arg1 = (gsl_root_fsolver_type *) 0 ;
4115     void *argp1 = 0 ;
4116     int res1 = 0 ;
4117     int argvi = 0;
4118     gsl_root_fsolver *result = 0 ;
4119     dXSARGS;
4120 
4121     if ((items < 1) || (items > 1)) {
4122       SWIG_croak("Usage: gsl_root_fsolver_alloc(T);");
4123     }
4124     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_gsl_root_fsolver_type, 0 |  0 );
4125     if (!SWIG_IsOK(res1)) {
4126       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gsl_root_fsolver_alloc" "', argument " "1"" of type '" "gsl_root_fsolver_type const *""'");
4127     }
4128     arg1 = (gsl_root_fsolver_type *)(argp1);
4129     result = (gsl_root_fsolver *)gsl_root_fsolver_alloc((gsl_root_fsolver_type const *)arg1);
4130     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_gsl_root_fsolver, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
4131 
4132     XSRETURN(argvi);
4133   fail:
4134 
4135     SWIG_croak_null();
4136   }
4137 }
4138 
4139 
XS(_wrap_gsl_root_fsolver_free)4140 XS(_wrap_gsl_root_fsolver_free) {
4141   {
4142     gsl_root_fsolver *arg1 = (gsl_root_fsolver *) 0 ;
4143     void *argp1 = 0 ;
4144     int res1 = 0 ;
4145     int argvi = 0;
4146     dXSARGS;
4147 
4148     if ((items < 1) || (items > 1)) {
4149       SWIG_croak("Usage: gsl_root_fsolver_free(s);");
4150     }
4151     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_gsl_root_fsolver, 0 |  0 );
4152     if (!SWIG_IsOK(res1)) {
4153       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gsl_root_fsolver_free" "', argument " "1"" of type '" "gsl_root_fsolver *""'");
4154     }
4155     arg1 = (gsl_root_fsolver *)(argp1);
4156     gsl_root_fsolver_free(arg1);
4157     ST(argvi) = &PL_sv_undef;
4158 
4159     XSRETURN(argvi);
4160   fail:
4161 
4162     SWIG_croak_null();
4163   }
4164 }
4165 
4166 
XS(_wrap_gsl_root_fsolver_set)4167 XS(_wrap_gsl_root_fsolver_set) {
4168   {
4169     gsl_root_fsolver *arg1 = (gsl_root_fsolver *) 0 ;
4170     gsl_function *arg2 = (gsl_function *) 0 ;
4171     double arg3 ;
4172     double arg4 ;
4173     void *argp1 = 0 ;
4174     int res1 = 0 ;
4175     double val3 ;
4176     int ecode3 = 0 ;
4177     double val4 ;
4178     int ecode4 = 0 ;
4179     int argvi = 0;
4180     int result;
4181     dXSARGS;
4182 
4183     if ((items < 4) || (items > 4)) {
4184       SWIG_croak("Usage: gsl_root_fsolver_set(s,f,x_lower,x_upper);");
4185     }
4186     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_gsl_root_fsolver, 0 |  0 );
4187     if (!SWIG_IsOK(res1)) {
4188       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gsl_root_fsolver_set" "', argument " "1"" of type '" "gsl_root_fsolver *""'");
4189     }
4190     arg1 = (gsl_root_fsolver *)(argp1);
4191     {
4192       SV * function = 0;
4193       SV * params = 0;
4194       struct gsl_function_perl *w_gsl_function;
4195       Newx(w_gsl_function, 1, struct gsl_function_perl);
4196 
4197       if (SvROK(ST(1)) && (SvTYPE(SvRV(ST(1))) == SVt_PVAV)) {
4198         AV* array=(AV*)SvRV(ST(1));
4199         SV ** p_function = 0;
4200         if (av_len(array)<0) {
4201           croak("Math::GSL : $f is an empty array!");
4202         }
4203         if (av_len(array)>1) {
4204           croak("Math::GSL : $f is an array with more than 2 elements!");
4205         }
4206         p_function = av_fetch(array, 0, 0);
4207         function = *p_function;
4208         if (av_len(array)>0) {
4209           SV ** p_params = 0;
4210           p_params = av_fetch(array, 1, 0);
4211           params = *p_params;
4212         }
4213       } else {
4214         function = ST(1);
4215       }
4216 
4217       if (!function || !(SvPOK(function) || (SvROK(function) && (SvTYPE(SvRV(function)) == SVt_PVCV)))) {
4218         croak("Math::GSL : $f is not a reference to code!");
4219       }
4220 
4221       function = newSVsv(function);
4222 
4223       if (! params) {
4224         params=&PL_sv_undef;
4225       }
4226       params = newSVsv(params);
4227 
4228       w_gsl_function->params = params;
4229       w_gsl_function->function = function;
4230       w_gsl_function->C_gsl_function.params = w_gsl_function;
4231       w_gsl_function->C_gsl_function.function = &call_gsl_function;
4232 
4233       arg2 = &(w_gsl_function->C_gsl_function);
4234     }
4235     ecode3 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
4236     if (!SWIG_IsOK(ecode3)) {
4237       SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "gsl_root_fsolver_set" "', argument " "3"" of type '" "double""'");
4238     }
4239     arg3 = (double)(val3);
4240     ecode4 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(3), &val4);
4241     if (!SWIG_IsOK(ecode4)) {
4242       SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "gsl_root_fsolver_set" "', argument " "4"" of type '" "double""'");
4243     }
4244     arg4 = (double)(val4);
4245     result = (int)gsl_root_fsolver_set(arg1,arg2,arg3,arg4);
4246     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(result)); argvi++ ;
4247 
4248 
4249 
4250 
4251     XSRETURN(argvi);
4252   fail:
4253 
4254 
4255 
4256 
4257     SWIG_croak_null();
4258   }
4259 }
4260 
4261 
XS(_wrap_gsl_root_fsolver_iterate)4262 XS(_wrap_gsl_root_fsolver_iterate) {
4263   {
4264     gsl_root_fsolver *arg1 = (gsl_root_fsolver *) 0 ;
4265     void *argp1 = 0 ;
4266     int res1 = 0 ;
4267     int argvi = 0;
4268     int result;
4269     dXSARGS;
4270 
4271     if ((items < 1) || (items > 1)) {
4272       SWIG_croak("Usage: gsl_root_fsolver_iterate(s);");
4273     }
4274     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_gsl_root_fsolver, 0 |  0 );
4275     if (!SWIG_IsOK(res1)) {
4276       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gsl_root_fsolver_iterate" "', argument " "1"" of type '" "gsl_root_fsolver *""'");
4277     }
4278     arg1 = (gsl_root_fsolver *)(argp1);
4279     result = (int)gsl_root_fsolver_iterate(arg1);
4280     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(result)); argvi++ ;
4281 
4282     XSRETURN(argvi);
4283   fail:
4284 
4285     SWIG_croak_null();
4286   }
4287 }
4288 
4289 
XS(_wrap_gsl_root_fsolver_name)4290 XS(_wrap_gsl_root_fsolver_name) {
4291   {
4292     gsl_root_fsolver *arg1 = (gsl_root_fsolver *) 0 ;
4293     void *argp1 = 0 ;
4294     int res1 = 0 ;
4295     int argvi = 0;
4296     char *result = 0 ;
4297     dXSARGS;
4298 
4299     if ((items < 1) || (items > 1)) {
4300       SWIG_croak("Usage: gsl_root_fsolver_name(s);");
4301     }
4302     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_gsl_root_fsolver, 0 |  0 );
4303     if (!SWIG_IsOK(res1)) {
4304       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gsl_root_fsolver_name" "', argument " "1"" of type '" "gsl_root_fsolver const *""'");
4305     }
4306     arg1 = (gsl_root_fsolver *)(argp1);
4307     result = (char *)gsl_root_fsolver_name((gsl_root_fsolver const *)arg1);
4308     ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
4309 
4310     XSRETURN(argvi);
4311   fail:
4312 
4313     SWIG_croak_null();
4314   }
4315 }
4316 
4317 
XS(_wrap_gsl_root_fsolver_root)4318 XS(_wrap_gsl_root_fsolver_root) {
4319   {
4320     gsl_root_fsolver *arg1 = (gsl_root_fsolver *) 0 ;
4321     void *argp1 = 0 ;
4322     int res1 = 0 ;
4323     int argvi = 0;
4324     double result;
4325     dXSARGS;
4326 
4327     if ((items < 1) || (items > 1)) {
4328       SWIG_croak("Usage: gsl_root_fsolver_root(s);");
4329     }
4330     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_gsl_root_fsolver, 0 |  0 );
4331     if (!SWIG_IsOK(res1)) {
4332       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gsl_root_fsolver_root" "', argument " "1"" of type '" "gsl_root_fsolver const *""'");
4333     }
4334     arg1 = (gsl_root_fsolver *)(argp1);
4335     result = (double)gsl_root_fsolver_root((gsl_root_fsolver const *)arg1);
4336     ST(argvi) = SWIG_From_double  SWIG_PERL_CALL_ARGS_1((double)(result)); argvi++ ;
4337 
4338     XSRETURN(argvi);
4339   fail:
4340 
4341     SWIG_croak_null();
4342   }
4343 }
4344 
4345 
XS(_wrap_gsl_root_fsolver_x_lower)4346 XS(_wrap_gsl_root_fsolver_x_lower) {
4347   {
4348     gsl_root_fsolver *arg1 = (gsl_root_fsolver *) 0 ;
4349     void *argp1 = 0 ;
4350     int res1 = 0 ;
4351     int argvi = 0;
4352     double result;
4353     dXSARGS;
4354 
4355     if ((items < 1) || (items > 1)) {
4356       SWIG_croak("Usage: gsl_root_fsolver_x_lower(s);");
4357     }
4358     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_gsl_root_fsolver, 0 |  0 );
4359     if (!SWIG_IsOK(res1)) {
4360       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gsl_root_fsolver_x_lower" "', argument " "1"" of type '" "gsl_root_fsolver const *""'");
4361     }
4362     arg1 = (gsl_root_fsolver *)(argp1);
4363     result = (double)gsl_root_fsolver_x_lower((gsl_root_fsolver const *)arg1);
4364     ST(argvi) = SWIG_From_double  SWIG_PERL_CALL_ARGS_1((double)(result)); argvi++ ;
4365 
4366     XSRETURN(argvi);
4367   fail:
4368 
4369     SWIG_croak_null();
4370   }
4371 }
4372 
4373 
XS(_wrap_gsl_root_fsolver_x_upper)4374 XS(_wrap_gsl_root_fsolver_x_upper) {
4375   {
4376     gsl_root_fsolver *arg1 = (gsl_root_fsolver *) 0 ;
4377     void *argp1 = 0 ;
4378     int res1 = 0 ;
4379     int argvi = 0;
4380     double result;
4381     dXSARGS;
4382 
4383     if ((items < 1) || (items > 1)) {
4384       SWIG_croak("Usage: gsl_root_fsolver_x_upper(s);");
4385     }
4386     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_gsl_root_fsolver, 0 |  0 );
4387     if (!SWIG_IsOK(res1)) {
4388       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gsl_root_fsolver_x_upper" "', argument " "1"" of type '" "gsl_root_fsolver const *""'");
4389     }
4390     arg1 = (gsl_root_fsolver *)(argp1);
4391     result = (double)gsl_root_fsolver_x_upper((gsl_root_fsolver const *)arg1);
4392     ST(argvi) = SWIG_From_double  SWIG_PERL_CALL_ARGS_1((double)(result)); argvi++ ;
4393 
4394     XSRETURN(argvi);
4395   fail:
4396 
4397     SWIG_croak_null();
4398   }
4399 }
4400 
4401 
XS(_wrap_gsl_root_fdfsolver_alloc)4402 XS(_wrap_gsl_root_fdfsolver_alloc) {
4403   {
4404     gsl_root_fdfsolver_type *arg1 = (gsl_root_fdfsolver_type *) 0 ;
4405     void *argp1 = 0 ;
4406     int res1 = 0 ;
4407     int argvi = 0;
4408     gsl_root_fdfsolver *result = 0 ;
4409     dXSARGS;
4410 
4411     if ((items < 1) || (items > 1)) {
4412       SWIG_croak("Usage: gsl_root_fdfsolver_alloc(T);");
4413     }
4414     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_gsl_root_fdfsolver_type, 0 |  0 );
4415     if (!SWIG_IsOK(res1)) {
4416       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gsl_root_fdfsolver_alloc" "', argument " "1"" of type '" "gsl_root_fdfsolver_type const *""'");
4417     }
4418     arg1 = (gsl_root_fdfsolver_type *)(argp1);
4419     result = (gsl_root_fdfsolver *)gsl_root_fdfsolver_alloc((gsl_root_fdfsolver_type const *)arg1);
4420     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_gsl_root_fdfsolver, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
4421 
4422     XSRETURN(argvi);
4423   fail:
4424 
4425     SWIG_croak_null();
4426   }
4427 }
4428 
4429 
XS(_wrap_gsl_root_fdfsolver_set)4430 XS(_wrap_gsl_root_fdfsolver_set) {
4431   {
4432     gsl_root_fdfsolver *arg1 = (gsl_root_fdfsolver *) 0 ;
4433     gsl_function_fdf *arg2 = (gsl_function_fdf *) 0 ;
4434     double arg3 ;
4435     void *argp1 = 0 ;
4436     int res1 = 0 ;
4437     double val3 ;
4438     int ecode3 = 0 ;
4439     int argvi = 0;
4440     int result;
4441     dXSARGS;
4442 
4443     if ((items < 3) || (items > 3)) {
4444       SWIG_croak("Usage: gsl_root_fdfsolver_set(s,fdf,root);");
4445     }
4446     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_gsl_root_fdfsolver, 0 |  0 );
4447     if (!SWIG_IsOK(res1)) {
4448       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gsl_root_fdfsolver_set" "', argument " "1"" of type '" "gsl_root_fdfsolver *""'");
4449     }
4450     arg1 = (gsl_root_fdfsolver *)(argp1);
4451     {
4452       SV* func[3];
4453       SV * params = 0;
4454 
4455       struct gsl_function_fdf_perl *w_gsl_function_fdf;
4456       Newx(w_gsl_function_fdf, 1, struct gsl_function_fdf_perl);
4457 
4458       if (SvROK(ST(1)) && (SvTYPE(SvRV(ST(1))) == SVt_PVAV)) {
4459         AV* array=(AV*)SvRV(ST(1));
4460 
4461         if (av_len(array)<0) {
4462           croak("Math::GSL : $fdf is an empty array!");
4463         }
4464         if (av_len(array)>1) {
4465           croak("Math::GSL : $fdf is an array with more than 2 elements!");
4466         }
4467 
4468         {
4469           SV** pp_sv = av_fetch(array, 0, 0);
4470           if ( ! SvROK( *pp_sv ) || SvTYPE(SvRV(*pp_sv)) != SVt_PVHV )
4471           croak("Math::GSL : first element of $fdf must be a hashref!");
4472 
4473           gsl_function_fdf_extract( "$fdf", (HV*) SvRV(*pp_sv), func );
4474         }
4475 
4476         if (av_len(array)>0) {
4477           SV ** p_params = 0;
4478           p_params = av_fetch(array, 1, 0);
4479           params = *p_params;
4480         }
4481       } else if (SvROK(ST(1)) && (SvTYPE(SvRV(ST(1))) == SVt_PVHV)) {
4482         HV* hash = (HV*) SvRV(ST(1) );
4483         gsl_function_fdf_extract( "$fdf", hash, func );
4484 
4485       } else {
4486         croak("Math::GSL : $fdf must be a hashref!");
4487       }
4488 
4489       if (! params) {
4490         params=&PL_sv_undef;
4491       }
4492       params = newSVsv(params);
4493 
4494       w_gsl_function_fdf->params = params;
4495       w_gsl_function_fdf->f   = func[0];
4496       w_gsl_function_fdf->df  = func[1];
4497       w_gsl_function_fdf->fdf = func[2];
4498 
4499 
4500       w_gsl_function_fdf->C_gsl_function_fdf.params = w_gsl_function_fdf;
4501       w_gsl_function_fdf->C_gsl_function_fdf.f   = &call_gsl_function_fdf_f;
4502       w_gsl_function_fdf->C_gsl_function_fdf.df  = &call_gsl_function_fdf_df;
4503       w_gsl_function_fdf->C_gsl_function_fdf.fdf = &call_gsl_function_fdf_fdf;
4504 
4505       arg2 = &w_gsl_function_fdf->C_gsl_function_fdf;
4506     }
4507     ecode3 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
4508     if (!SWIG_IsOK(ecode3)) {
4509       SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "gsl_root_fdfsolver_set" "', argument " "3"" of type '" "double""'");
4510     }
4511     arg3 = (double)(val3);
4512     result = (int)gsl_root_fdfsolver_set(arg1,arg2,arg3);
4513     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(result)); argvi++ ;
4514 
4515 
4516 
4517     XSRETURN(argvi);
4518   fail:
4519 
4520 
4521 
4522     SWIG_croak_null();
4523   }
4524 }
4525 
4526 
XS(_wrap_gsl_root_fdfsolver_iterate)4527 XS(_wrap_gsl_root_fdfsolver_iterate) {
4528   {
4529     gsl_root_fdfsolver *arg1 = (gsl_root_fdfsolver *) 0 ;
4530     void *argp1 = 0 ;
4531     int res1 = 0 ;
4532     int argvi = 0;
4533     int result;
4534     dXSARGS;
4535 
4536     if ((items < 1) || (items > 1)) {
4537       SWIG_croak("Usage: gsl_root_fdfsolver_iterate(s);");
4538     }
4539     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_gsl_root_fdfsolver, 0 |  0 );
4540     if (!SWIG_IsOK(res1)) {
4541       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gsl_root_fdfsolver_iterate" "', argument " "1"" of type '" "gsl_root_fdfsolver *""'");
4542     }
4543     arg1 = (gsl_root_fdfsolver *)(argp1);
4544     result = (int)gsl_root_fdfsolver_iterate(arg1);
4545     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(result)); argvi++ ;
4546 
4547     XSRETURN(argvi);
4548   fail:
4549 
4550     SWIG_croak_null();
4551   }
4552 }
4553 
4554 
XS(_wrap_gsl_root_fdfsolver_free)4555 XS(_wrap_gsl_root_fdfsolver_free) {
4556   {
4557     gsl_root_fdfsolver *arg1 = (gsl_root_fdfsolver *) 0 ;
4558     void *argp1 = 0 ;
4559     int res1 = 0 ;
4560     int argvi = 0;
4561     dXSARGS;
4562 
4563     if ((items < 1) || (items > 1)) {
4564       SWIG_croak("Usage: gsl_root_fdfsolver_free(s);");
4565     }
4566     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_gsl_root_fdfsolver, 0 |  0 );
4567     if (!SWIG_IsOK(res1)) {
4568       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gsl_root_fdfsolver_free" "', argument " "1"" of type '" "gsl_root_fdfsolver *""'");
4569     }
4570     arg1 = (gsl_root_fdfsolver *)(argp1);
4571     gsl_root_fdfsolver_free(arg1);
4572     ST(argvi) = &PL_sv_undef;
4573 
4574     XSRETURN(argvi);
4575   fail:
4576 
4577     SWIG_croak_null();
4578   }
4579 }
4580 
4581 
XS(_wrap_gsl_root_fdfsolver_name)4582 XS(_wrap_gsl_root_fdfsolver_name) {
4583   {
4584     gsl_root_fdfsolver *arg1 = (gsl_root_fdfsolver *) 0 ;
4585     void *argp1 = 0 ;
4586     int res1 = 0 ;
4587     int argvi = 0;
4588     char *result = 0 ;
4589     dXSARGS;
4590 
4591     if ((items < 1) || (items > 1)) {
4592       SWIG_croak("Usage: gsl_root_fdfsolver_name(s);");
4593     }
4594     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_gsl_root_fdfsolver, 0 |  0 );
4595     if (!SWIG_IsOK(res1)) {
4596       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gsl_root_fdfsolver_name" "', argument " "1"" of type '" "gsl_root_fdfsolver const *""'");
4597     }
4598     arg1 = (gsl_root_fdfsolver *)(argp1);
4599     result = (char *)gsl_root_fdfsolver_name((gsl_root_fdfsolver const *)arg1);
4600     ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
4601 
4602     XSRETURN(argvi);
4603   fail:
4604 
4605     SWIG_croak_null();
4606   }
4607 }
4608 
4609 
XS(_wrap_gsl_root_fdfsolver_root)4610 XS(_wrap_gsl_root_fdfsolver_root) {
4611   {
4612     gsl_root_fdfsolver *arg1 = (gsl_root_fdfsolver *) 0 ;
4613     void *argp1 = 0 ;
4614     int res1 = 0 ;
4615     int argvi = 0;
4616     double result;
4617     dXSARGS;
4618 
4619     if ((items < 1) || (items > 1)) {
4620       SWIG_croak("Usage: gsl_root_fdfsolver_root(s);");
4621     }
4622     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_gsl_root_fdfsolver, 0 |  0 );
4623     if (!SWIG_IsOK(res1)) {
4624       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "gsl_root_fdfsolver_root" "', argument " "1"" of type '" "gsl_root_fdfsolver const *""'");
4625     }
4626     arg1 = (gsl_root_fdfsolver *)(argp1);
4627     result = (double)gsl_root_fdfsolver_root((gsl_root_fdfsolver const *)arg1);
4628     ST(argvi) = SWIG_From_double  SWIG_PERL_CALL_ARGS_1((double)(result)); argvi++ ;
4629 
4630     XSRETURN(argvi);
4631   fail:
4632 
4633     SWIG_croak_null();
4634   }
4635 }
4636 
4637 
XS(_wrap_gsl_root_test_interval)4638 XS(_wrap_gsl_root_test_interval) {
4639   {
4640     double arg1 ;
4641     double arg2 ;
4642     double arg3 ;
4643     double arg4 ;
4644     double val1 ;
4645     int ecode1 = 0 ;
4646     double val2 ;
4647     int ecode2 = 0 ;
4648     double val3 ;
4649     int ecode3 = 0 ;
4650     double val4 ;
4651     int ecode4 = 0 ;
4652     int argvi = 0;
4653     int result;
4654     dXSARGS;
4655 
4656     if ((items < 4) || (items > 4)) {
4657       SWIG_croak("Usage: gsl_root_test_interval(x_lower,x_upper,epsabs,epsrel);");
4658     }
4659     ecode1 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(0), &val1);
4660     if (!SWIG_IsOK(ecode1)) {
4661       SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gsl_root_test_interval" "', argument " "1"" of type '" "double""'");
4662     }
4663     arg1 = (double)(val1);
4664     ecode2 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
4665     if (!SWIG_IsOK(ecode2)) {
4666       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "gsl_root_test_interval" "', argument " "2"" of type '" "double""'");
4667     }
4668     arg2 = (double)(val2);
4669     ecode3 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
4670     if (!SWIG_IsOK(ecode3)) {
4671       SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "gsl_root_test_interval" "', argument " "3"" of type '" "double""'");
4672     }
4673     arg3 = (double)(val3);
4674     ecode4 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(3), &val4);
4675     if (!SWIG_IsOK(ecode4)) {
4676       SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "gsl_root_test_interval" "', argument " "4"" of type '" "double""'");
4677     }
4678     arg4 = (double)(val4);
4679     result = (int)gsl_root_test_interval(arg1,arg2,arg3,arg4);
4680     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(result)); argvi++ ;
4681 
4682 
4683 
4684 
4685     XSRETURN(argvi);
4686   fail:
4687 
4688 
4689 
4690 
4691     SWIG_croak_null();
4692   }
4693 }
4694 
4695 
XS(_wrap_gsl_root_test_residual)4696 XS(_wrap_gsl_root_test_residual) {
4697   {
4698     double arg1 ;
4699     double arg2 ;
4700     double val1 ;
4701     int ecode1 = 0 ;
4702     double val2 ;
4703     int ecode2 = 0 ;
4704     int argvi = 0;
4705     int result;
4706     dXSARGS;
4707 
4708     if ((items < 2) || (items > 2)) {
4709       SWIG_croak("Usage: gsl_root_test_residual(f,epsabs);");
4710     }
4711     ecode1 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(0), &val1);
4712     if (!SWIG_IsOK(ecode1)) {
4713       SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gsl_root_test_residual" "', argument " "1"" of type '" "double""'");
4714     }
4715     arg1 = (double)(val1);
4716     ecode2 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
4717     if (!SWIG_IsOK(ecode2)) {
4718       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "gsl_root_test_residual" "', argument " "2"" of type '" "double""'");
4719     }
4720     arg2 = (double)(val2);
4721     result = (int)gsl_root_test_residual(arg1,arg2);
4722     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(result)); argvi++ ;
4723 
4724 
4725     XSRETURN(argvi);
4726   fail:
4727 
4728 
4729     SWIG_croak_null();
4730   }
4731 }
4732 
4733 
XS(_wrap_gsl_root_test_delta)4734 XS(_wrap_gsl_root_test_delta) {
4735   {
4736     double arg1 ;
4737     double arg2 ;
4738     double arg3 ;
4739     double arg4 ;
4740     double val1 ;
4741     int ecode1 = 0 ;
4742     double val2 ;
4743     int ecode2 = 0 ;
4744     double val3 ;
4745     int ecode3 = 0 ;
4746     double val4 ;
4747     int ecode4 = 0 ;
4748     int argvi = 0;
4749     int result;
4750     dXSARGS;
4751 
4752     if ((items < 4) || (items > 4)) {
4753       SWIG_croak("Usage: gsl_root_test_delta(x1,x0,epsabs,epsrel);");
4754     }
4755     ecode1 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(0), &val1);
4756     if (!SWIG_IsOK(ecode1)) {
4757       SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gsl_root_test_delta" "', argument " "1"" of type '" "double""'");
4758     }
4759     arg1 = (double)(val1);
4760     ecode2 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
4761     if (!SWIG_IsOK(ecode2)) {
4762       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "gsl_root_test_delta" "', argument " "2"" of type '" "double""'");
4763     }
4764     arg2 = (double)(val2);
4765     ecode3 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
4766     if (!SWIG_IsOK(ecode3)) {
4767       SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "gsl_root_test_delta" "', argument " "3"" of type '" "double""'");
4768     }
4769     arg3 = (double)(val3);
4770     ecode4 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(3), &val4);
4771     if (!SWIG_IsOK(ecode4)) {
4772       SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "gsl_root_test_delta" "', argument " "4"" of type '" "double""'");
4773     }
4774     arg4 = (double)(val4);
4775     result = (int)gsl_root_test_delta(arg1,arg2,arg3,arg4);
4776     ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(result)); argvi++ ;
4777 
4778 
4779 
4780 
4781     XSRETURN(argvi);
4782   fail:
4783 
4784 
4785 
4786 
4787     SWIG_croak_null();
4788   }
4789 }
4790 
4791 
4792 
4793 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
4794 
4795 static swig_type_info _swigt__p_FILE = {"_p_FILE", "FILE *", 0, 0, (void*)0, 0};
4796 static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
4797 static swig_type_info _swigt__p_f_p_q_const__char_p_q_const__char_int_int__void = {"_p_f_p_q_const__char_p_q_const__char_int_int__void", "void (*)(char const *,char const *,int,int)|gsl_error_handler_t *", 0, 0, (void*)0, 0};
4798 static swig_type_info _swigt__p_f_p_q_const__char_p_q_const__char_int_p_q_const__char__void = {"_p_f_p_q_const__char_p_q_const__char_int_p_q_const__char__void", "gsl_stream_handler_t *|void (*)(char const *,char const *,int,char const *)", 0, 0, (void*)0, 0};
4799 static swig_type_info _swigt__p_f_p_void_p_gsl_function_fdf_p_double__int = {"_p_f_p_void_p_gsl_function_fdf_p_double__int", "int (*)(void *,gsl_function_fdf *,double *)", 0, 0, (void*)0, 0};
4800 static swig_type_info _swigt__p_f_p_void_p_gsl_function_p_double_double_double__int = {"_p_f_p_void_p_gsl_function_p_double_double_double__int", "int (*)(void *,gsl_function *,double *,double,double)", 0, 0, (void*)0, 0};
4801 static swig_type_info _swigt__p_f_p_void_p_gsl_function_p_double_p_double_p_double__int = {"_p_f_p_void_p_gsl_function_p_double_p_double_p_double__int", "int (*)(void *,gsl_function *,double *,double *,double *)", 0, 0, (void*)0, 0};
4802 static swig_type_info _swigt__p_gsl_function = {"_p_gsl_function", "gsl_function *", 0, 0, (void*)0, 0};
4803 static swig_type_info _swigt__p_gsl_function_fdf = {"_p_gsl_function_fdf", "gsl_function_fdf *", 0, 0, (void*)0, 0};
4804 static swig_type_info _swigt__p_gsl_root_fdfsolver = {"_p_gsl_root_fdfsolver", "gsl_root_fdfsolver *", 0, 0, (void*)"Math::GSL::Roots::gsl_root_fdfsolver", 0};
4805 static swig_type_info _swigt__p_gsl_root_fdfsolver_type = {"_p_gsl_root_fdfsolver_type", "gsl_root_fdfsolver_type *", 0, 0, (void*)"Math::GSL::Roots::gsl_root_fdfsolver_type", 0};
4806 static swig_type_info _swigt__p_gsl_root_fsolver = {"_p_gsl_root_fsolver", "gsl_root_fsolver *", 0, 0, (void*)"Math::GSL::Roots::gsl_root_fsolver", 0};
4807 static swig_type_info _swigt__p_gsl_root_fsolver_type = {"_p_gsl_root_fsolver_type", "gsl_root_fsolver_type *", 0, 0, (void*)"Math::GSL::Roots::gsl_root_fsolver_type", 0};
4808 static swig_type_info _swigt__p_void = {"_p_void", "void *", 0, 0, (void*)0, 0};
4809 
4810 static swig_type_info *swig_type_initial[] = {
4811   &_swigt__p_FILE,
4812   &_swigt__p_char,
4813   &_swigt__p_f_p_q_const__char_p_q_const__char_int_int__void,
4814   &_swigt__p_f_p_q_const__char_p_q_const__char_int_p_q_const__char__void,
4815   &_swigt__p_f_p_void_p_gsl_function_fdf_p_double__int,
4816   &_swigt__p_f_p_void_p_gsl_function_p_double_double_double__int,
4817   &_swigt__p_f_p_void_p_gsl_function_p_double_p_double_p_double__int,
4818   &_swigt__p_gsl_function,
4819   &_swigt__p_gsl_function_fdf,
4820   &_swigt__p_gsl_root_fdfsolver,
4821   &_swigt__p_gsl_root_fdfsolver_type,
4822   &_swigt__p_gsl_root_fsolver,
4823   &_swigt__p_gsl_root_fsolver_type,
4824   &_swigt__p_void,
4825 };
4826 
4827 static swig_cast_info _swigc__p_FILE[] = {  {&_swigt__p_FILE, 0, 0, 0},{0, 0, 0, 0}};
4828 static swig_cast_info _swigc__p_char[] = {  {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
4829 static swig_cast_info _swigc__p_f_p_q_const__char_p_q_const__char_int_int__void[] = {  {&_swigt__p_f_p_q_const__char_p_q_const__char_int_int__void, 0, 0, 0},{0, 0, 0, 0}};
4830 static swig_cast_info _swigc__p_f_p_q_const__char_p_q_const__char_int_p_q_const__char__void[] = {  {&_swigt__p_f_p_q_const__char_p_q_const__char_int_p_q_const__char__void, 0, 0, 0},{0, 0, 0, 0}};
4831 static swig_cast_info _swigc__p_f_p_void_p_gsl_function_fdf_p_double__int[] = {  {&_swigt__p_f_p_void_p_gsl_function_fdf_p_double__int, 0, 0, 0},{0, 0, 0, 0}};
4832 static swig_cast_info _swigc__p_f_p_void_p_gsl_function_p_double_double_double__int[] = {  {&_swigt__p_f_p_void_p_gsl_function_p_double_double_double__int, 0, 0, 0},{0, 0, 0, 0}};
4833 static swig_cast_info _swigc__p_f_p_void_p_gsl_function_p_double_p_double_p_double__int[] = {  {&_swigt__p_f_p_void_p_gsl_function_p_double_p_double_p_double__int, 0, 0, 0},{0, 0, 0, 0}};
4834 static swig_cast_info _swigc__p_gsl_function[] = {  {&_swigt__p_gsl_function, 0, 0, 0},{0, 0, 0, 0}};
4835 static swig_cast_info _swigc__p_gsl_function_fdf[] = {  {&_swigt__p_gsl_function_fdf, 0, 0, 0},{0, 0, 0, 0}};
4836 static swig_cast_info _swigc__p_gsl_root_fdfsolver[] = {  {&_swigt__p_gsl_root_fdfsolver, 0, 0, 0},{0, 0, 0, 0}};
4837 static swig_cast_info _swigc__p_gsl_root_fdfsolver_type[] = {  {&_swigt__p_gsl_root_fdfsolver_type, 0, 0, 0},{0, 0, 0, 0}};
4838 static swig_cast_info _swigc__p_gsl_root_fsolver[] = {  {&_swigt__p_gsl_root_fsolver, 0, 0, 0},{0, 0, 0, 0}};
4839 static swig_cast_info _swigc__p_gsl_root_fsolver_type[] = {  {&_swigt__p_gsl_root_fsolver_type, 0, 0, 0},{0, 0, 0, 0}};
4840 static swig_cast_info _swigc__p_void[] = {  {&_swigt__p_void, 0, 0, 0},{0, 0, 0, 0}};
4841 
4842 static swig_cast_info *swig_cast_initial[] = {
4843   _swigc__p_FILE,
4844   _swigc__p_char,
4845   _swigc__p_f_p_q_const__char_p_q_const__char_int_int__void,
4846   _swigc__p_f_p_q_const__char_p_q_const__char_int_p_q_const__char__void,
4847   _swigc__p_f_p_void_p_gsl_function_fdf_p_double__int,
4848   _swigc__p_f_p_void_p_gsl_function_p_double_double_double__int,
4849   _swigc__p_f_p_void_p_gsl_function_p_double_p_double_p_double__int,
4850   _swigc__p_gsl_function,
4851   _swigc__p_gsl_function_fdf,
4852   _swigc__p_gsl_root_fdfsolver,
4853   _swigc__p_gsl_root_fdfsolver_type,
4854   _swigc__p_gsl_root_fsolver,
4855   _swigc__p_gsl_root_fsolver_type,
4856   _swigc__p_void,
4857 };
4858 
4859 
4860 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
4861 
4862 static swig_constant_info swig_constants[] = {
4863 {0,0,0,0,0,0}
4864 };
4865 #ifdef __cplusplus
4866 }
4867 #endif
4868 static swig_variable_info swig_variables[] = {
4869     { "Math::GSL::Rootsc::gsl_root_fsolver_bisection", MAGIC_CLASS _wrap_gsl_root_fsolver_bisection_set, MAGIC_CLASS _wrap_gsl_root_fsolver_bisection_get,&SWIGTYPE_p_gsl_root_fsolver_type },
4870     { "Math::GSL::Rootsc::gsl_root_fsolver_brent", MAGIC_CLASS _wrap_gsl_root_fsolver_brent_set, MAGIC_CLASS _wrap_gsl_root_fsolver_brent_get,&SWIGTYPE_p_gsl_root_fsolver_type },
4871     { "Math::GSL::Rootsc::gsl_root_fsolver_falsepos", MAGIC_CLASS _wrap_gsl_root_fsolver_falsepos_set, MAGIC_CLASS _wrap_gsl_root_fsolver_falsepos_get,&SWIGTYPE_p_gsl_root_fsolver_type },
4872     { "Math::GSL::Rootsc::gsl_root_fdfsolver_newton", MAGIC_CLASS _wrap_gsl_root_fdfsolver_newton_set, MAGIC_CLASS _wrap_gsl_root_fdfsolver_newton_get,&SWIGTYPE_p_gsl_root_fdfsolver_type },
4873     { "Math::GSL::Rootsc::gsl_root_fdfsolver_secant", MAGIC_CLASS _wrap_gsl_root_fdfsolver_secant_set, MAGIC_CLASS _wrap_gsl_root_fdfsolver_secant_get,&SWIGTYPE_p_gsl_root_fdfsolver_type },
4874     { "Math::GSL::Rootsc::gsl_root_fdfsolver_steffenson", MAGIC_CLASS _wrap_gsl_root_fdfsolver_steffenson_set, MAGIC_CLASS _wrap_gsl_root_fdfsolver_steffenson_get,&SWIGTYPE_p_gsl_root_fdfsolver_type },
4875 {0,0,0,0}
4876 };
4877 static swig_command_info swig_commands[] = {
4878 {"Math::GSL::Rootsc::gsl_error", _wrap_gsl_error},
4879 {"Math::GSL::Rootsc::gsl_stream_printf", _wrap_gsl_stream_printf},
4880 {"Math::GSL::Rootsc::gsl_strerror", _wrap_gsl_strerror},
4881 {"Math::GSL::Rootsc::gsl_set_error_handler", _wrap_gsl_set_error_handler},
4882 {"Math::GSL::Rootsc::gsl_set_error_handler_off", _wrap_gsl_set_error_handler_off},
4883 {"Math::GSL::Rootsc::gsl_set_stream_handler", _wrap_gsl_set_stream_handler},
4884 {"Math::GSL::Rootsc::gsl_set_stream", _wrap_gsl_set_stream},
4885 {"Math::GSL::Rootsc::gsl_root_fsolver_type_name_set", _wrap_gsl_root_fsolver_type_name_set},
4886 {"Math::GSL::Rootsc::gsl_root_fsolver_type_name_get", _wrap_gsl_root_fsolver_type_name_get},
4887 {"Math::GSL::Rootsc::gsl_root_fsolver_type_size_set", _wrap_gsl_root_fsolver_type_size_set},
4888 {"Math::GSL::Rootsc::gsl_root_fsolver_type_size_get", _wrap_gsl_root_fsolver_type_size_get},
4889 {"Math::GSL::Rootsc::gsl_root_fsolver_type_set_set", _wrap_gsl_root_fsolver_type_set_set},
4890 {"Math::GSL::Rootsc::gsl_root_fsolver_type_set_get", _wrap_gsl_root_fsolver_type_set_get},
4891 {"Math::GSL::Rootsc::gsl_root_fsolver_type_iterate_set", _wrap_gsl_root_fsolver_type_iterate_set},
4892 {"Math::GSL::Rootsc::gsl_root_fsolver_type_iterate_get", _wrap_gsl_root_fsolver_type_iterate_get},
4893 {"Math::GSL::Rootsc::new_gsl_root_fsolver_type", _wrap_new_gsl_root_fsolver_type},
4894 {"Math::GSL::Rootsc::delete_gsl_root_fsolver_type", _wrap_delete_gsl_root_fsolver_type},
4895 {"Math::GSL::Rootsc::delete_gsl_root_fsolver", _wrap_delete_gsl_root_fsolver},
4896 {"Math::GSL::Rootsc::gsl_root_fsolver_type_set", _wrap_gsl_root_fsolver_type_set},
4897 {"Math::GSL::Rootsc::gsl_root_fsolver_type_get", _wrap_gsl_root_fsolver_type_get},
4898 {"Math::GSL::Rootsc::gsl_root_fsolver_function_set", _wrap_gsl_root_fsolver_function_set},
4899 {"Math::GSL::Rootsc::gsl_root_fsolver_function_get", _wrap_gsl_root_fsolver_function_get},
4900 {"Math::GSL::Rootsc::gsl_root_fsolver_root_set", _wrap_gsl_root_fsolver_root_set},
4901 {"Math::GSL::Rootsc::gsl_root_fsolver_root_get", _wrap_gsl_root_fsolver_root_get},
4902 {"Math::GSL::Rootsc::gsl_root_fsolver_x_lower_set", _wrap_gsl_root_fsolver_x_lower_set},
4903 {"Math::GSL::Rootsc::gsl_root_fsolver_x_lower_get", _wrap_gsl_root_fsolver_x_lower_get},
4904 {"Math::GSL::Rootsc::gsl_root_fsolver_x_upper_set", _wrap_gsl_root_fsolver_x_upper_set},
4905 {"Math::GSL::Rootsc::gsl_root_fsolver_x_upper_get", _wrap_gsl_root_fsolver_x_upper_get},
4906 {"Math::GSL::Rootsc::gsl_root_fsolver_state_set", _wrap_gsl_root_fsolver_state_set},
4907 {"Math::GSL::Rootsc::gsl_root_fsolver_state_get", _wrap_gsl_root_fsolver_state_get},
4908 {"Math::GSL::Rootsc::new_gsl_root_fsolver", _wrap_new_gsl_root_fsolver},
4909 {"Math::GSL::Rootsc::gsl_root_fdfsolver_type_name_set", _wrap_gsl_root_fdfsolver_type_name_set},
4910 {"Math::GSL::Rootsc::gsl_root_fdfsolver_type_name_get", _wrap_gsl_root_fdfsolver_type_name_get},
4911 {"Math::GSL::Rootsc::gsl_root_fdfsolver_type_size_set", _wrap_gsl_root_fdfsolver_type_size_set},
4912 {"Math::GSL::Rootsc::gsl_root_fdfsolver_type_size_get", _wrap_gsl_root_fdfsolver_type_size_get},
4913 {"Math::GSL::Rootsc::gsl_root_fdfsolver_type_set_set", _wrap_gsl_root_fdfsolver_type_set_set},
4914 {"Math::GSL::Rootsc::gsl_root_fdfsolver_type_set_get", _wrap_gsl_root_fdfsolver_type_set_get},
4915 {"Math::GSL::Rootsc::gsl_root_fdfsolver_type_iterate_set", _wrap_gsl_root_fdfsolver_type_iterate_set},
4916 {"Math::GSL::Rootsc::gsl_root_fdfsolver_type_iterate_get", _wrap_gsl_root_fdfsolver_type_iterate_get},
4917 {"Math::GSL::Rootsc::new_gsl_root_fdfsolver_type", _wrap_new_gsl_root_fdfsolver_type},
4918 {"Math::GSL::Rootsc::delete_gsl_root_fdfsolver_type", _wrap_delete_gsl_root_fdfsolver_type},
4919 {"Math::GSL::Rootsc::delete_gsl_root_fdfsolver", _wrap_delete_gsl_root_fdfsolver},
4920 {"Math::GSL::Rootsc::gsl_root_fdfsolver_type_set", _wrap_gsl_root_fdfsolver_type_set},
4921 {"Math::GSL::Rootsc::gsl_root_fdfsolver_type_get", _wrap_gsl_root_fdfsolver_type_get},
4922 {"Math::GSL::Rootsc::gsl_root_fdfsolver_fdf_set", _wrap_gsl_root_fdfsolver_fdf_set},
4923 {"Math::GSL::Rootsc::gsl_root_fdfsolver_fdf_get", _wrap_gsl_root_fdfsolver_fdf_get},
4924 {"Math::GSL::Rootsc::gsl_root_fdfsolver_root_set", _wrap_gsl_root_fdfsolver_root_set},
4925 {"Math::GSL::Rootsc::gsl_root_fdfsolver_root_get", _wrap_gsl_root_fdfsolver_root_get},
4926 {"Math::GSL::Rootsc::gsl_root_fdfsolver_state_set", _wrap_gsl_root_fdfsolver_state_set},
4927 {"Math::GSL::Rootsc::gsl_root_fdfsolver_state_get", _wrap_gsl_root_fdfsolver_state_get},
4928 {"Math::GSL::Rootsc::new_gsl_root_fdfsolver", _wrap_new_gsl_root_fdfsolver},
4929 {"Math::GSL::Rootsc::gsl_root_fsolver_alloc", _wrap_gsl_root_fsolver_alloc},
4930 {"Math::GSL::Rootsc::gsl_root_fsolver_free", _wrap_gsl_root_fsolver_free},
4931 {"Math::GSL::Rootsc::gsl_root_fsolver_set", _wrap_gsl_root_fsolver_set},
4932 {"Math::GSL::Rootsc::gsl_root_fsolver_iterate", _wrap_gsl_root_fsolver_iterate},
4933 {"Math::GSL::Rootsc::gsl_root_fsolver_name", _wrap_gsl_root_fsolver_name},
4934 {"Math::GSL::Rootsc::gsl_root_fsolver_root", _wrap_gsl_root_fsolver_root},
4935 {"Math::GSL::Rootsc::gsl_root_fsolver_x_lower", _wrap_gsl_root_fsolver_x_lower},
4936 {"Math::GSL::Rootsc::gsl_root_fsolver_x_upper", _wrap_gsl_root_fsolver_x_upper},
4937 {"Math::GSL::Rootsc::gsl_root_fdfsolver_alloc", _wrap_gsl_root_fdfsolver_alloc},
4938 {"Math::GSL::Rootsc::gsl_root_fdfsolver_set", _wrap_gsl_root_fdfsolver_set},
4939 {"Math::GSL::Rootsc::gsl_root_fdfsolver_iterate", _wrap_gsl_root_fdfsolver_iterate},
4940 {"Math::GSL::Rootsc::gsl_root_fdfsolver_free", _wrap_gsl_root_fdfsolver_free},
4941 {"Math::GSL::Rootsc::gsl_root_fdfsolver_name", _wrap_gsl_root_fdfsolver_name},
4942 {"Math::GSL::Rootsc::gsl_root_fdfsolver_root", _wrap_gsl_root_fdfsolver_root},
4943 {"Math::GSL::Rootsc::gsl_root_test_interval", _wrap_gsl_root_test_interval},
4944 {"Math::GSL::Rootsc::gsl_root_test_residual", _wrap_gsl_root_test_residual},
4945 {"Math::GSL::Rootsc::gsl_root_test_delta", _wrap_gsl_root_test_delta},
4946 {0,0}
4947 };
4948 /* -----------------------------------------------------------------------------
4949  * Type initialization:
4950  * This problem is tough by the requirement that no dynamic
4951  * memory is used. Also, since swig_type_info structures store pointers to
4952  * swig_cast_info structures and swig_cast_info structures store pointers back
4953  * to swig_type_info structures, we need some lookup code at initialization.
4954  * The idea is that swig generates all the structures that are needed.
4955  * The runtime then collects these partially filled structures.
4956  * The SWIG_InitializeModule function takes these initial arrays out of
4957  * swig_module, and does all the lookup, filling in the swig_module.types
4958  * array with the correct data and linking the correct swig_cast_info
4959  * structures together.
4960  *
4961  * The generated swig_type_info structures are assigned statically to an initial
4962  * array. We just loop through that array, and handle each type individually.
4963  * First we lookup if this type has been already loaded, and if so, use the
4964  * loaded structure instead of the generated one. Then we have to fill in the
4965  * cast linked list. The cast data is initially stored in something like a
4966  * two-dimensional array. Each row corresponds to a type (there are the same
4967  * number of rows as there are in the swig_type_initial array). Each entry in
4968  * a column is one of the swig_cast_info structures for that type.
4969  * The cast_initial array is actually an array of arrays, because each row has
4970  * a variable number of columns. So to actually build the cast linked list,
4971  * we find the array of casts associated with the type, and loop through it
4972  * adding the casts to the list. The one last trick we need to do is making
4973  * sure the type pointer in the swig_cast_info struct is correct.
4974  *
4975  * First off, we lookup the cast->type name to see if it is already loaded.
4976  * There are three cases to handle:
4977  *  1) If the cast->type has already been loaded AND the type we are adding
4978  *     casting info to has not been loaded (it is in this module), THEN we
4979  *     replace the cast->type pointer with the type pointer that has already
4980  *     been loaded.
4981  *  2) If BOTH types (the one we are adding casting info to, and the
4982  *     cast->type) are loaded, THEN the cast info has already been loaded by
4983  *     the previous module so we just ignore it.
4984  *  3) Finally, if cast->type has not already been loaded, then we add that
4985  *     swig_cast_info to the linked list (because the cast->type) pointer will
4986  *     be correct.
4987  * ----------------------------------------------------------------------------- */
4988 
4989 #ifdef __cplusplus
4990 extern "C" {
4991 #if 0
4992 } /* c-mode */
4993 #endif
4994 #endif
4995 
4996 #if 0
4997 #define SWIGRUNTIME_DEBUG
4998 #endif
4999 
5000 
5001 SWIGRUNTIME void
SWIG_InitializeModule(void * clientdata)5002 SWIG_InitializeModule(void *clientdata) {
5003   size_t i;
5004   swig_module_info *module_head, *iter;
5005   int init;
5006 
5007   /* check to see if the circular list has been setup, if not, set it up */
5008   if (swig_module.next==0) {
5009     /* Initialize the swig_module */
5010     swig_module.type_initial = swig_type_initial;
5011     swig_module.cast_initial = swig_cast_initial;
5012     swig_module.next = &swig_module;
5013     init = 1;
5014   } else {
5015     init = 0;
5016   }
5017 
5018   /* Try and load any already created modules */
5019   module_head = SWIG_GetModule(clientdata);
5020   if (!module_head) {
5021     /* This is the first module loaded for this interpreter */
5022     /* so set the swig module into the interpreter */
5023     SWIG_SetModule(clientdata, &swig_module);
5024   } else {
5025     /* the interpreter has loaded a SWIG module, but has it loaded this one? */
5026     iter=module_head;
5027     do {
5028       if (iter==&swig_module) {
5029         /* Our module is already in the list, so there's nothing more to do. */
5030         return;
5031       }
5032       iter=iter->next;
5033     } while (iter!= module_head);
5034 
5035     /* otherwise we must add our module into the list */
5036     swig_module.next = module_head->next;
5037     module_head->next = &swig_module;
5038   }
5039 
5040   /* When multiple interpreters are used, a module could have already been initialized in
5041        a different interpreter, but not yet have a pointer in this interpreter.
5042        In this case, we do not want to continue adding types... everything should be
5043        set up already */
5044   if (init == 0) return;
5045 
5046   /* Now work on filling in swig_module.types */
5047 #ifdef SWIGRUNTIME_DEBUG
5048   printf("SWIG_InitializeModule: size %lu\n", (unsigned long)swig_module.size);
5049 #endif
5050   for (i = 0; i < swig_module.size; ++i) {
5051     swig_type_info *type = 0;
5052     swig_type_info *ret;
5053     swig_cast_info *cast;
5054 
5055 #ifdef SWIGRUNTIME_DEBUG
5056     printf("SWIG_InitializeModule: type %lu %s\n", (unsigned long)i, swig_module.type_initial[i]->name);
5057 #endif
5058 
5059     /* if there is another module already loaded */
5060     if (swig_module.next != &swig_module) {
5061       type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
5062     }
5063     if (type) {
5064       /* Overwrite clientdata field */
5065 #ifdef SWIGRUNTIME_DEBUG
5066       printf("SWIG_InitializeModule: found type %s\n", type->name);
5067 #endif
5068       if (swig_module.type_initial[i]->clientdata) {
5069         type->clientdata = swig_module.type_initial[i]->clientdata;
5070 #ifdef SWIGRUNTIME_DEBUG
5071         printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
5072 #endif
5073       }
5074     } else {
5075       type = swig_module.type_initial[i];
5076     }
5077 
5078     /* Insert casting types */
5079     cast = swig_module.cast_initial[i];
5080     while (cast->type) {
5081       /* Don't need to add information already in the list */
5082       ret = 0;
5083 #ifdef SWIGRUNTIME_DEBUG
5084       printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
5085 #endif
5086       if (swig_module.next != &swig_module) {
5087         ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
5088 #ifdef SWIGRUNTIME_DEBUG
5089         if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
5090 #endif
5091       }
5092       if (ret) {
5093         if (type == swig_module.type_initial[i]) {
5094 #ifdef SWIGRUNTIME_DEBUG
5095           printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
5096 #endif
5097           cast->type = ret;
5098           ret = 0;
5099         } else {
5100           /* Check for casting already in the list */
5101           swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
5102 #ifdef SWIGRUNTIME_DEBUG
5103           if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
5104 #endif
5105           if (!ocast) ret = 0;
5106         }
5107       }
5108 
5109       if (!ret) {
5110 #ifdef SWIGRUNTIME_DEBUG
5111         printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
5112 #endif
5113         if (type->cast) {
5114           type->cast->prev = cast;
5115           cast->next = type->cast;
5116         }
5117         type->cast = cast;
5118       }
5119       cast++;
5120     }
5121     /* Set entry in modules->types array equal to the type */
5122     swig_module.types[i] = type;
5123   }
5124   swig_module.types[i] = 0;
5125 
5126 #ifdef SWIGRUNTIME_DEBUG
5127   printf("**** SWIG_InitializeModule: Cast List ******\n");
5128   for (i = 0; i < swig_module.size; ++i) {
5129     int j = 0;
5130     swig_cast_info *cast = swig_module.cast_initial[i];
5131     printf("SWIG_InitializeModule: type %lu %s\n", (unsigned long)i, swig_module.type_initial[i]->name);
5132     while (cast->type) {
5133       printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
5134       cast++;
5135       ++j;
5136     }
5137     printf("---- Total casts: %d\n",j);
5138   }
5139   printf("**** SWIG_InitializeModule: Cast List ******\n");
5140 #endif
5141 }
5142 
5143 /* This function will propagate the clientdata field of type to
5144 * any new swig_type_info structures that have been added into the list
5145 * of equivalent types.  It is like calling
5146 * SWIG_TypeClientData(type, clientdata) a second time.
5147 */
5148 SWIGRUNTIME void
SWIG_PropagateClientData(void)5149 SWIG_PropagateClientData(void) {
5150   size_t i;
5151   swig_cast_info *equiv;
5152   static int init_run = 0;
5153 
5154   if (init_run) return;
5155   init_run = 1;
5156 
5157   for (i = 0; i < swig_module.size; i++) {
5158     if (swig_module.types[i]->clientdata) {
5159       equiv = swig_module.types[i]->cast;
5160       while (equiv) {
5161         if (!equiv->converter) {
5162           if (equiv->type && !equiv->type->clientdata)
5163           SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
5164         }
5165         equiv = equiv->next;
5166       }
5167     }
5168   }
5169 }
5170 
5171 #ifdef __cplusplus
5172 #if 0
5173 {
5174   /* c-mode */
5175 #endif
5176 }
5177 #endif
5178 
5179 
5180 
5181 #if defined(__cplusplus) && ! defined(XSPROTO)
5182 extern "C"
5183 #endif
5184 
XS(SWIG_init)5185 XS(SWIG_init) {
5186   dXSARGS;
5187   int i;
5188   (void)items;
5189 
5190   SWIG_InitializeModule(0);
5191 
5192   /* Install commands */
5193   for (i = 0; swig_commands[i].name; i++) {
5194     /* Casts only needed for Perl < 5.10. */
5195 #ifdef __cplusplus
5196     newXS(const_cast<char*>(swig_commands[i].name), swig_commands[i].wrapper, const_cast<char*>(__FILE__));
5197 #else
5198     newXS((char*)swig_commands[i].name, swig_commands[i].wrapper, (char*)__FILE__);
5199 #endif
5200   }
5201 
5202   /* Install variables */
5203   for (i = 0; swig_variables[i].name; i++) {
5204     SV *sv;
5205     sv = get_sv(swig_variables[i].name, TRUE | 0x2 | GV_ADDMULTI);
5206     if (swig_variables[i].type) {
5207       SWIG_MakePtr(sv,(void *)1, *swig_variables[i].type,0);
5208     } else {
5209       sv_setiv(sv,(IV) 0);
5210     }
5211     swig_create_magic(sv, swig_variables[i].name, swig_variables[i].set, swig_variables[i].get);
5212   }
5213 
5214   /* Install constant */
5215   for (i = 0; swig_constants[i].type; i++) {
5216     SV *sv;
5217     sv = get_sv(swig_constants[i].name, TRUE | 0x2 | GV_ADDMULTI);
5218     switch(swig_constants[i].type) {
5219     case SWIG_INT:
5220       sv_setiv(sv, (IV) swig_constants[i].lvalue);
5221       break;
5222     case SWIG_FLOAT:
5223       sv_setnv(sv, (double) swig_constants[i].dvalue);
5224       break;
5225     case SWIG_STRING:
5226       sv_setpv(sv, (const char *) swig_constants[i].pvalue);
5227       break;
5228     case SWIG_POINTER:
5229       SWIG_MakePtr(sv, swig_constants[i].pvalue, *(swig_constants[i].ptype),0);
5230       break;
5231     case SWIG_BINARY:
5232       SWIG_MakePackedObj(sv, swig_constants[i].pvalue, swig_constants[i].lvalue, *(swig_constants[i].ptype));
5233       break;
5234     default:
5235       break;
5236     }
5237     SvREADONLY_on(sv);
5238   }
5239 
5240   /*@SWIG:/usr/share/swig4.0/perl5/perltypemaps.swg,65,%set_constant@*/ do {
5241     SV *sv = get_sv((char*) SWIG_prefix "GSL_VERSION", TRUE | 0x2 | GV_ADDMULTI);
5242     sv_setsv(sv, SWIG_From_double  SWIG_PERL_CALL_ARGS_1((double)(2.7)));
5243     SvREADONLY_on(sv);
5244   } while(0) /*@SWIG@*/;
5245   /*@SWIG:/usr/share/swig4.0/perl5/perltypemaps.swg,65,%set_constant@*/ do {
5246     SV *sv = get_sv((char*) SWIG_prefix "GSL_MAJOR_VERSION", TRUE | 0x2 | GV_ADDMULTI);
5247     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(2)));
5248     SvREADONLY_on(sv);
5249   } while(0) /*@SWIG@*/;
5250   /*@SWIG:/usr/share/swig4.0/perl5/perltypemaps.swg,65,%set_constant@*/ do {
5251     SV *sv = get_sv((char*) SWIG_prefix "GSL_MINOR_VERSION", TRUE | 0x2 | GV_ADDMULTI);
5252     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(7)));
5253     SvREADONLY_on(sv);
5254   } while(0) /*@SWIG@*/;
5255   /*@SWIG:/usr/share/swig4.0/perl5/perltypemaps.swg,65,%set_constant@*/ do {
5256     SV *sv = get_sv((char*) SWIG_prefix "GSL_POSZERO", TRUE | 0x2 | GV_ADDMULTI);
5257     sv_setsv(sv, SWIG_From_double  SWIG_PERL_CALL_ARGS_1((double)((+0.0))));
5258     SvREADONLY_on(sv);
5259   } while(0) /*@SWIG@*/;
5260   /*@SWIG:/usr/share/swig4.0/perl5/perltypemaps.swg,65,%set_constant@*/ do {
5261     SV *sv = get_sv((char*) SWIG_prefix "GSL_NEGZERO", TRUE | 0x2 | GV_ADDMULTI);
5262     sv_setsv(sv, SWIG_From_double  SWIG_PERL_CALL_ARGS_1((double)((-0.0))));
5263     SvREADONLY_on(sv);
5264   } while(0) /*@SWIG@*/;
5265   /*@SWIG:/usr/share/swig4.0/perl5/perltypemaps.swg,65,%set_constant@*/ do {
5266     SV *sv = get_sv((char*) SWIG_prefix "GSL_SUCCESS", TRUE | 0x2 | GV_ADDMULTI);
5267     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(GSL_SUCCESS)));
5268     SvREADONLY_on(sv);
5269   } while(0) /*@SWIG@*/;
5270   /*@SWIG:/usr/share/swig4.0/perl5/perltypemaps.swg,65,%set_constant@*/ do {
5271     SV *sv = get_sv((char*) SWIG_prefix "GSL_FAILURE", TRUE | 0x2 | GV_ADDMULTI);
5272     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(GSL_FAILURE)));
5273     SvREADONLY_on(sv);
5274   } while(0) /*@SWIG@*/;
5275   /*@SWIG:/usr/share/swig4.0/perl5/perltypemaps.swg,65,%set_constant@*/ do {
5276     SV *sv = get_sv((char*) SWIG_prefix "GSL_CONTINUE", TRUE | 0x2 | GV_ADDMULTI);
5277     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(GSL_CONTINUE)));
5278     SvREADONLY_on(sv);
5279   } while(0) /*@SWIG@*/;
5280   /*@SWIG:/usr/share/swig4.0/perl5/perltypemaps.swg,65,%set_constant@*/ do {
5281     SV *sv = get_sv((char*) SWIG_prefix "GSL_EDOM", TRUE | 0x2 | GV_ADDMULTI);
5282     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(GSL_EDOM)));
5283     SvREADONLY_on(sv);
5284   } while(0) /*@SWIG@*/;
5285   /*@SWIG:/usr/share/swig4.0/perl5/perltypemaps.swg,65,%set_constant@*/ do {
5286     SV *sv = get_sv((char*) SWIG_prefix "GSL_ERANGE", TRUE | 0x2 | GV_ADDMULTI);
5287     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(GSL_ERANGE)));
5288     SvREADONLY_on(sv);
5289   } while(0) /*@SWIG@*/;
5290   /*@SWIG:/usr/share/swig4.0/perl5/perltypemaps.swg,65,%set_constant@*/ do {
5291     SV *sv = get_sv((char*) SWIG_prefix "GSL_EFAULT", TRUE | 0x2 | GV_ADDMULTI);
5292     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(GSL_EFAULT)));
5293     SvREADONLY_on(sv);
5294   } while(0) /*@SWIG@*/;
5295   /*@SWIG:/usr/share/swig4.0/perl5/perltypemaps.swg,65,%set_constant@*/ do {
5296     SV *sv = get_sv((char*) SWIG_prefix "GSL_EINVAL", TRUE | 0x2 | GV_ADDMULTI);
5297     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(GSL_EINVAL)));
5298     SvREADONLY_on(sv);
5299   } while(0) /*@SWIG@*/;
5300   /*@SWIG:/usr/share/swig4.0/perl5/perltypemaps.swg,65,%set_constant@*/ do {
5301     SV *sv = get_sv((char*) SWIG_prefix "GSL_EFAILED", TRUE | 0x2 | GV_ADDMULTI);
5302     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(GSL_EFAILED)));
5303     SvREADONLY_on(sv);
5304   } while(0) /*@SWIG@*/;
5305   /*@SWIG:/usr/share/swig4.0/perl5/perltypemaps.swg,65,%set_constant@*/ do {
5306     SV *sv = get_sv((char*) SWIG_prefix "GSL_EFACTOR", TRUE | 0x2 | GV_ADDMULTI);
5307     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(GSL_EFACTOR)));
5308     SvREADONLY_on(sv);
5309   } while(0) /*@SWIG@*/;
5310   /*@SWIG:/usr/share/swig4.0/perl5/perltypemaps.swg,65,%set_constant@*/ do {
5311     SV *sv = get_sv((char*) SWIG_prefix "GSL_ESANITY", TRUE | 0x2 | GV_ADDMULTI);
5312     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(GSL_ESANITY)));
5313     SvREADONLY_on(sv);
5314   } while(0) /*@SWIG@*/;
5315   /*@SWIG:/usr/share/swig4.0/perl5/perltypemaps.swg,65,%set_constant@*/ do {
5316     SV *sv = get_sv((char*) SWIG_prefix "GSL_ENOMEM", TRUE | 0x2 | GV_ADDMULTI);
5317     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(GSL_ENOMEM)));
5318     SvREADONLY_on(sv);
5319   } while(0) /*@SWIG@*/;
5320   /*@SWIG:/usr/share/swig4.0/perl5/perltypemaps.swg,65,%set_constant@*/ do {
5321     SV *sv = get_sv((char*) SWIG_prefix "GSL_EBADFUNC", TRUE | 0x2 | GV_ADDMULTI);
5322     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(GSL_EBADFUNC)));
5323     SvREADONLY_on(sv);
5324   } while(0) /*@SWIG@*/;
5325   /*@SWIG:/usr/share/swig4.0/perl5/perltypemaps.swg,65,%set_constant@*/ do {
5326     SV *sv = get_sv((char*) SWIG_prefix "GSL_ERUNAWAY", TRUE | 0x2 | GV_ADDMULTI);
5327     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(GSL_ERUNAWAY)));
5328     SvREADONLY_on(sv);
5329   } while(0) /*@SWIG@*/;
5330   /*@SWIG:/usr/share/swig4.0/perl5/perltypemaps.swg,65,%set_constant@*/ do {
5331     SV *sv = get_sv((char*) SWIG_prefix "GSL_EMAXITER", TRUE | 0x2 | GV_ADDMULTI);
5332     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(GSL_EMAXITER)));
5333     SvREADONLY_on(sv);
5334   } while(0) /*@SWIG@*/;
5335   /*@SWIG:/usr/share/swig4.0/perl5/perltypemaps.swg,65,%set_constant@*/ do {
5336     SV *sv = get_sv((char*) SWIG_prefix "GSL_EZERODIV", TRUE | 0x2 | GV_ADDMULTI);
5337     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(GSL_EZERODIV)));
5338     SvREADONLY_on(sv);
5339   } while(0) /*@SWIG@*/;
5340   /*@SWIG:/usr/share/swig4.0/perl5/perltypemaps.swg,65,%set_constant@*/ do {
5341     SV *sv = get_sv((char*) SWIG_prefix "GSL_EBADTOL", TRUE | 0x2 | GV_ADDMULTI);
5342     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(GSL_EBADTOL)));
5343     SvREADONLY_on(sv);
5344   } while(0) /*@SWIG@*/;
5345   /*@SWIG:/usr/share/swig4.0/perl5/perltypemaps.swg,65,%set_constant@*/ do {
5346     SV *sv = get_sv((char*) SWIG_prefix "GSL_ETOL", TRUE | 0x2 | GV_ADDMULTI);
5347     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(GSL_ETOL)));
5348     SvREADONLY_on(sv);
5349   } while(0) /*@SWIG@*/;
5350   /*@SWIG:/usr/share/swig4.0/perl5/perltypemaps.swg,65,%set_constant@*/ do {
5351     SV *sv = get_sv((char*) SWIG_prefix "GSL_EUNDRFLW", TRUE | 0x2 | GV_ADDMULTI);
5352     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(GSL_EUNDRFLW)));
5353     SvREADONLY_on(sv);
5354   } while(0) /*@SWIG@*/;
5355   /*@SWIG:/usr/share/swig4.0/perl5/perltypemaps.swg,65,%set_constant@*/ do {
5356     SV *sv = get_sv((char*) SWIG_prefix "GSL_EOVRFLW", TRUE | 0x2 | GV_ADDMULTI);
5357     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(GSL_EOVRFLW)));
5358     SvREADONLY_on(sv);
5359   } while(0) /*@SWIG@*/;
5360   /*@SWIG:/usr/share/swig4.0/perl5/perltypemaps.swg,65,%set_constant@*/ do {
5361     SV *sv = get_sv((char*) SWIG_prefix "GSL_ELOSS", TRUE | 0x2 | GV_ADDMULTI);
5362     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(GSL_ELOSS)));
5363     SvREADONLY_on(sv);
5364   } while(0) /*@SWIG@*/;
5365   /*@SWIG:/usr/share/swig4.0/perl5/perltypemaps.swg,65,%set_constant@*/ do {
5366     SV *sv = get_sv((char*) SWIG_prefix "GSL_EROUND", TRUE | 0x2 | GV_ADDMULTI);
5367     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(GSL_EROUND)));
5368     SvREADONLY_on(sv);
5369   } while(0) /*@SWIG@*/;
5370   /*@SWIG:/usr/share/swig4.0/perl5/perltypemaps.swg,65,%set_constant@*/ do {
5371     SV *sv = get_sv((char*) SWIG_prefix "GSL_EBADLEN", TRUE | 0x2 | GV_ADDMULTI);
5372     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(GSL_EBADLEN)));
5373     SvREADONLY_on(sv);
5374   } while(0) /*@SWIG@*/;
5375   /*@SWIG:/usr/share/swig4.0/perl5/perltypemaps.swg,65,%set_constant@*/ do {
5376     SV *sv = get_sv((char*) SWIG_prefix "GSL_ENOTSQR", TRUE | 0x2 | GV_ADDMULTI);
5377     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(GSL_ENOTSQR)));
5378     SvREADONLY_on(sv);
5379   } while(0) /*@SWIG@*/;
5380   /*@SWIG:/usr/share/swig4.0/perl5/perltypemaps.swg,65,%set_constant@*/ do {
5381     SV *sv = get_sv((char*) SWIG_prefix "GSL_ESING", TRUE | 0x2 | GV_ADDMULTI);
5382     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(GSL_ESING)));
5383     SvREADONLY_on(sv);
5384   } while(0) /*@SWIG@*/;
5385   /*@SWIG:/usr/share/swig4.0/perl5/perltypemaps.swg,65,%set_constant@*/ do {
5386     SV *sv = get_sv((char*) SWIG_prefix "GSL_EDIVERGE", TRUE | 0x2 | GV_ADDMULTI);
5387     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(GSL_EDIVERGE)));
5388     SvREADONLY_on(sv);
5389   } while(0) /*@SWIG@*/;
5390   /*@SWIG:/usr/share/swig4.0/perl5/perltypemaps.swg,65,%set_constant@*/ do {
5391     SV *sv = get_sv((char*) SWIG_prefix "GSL_EUNSUP", TRUE | 0x2 | GV_ADDMULTI);
5392     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(GSL_EUNSUP)));
5393     SvREADONLY_on(sv);
5394   } while(0) /*@SWIG@*/;
5395   /*@SWIG:/usr/share/swig4.0/perl5/perltypemaps.swg,65,%set_constant@*/ do {
5396     SV *sv = get_sv((char*) SWIG_prefix "GSL_EUNIMPL", TRUE | 0x2 | GV_ADDMULTI);
5397     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(GSL_EUNIMPL)));
5398     SvREADONLY_on(sv);
5399   } while(0) /*@SWIG@*/;
5400   /*@SWIG:/usr/share/swig4.0/perl5/perltypemaps.swg,65,%set_constant@*/ do {
5401     SV *sv = get_sv((char*) SWIG_prefix "GSL_ECACHE", TRUE | 0x2 | GV_ADDMULTI);
5402     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(GSL_ECACHE)));
5403     SvREADONLY_on(sv);
5404   } while(0) /*@SWIG@*/;
5405   /*@SWIG:/usr/share/swig4.0/perl5/perltypemaps.swg,65,%set_constant@*/ do {
5406     SV *sv = get_sv((char*) SWIG_prefix "GSL_ETABLE", TRUE | 0x2 | GV_ADDMULTI);
5407     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(GSL_ETABLE)));
5408     SvREADONLY_on(sv);
5409   } while(0) /*@SWIG@*/;
5410   /*@SWIG:/usr/share/swig4.0/perl5/perltypemaps.swg,65,%set_constant@*/ do {
5411     SV *sv = get_sv((char*) SWIG_prefix "GSL_ENOPROG", TRUE | 0x2 | GV_ADDMULTI);
5412     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(GSL_ENOPROG)));
5413     SvREADONLY_on(sv);
5414   } while(0) /*@SWIG@*/;
5415   /*@SWIG:/usr/share/swig4.0/perl5/perltypemaps.swg,65,%set_constant@*/ do {
5416     SV *sv = get_sv((char*) SWIG_prefix "GSL_ENOPROGJ", TRUE | 0x2 | GV_ADDMULTI);
5417     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(GSL_ENOPROGJ)));
5418     SvREADONLY_on(sv);
5419   } while(0) /*@SWIG@*/;
5420   /*@SWIG:/usr/share/swig4.0/perl5/perltypemaps.swg,65,%set_constant@*/ do {
5421     SV *sv = get_sv((char*) SWIG_prefix "GSL_ETOLF", TRUE | 0x2 | GV_ADDMULTI);
5422     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(GSL_ETOLF)));
5423     SvREADONLY_on(sv);
5424   } while(0) /*@SWIG@*/;
5425   /*@SWIG:/usr/share/swig4.0/perl5/perltypemaps.swg,65,%set_constant@*/ do {
5426     SV *sv = get_sv((char*) SWIG_prefix "GSL_ETOLX", TRUE | 0x2 | GV_ADDMULTI);
5427     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(GSL_ETOLX)));
5428     SvREADONLY_on(sv);
5429   } while(0) /*@SWIG@*/;
5430   /*@SWIG:/usr/share/swig4.0/perl5/perltypemaps.swg,65,%set_constant@*/ do {
5431     SV *sv = get_sv((char*) SWIG_prefix "GSL_ETOLG", TRUE | 0x2 | GV_ADDMULTI);
5432     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(GSL_ETOLG)));
5433     SvREADONLY_on(sv);
5434   } while(0) /*@SWIG@*/;
5435   /*@SWIG:/usr/share/swig4.0/perl5/perltypemaps.swg,65,%set_constant@*/ do {
5436     SV *sv = get_sv((char*) SWIG_prefix "GSL_EOF", TRUE | 0x2 | GV_ADDMULTI);
5437     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(GSL_EOF)));
5438     SvREADONLY_on(sv);
5439   } while(0) /*@SWIG@*/;
5440   SWIG_TypeClientData(SWIGTYPE_p_gsl_root_fsolver_type, (void*) "Math::GSL::Roots::gsl_root_fsolver_type");
5441   SWIG_TypeClientData(SWIGTYPE_p_gsl_root_fsolver, (void*) "Math::GSL::Roots::gsl_root_fsolver");
5442   SWIG_TypeClientData(SWIGTYPE_p_gsl_root_fdfsolver_type, (void*) "Math::GSL::Roots::gsl_root_fdfsolver_type");
5443   SWIG_TypeClientData(SWIGTYPE_p_gsl_root_fdfsolver, (void*) "Math::GSL::Roots::gsl_root_fdfsolver");
5444   ST(0) = &PL_sv_yes;
5445   XSRETURN(1);
5446 }
5447 
5448