Interface to GNU GSL Numerical Integration.
Library hides memory allocation and other low level C stuff.
GNU GSL has to be installed separately. Development version of gsl is preferred. In Ubuntu the package is: libgsl-dev.
Naming of functions and keywords follow GNU GSL documentation https://www.gnu.org/software/gsl/doc/html/integration.html
The source code is distributed under the GNU General Public License.
;result= -4.000000000000085;exact result= -4.0;result= -4.000000000000085;estimated error = 1.354472090042691e-13;actual error= -8.526512829121202e-14
For more examples look at test.rkt source file.
The functions will always return a list.
First element is status code. Success when code = 0, otherwise error.
Success list: 0, result. Thereafter one or both (see GNU GSL documentation): abserr , neveal.
Error list: codenr, gsl-symbol, message.
(0resultabserrneval)
(codenrgsl-symbolmessage)
(resultabserrneval)
(0resultabserr)
(codenrgsl-symbolmessage)
(resultabserr)
The presence of an integrable singularity in the integration region causes an adaptive routine to concentrate new subintervals around the singularity. As the subintervals decrease in size the successive approximations to the integral converge in a limiting fashion. This approach to the limit can be accelerated using an extrapolation procedure. The QAGS algorithm combines adaptive bisection with the Wynn epsilon-algorithm to speed up the integration of many types of integrable singularities.
(resultabserr)
Dublicates points will removed and the points will be sorted.
(resultabserr)
(resultabserr)
a:real?
b:real?
If you get an error that it can not find Romberg, but not error on the other functions: You have and older version of GNU GSL on our system. Romberg was added at version 2.5
If you get error: ffi-lib: couldn’t open "libgslcblas.so" (libgslcblas.so: cannot open shared object file: No such file or directory):
Solution 1: Install development version of gsl. In Ubuntu the package is: libgsl-dev.
Solution 2: Modify source code in wrap.rkt with version number. This apply if you have installed package with version number. Example: libgsl27
(define-ffi-definergslcblas(ffi-lib"libgslcblas"#:global?#t))(define-ffi-definergsl(ffi-lib"libgsl"#:global?#t))
Modify this to
(define-ffi-definergslcblas(ffi-lib"libgslcblas"'("0"#f)#:global?#t))(define-ffi-definergsl(ffi-lib"libgsl"'("27"#f)#:global?#t))
Solution 3: Specify absolute path in wrap.rkt without .so extension (package location may differ).
(define-ffi-definergsl(ffi-lib"/usr/lib/x86_64-linux-gnu/libgslcblas"#:global?#t))(define-ffi-definergslcblas(ffi-lib"/usr/lib/x86_64-linux-gnu/libgsl"#:global?#t))
C/C++ exception’s do not mix well with Racket exception’s. Try run at command line to see what exception is raised.