1 FFI Libraries
libgsl
libgslcblas
2 Random Number Generation
2.1 Basic FFI Values and Predicates
_ gsl-rng-type-pointer
gsl-rng-type?
_ gsl-rng-pointer
gsl-rng?
_ gsl-rng-state-pointer
gsl-rng-state?
2.2 RNG Types
gsl-rng-borosh13
gsl-rng-coveyou
gsl-rng-cmrg
gsl-rng-fishman18
gsl-rng-fishman20
gsl-rng-fishman2x
gsl-rng-gfsr4
gsl-rng-knuthran
gsl-rng-knuthran2
gsl-rng-knuthran2002
gsl-rng-lecuyer21
gsl-rng-minstd
gsl-rng-mrg
gsl-rng-mt19937
gsl-rng-mt19937-1999
gsl-rng-mt19937-1998
gsl-rng-r250
gsl-rng-ran0
gsl-rng-ran1
gsl-rng-ran2
gsl-rng-ran3
gsl-rng-rand
gsl-rng-rand48
gsl-rng-random128-bsd
gsl-rng-random128-glibc2
gsl-rng-random128-libc5
gsl-rng-random256-bsd
gsl-rng-random256-glibc2
gsl-rng-random256-libc5
gsl-rng-random32-bsd
gsl-rng-random32-glibc2
gsl-rng-random32-libc5
gsl-rng-random64-bsd
gsl-rng-random64-glibc2
gsl-rng-random64-libc5
gsl-rng-random8-bsd
gsl-rng-random8-glibc2
gsl-rng-random8-libc5
gsl-rng-random-bsd
gsl-rng-random-glibc2
gsl-rng-random-libc5
gsl-rng-randu
gsl-rng-ranf
gsl-rng-ranlux
gsl-rng-ranlux389
gsl-rng-ranlxd1
gsl-rng-ranlxd2
gsl-rng-ranlxs0
gsl-rng-ranlxs1
gsl-rng-ranlxs2
gsl-rng-ranmar
gsl-rng-slatec
gsl-rng-taus
gsl-rng-taus2
gsl-rng-taus113
gsl-rng-transputer
gsl-rng-tt800
gsl-rng-uni
gsl-rng-uni32
gsl-rng-vax
gsl-rng-waterman14
gsl-rng-zuf
2.3 RNG Functions
gsl-rng-alloc
gsl-rng-memcpy
gsl-rng-clone
gsl-rng-set!
gsl-rng-state-set!
gsl-rng-max
gsl-rng-min
gsl-rng-name
gsl-rng-size
gsl-rng-state
gsl-rng-get
gsl-rng-uniform
gsl-rng-uniform-pos
gsl-rng-uniform-int
3 License
Version: 4.0.1.3

MzGSL: MzScheme Bindings to the GNU Scientific Library

The "mzgsl.plt" PLaneT package provides bindings to the GNU Scientific Library. It is currently very incomplete: only the random number generators from the GSL are bound.

You can use the bindings from "mzgsl.plt" in your programs by issuing the command (require (planet "all.ss" ("wmfarr" "mzgsl.plt" 3 0))) or, in shortened notation (require (planet wmfarr/mzgsl:3:0/all)). The "all.ss" module exports all bindings of the "mzgsl.plt" package.

The mzgsl.plt package is released under the GPL; see the License section of this document for more information. "mzgsl.plt" is maintained by Will M. Farr; send feature requests and bug reports to that address.

1 FFI Libraries

 (require (planet wmfarr/mzgsl:3:0/gsl-lib))

The system makes a reasonable effort to find the libraries for the GSL and GSL’s CBLAS on your system; if it cannot, report it as a bug, and I’ll add the appropriate code to locate the GSL on your system.

libgsl : any/c

libgslcblas : any/c

ffi-lib objects which point to the corresponding foreign library.

2 Random Number Generation

 (require (planet wmfarr/mzgsl:3:0/gsl-rng))

The following functions are provided by "gsl-rng.ss". The naming scheme follows very closely the GSL naming scheme, with _ replaced by -, and an ! inserted in gsl-rng-set!. Note also that gsl-rng-state-set! is provided even though that is not a function in the GSL library.

2.1 Basic FFI Values and Predicates

_gsl-rng-type-pointer : any/c

(gsl-rng-type? obj)  boolean?

  obj : any/c

_gsl-rng-pointer : any/c

(gsl-rng? obj)  boolean?

  obj : any/c

_gsl-rng-state-pointer : any/c

(gsl-rng-state? obj)  boolean?

  obj : any/c

These are the foreign types and corresponding predicates for objects from the GSL RNG library.

2.2 RNG Types

gsl-rng-borosh13 : gsl-rng-type?

gsl-rng-coveyou : gsl-rng-type?

gsl-rng-cmrg : gsl-rng-type?

gsl-rng-fishman18 : gsl-rng-type?

gsl-rng-fishman20 : gsl-rng-type?

gsl-rng-fishman2x : gsl-rng-type?

gsl-rng-gfsr4 : gsl-rng-type?

gsl-rng-knuthran : gsl-rng-type?

gsl-rng-knuthran2 : gsl-rng-type?

gsl-rng-knuthran2002 : gsl-rng-type?

gsl-rng-lecuyer21 : gsl-rng-type?

gsl-rng-minstd : gsl-rng-type?

gsl-rng-mrg : gsl-rng-type?

gsl-rng-mt19937 : gsl-rng-type?

gsl-rng-mt19937-1999 : gsl-rng-type?

gsl-rng-mt19937-1998 : gsl-rng-type?

gsl-rng-r250 : gsl-rng-type?

gsl-rng-ran0 : gsl-rng-type?

gsl-rng-ran1 : gsl-rng-type?

gsl-rng-ran2 : gsl-rng-type?

gsl-rng-ran3 : gsl-rng-type?

gsl-rng-rand : gsl-rng-type?

gsl-rng-rand48 : gsl-rng-type?

gsl-rng-random128-bsd : gsl-rng-type?

gsl-rng-random128-glibc2 : gsl-rng-type?

gsl-rng-random128-libc5 : gsl-rng-type?

gsl-rng-random256-bsd : gsl-rng-type?

gsl-rng-random256-glibc2 : gsl-rng-type?

gsl-rng-random256-libc5 : gsl-rng-type?

gsl-rng-random32-bsd : gsl-rng-type?

gsl-rng-random32-glibc2 : gsl-rng-type?

gsl-rng-random32-libc5 : gsl-rng-type?

gsl-rng-random64-bsd : gsl-rng-type?

gsl-rng-random64-glibc2 : gsl-rng-type?

gsl-rng-random64-libc5 : gsl-rng-type?

gsl-rng-random8-bsd : gsl-rng-type?

gsl-rng-random8-glibc2 : gsl-rng-type?

gsl-rng-random8-libc5 : gsl-rng-type?

gsl-rng-random-bsd : gsl-rng-type?

gsl-rng-random-glibc2 : gsl-rng-type?

gsl-rng-random-libc5 : gsl-rng-type?

gsl-rng-randu : gsl-rng-type?

gsl-rng-ranf : gsl-rng-type?

gsl-rng-ranlux : gsl-rng-type?

gsl-rng-ranlux389 : gsl-rng-type?

gsl-rng-ranlxd1 : gsl-rng-type?

gsl-rng-ranlxd2 : gsl-rng-type?

gsl-rng-ranlxs0 : gsl-rng-type?

gsl-rng-ranlxs1 : gsl-rng-type?

gsl-rng-ranlxs2 : gsl-rng-type?

gsl-rng-ranmar : gsl-rng-type?

gsl-rng-slatec : gsl-rng-type?

gsl-rng-taus : gsl-rng-type?

gsl-rng-taus2 : gsl-rng-type?

gsl-rng-taus113 : gsl-rng-type?

gsl-rng-transputer : gsl-rng-type?

gsl-rng-tt800 : gsl-rng-type?

gsl-rng-uni : gsl-rng-type?

gsl-rng-uni32 : gsl-rng-type?

gsl-rng-vax : gsl-rng-type?

gsl-rng-waterman14 : gsl-rng-type?

gsl-rng-zuf : gsl-rng-type?

The various types of generators provided by the GSL.

2.3 RNG Functions

(gsl-rng-alloc type)  gsl-rng?

  type : gsl-rng-type?

(gsl-rng-memcpy target source)  any

  target : gsl-rng?

  source : gsl-rng?

(gsl-rng-clone rng)  gsl-rng?

  rng : gsl-rng?

Allocating and modifying GSL RNGs. Note that a gsl-rng-free procedure is *not* provided by the library; memory management is automatic in this library. The alloc and clone functions automatically register a finalizer for the allocated generator.

(gsl-rng-set! rng seed)  any

  rng : gsl-rng?

  seed : integer?

(gsl-rng-state-set! rng state)  any

  rng : gsl-rng?

  state : gsl-rng-state?

Set the internal state of the generator.

(gsl-rng-max rng)  integer?

  rng : gsl-rng?

(gsl-rng-min rng)  integer?

  rng : gsl-rng?

(gsl-rng-name rng)  string?

  rng : gsl-rng?

(gsl-rng-size rng)  integer?

  rng : gsl-rng?

Query the properties of a particular generator.

(gsl-rng-state rng)  gsl-rng-state?

  rng : gsl-rng?

Get the internal state of the generator.

(gsl-rng-get rng)  integer?

  rng : gsl-rng?

(gsl-rng-uniform rng)  real?

  rng : gsl-rng?

(gsl-rng-uniform-pos rng)  real?

  rng : gsl-rng?

(gsl-rng-uniform-int rng max)  integer?

  rng : gsl-rng

  max : integer?

Get random numbers from the generator.

3 License

The "mzgsl.plt" package is released under the GPL, Version 3. You can find a copy of this license in the main directory of the package, or here.