1 %module
"Math::GSL::Errno"
3 %include
"gsl_typemaps.i"
5 #include
"gsl/gsl_errno.h"
6 #include
"gsl/gsl_types.h"
8 %include
"gsl/gsl_errno.h"
9 %include
"gsl/gsl_types.h"
13 gsl_error gsl_stream_printf gsl_strerror gsl_set_error_handler
14 gsl_set_error_handler_off gsl_set_stream_handler gsl_set_stream
15 $GSL_SUCCESS $GSL_FAILURE $GSL_CONTINUE $GSL_EDOM
16 $GSL_ERANGE $GSL_EFAULT $GSL_EINVAL $GSL_EFAILED
17 $GSL_EFACTOR $GSL_ESANITY $GSL_ENOMEM $GSL_EBADFUNC
18 $GSL_ERUNAWAY $GSL_EMAXITER $GSL_EZERODIV $GSL_EBADTOL
19 $GSL_ETOL $GSL_EUNDRFLW $GSL_EOVRFLW $GSL_ELOSS
20 $GSL_EROUND $GSL_EBADLEN $GSL_ENOTSQR $GSL_ESING
21 $GSL_EDIVERGE $GSL_EUNSUP $GSL_EUNIMPL $GSL_ECACHE
22 $GSL_ETABLE $GSL_ENOPROG $GSL_ENOPROGJ $GSL_ETOLF
23 $GSL_ETOLX $GSL_ETOLG $GSL_EOF
25 %EXPORT_TAGS
= ( all
=> [ @EXPORT_OK
] );
29 Math
::GSL
::Errno
- Error Handling
35 use Math
::GSL
::Errno qw
/:all
/;
36 gsl_set_error_handler_off
();
38 print gsl_strerror
($GSL_EDOM
) .
"\n";
54 Iteration has not converged
58 Domain error
; used by mathematical functions when an argument value does not fall into the domain over which the function is defined
(like EDOM in the C library
)
62 Range error
; used by mathematical functions when the result value is not representable because of overflow or underflow
(like ERANGE in the C library
)
70 Invalid argument. This is used to indicate various kinds of problems with passing the wrong argument to a library function
(like EINVAL in the C library
).Invalid argument. This is used to indicate various kinds of problems with passing the wrong argument to a library function
(like EINVAL in the C library
).
86 No memory available. The system cannot allocate more virtual memory because its capacity is full
(like ENOMEM in the C library
). This error is reported when a GSL routine encounters problems when trying to allocate memory with malloc.
90 Problem with user-supplied function
94 Iterative process is our of control
98 Exceeded max number of iterations
100 =item
* $GSL_EZERODIV
106 Invalid user-specified tolerance
110 Failed to reach the specified tolerance
112 =item
* $GSL_EUNDRFLW
126 Failed due to roundoff error
130 Matrix
/vector lengths not compatible
140 =item
* $GSL_EDIVERGE
142 Integral
/Series is divergent
146 Not supported by hardware
162 Iteration not converging
164 =item
* $GSL_ENOPROGJ
166 Jacobian not improving solution
170 Cannot reach tolerance in F
174 Cannot reach tolerance in
X
178 Cannot reach tolerance in Gradient
192 =item
* gsl_stream_printf
194 =item
* gsl_strerror
($gsl_errno
) - This function returns a pointer to a string describing the error code gsl_errno. For example
, print
("error: gsl_strerror ($status)\n"); would print an error message like error
: output range error for a status value of GSL_ERANGE.
196 =item
* gsl_set_error_handler
198 =item
* gsl_set_error_handler_off
() - This function turns off the error handler by defining an error handler which does nothing. This will cause the program to continue after any error
, so the return values from any library routines must be checked. This is the recommended behavior for production programs. The previous handler is returned
(so that you can restore it later
).
200 =item
* gsl_set_stream_handler
202 =item
* gsl_set_stream