Wiki
Download
Manual
Eggs
API
Tests
Bugs
show
edit
history
You can edit this page using
wiki syntax
for markup.
Article contents:
== Outdated egg! This is an egg for CHICKEN 3, the unsupported old release. You're almost certainly looking for [[/eggref/4/gsl-srfi-27|the CHICKEN 4 version of this egg]], if it exists. If it does not exist, there may be equivalent functionality provided by another egg; have a look at the [[https://wiki.call-cc.org/chicken-projects/egg-index-4.html|egg index]]. Otherwise, please consider porting this egg to the current version of CHICKEN. [[tags: eggs]] == Documentation for the {{gsl-srfi-27}} egg [[toc:]] === Introduction The {{gsl-srfi-27}} egg provides an implementation of [[http://srfi.schemers.org/srfi-27|SRFI-27]] which uses the [[http://www.gnu.org/software/gsl/|GSL]] behind the scenes to generate pseudo-random numbers. === Examples <enscript highlight=scheme> (use syntax-case gsl-srfi-27) (import gsl-srfi-27) (random-real) ; => some random real number (random-source-randomize! default-random-source) (random-integer 100) ; => some integer between 0 and 99 (inclusive) </enscript> You can also use some of the simulation-quality generators from the GSL: <enscript highlight=scheme> (use syntax-case gsl-srfi-27) (import gsl-srfi-27) (let* ((luxury-source (make-random-source *ranlxd2*)) ; Ahhh---what a luxurious generator (luxury-real (random-source-make-reals luxury-source))) (random-source-randomize! luxury-source) ; Don't forget this, or you won't experience true luxury (luxury-real)) ;; A *very* random number. </enscript> === Authors Written by [[http://web.mit.edu/farr/www/|Will M. Farr]]. === License Released under the [[http://www.gnu.org/copyleft/gpl.html|GPL]]. === Requirements Requires the eggs {{syntax-case}} and {{easyffi}}. === Documentation In addition to the routines from SRFI-27, after issuing {{(import gsl-srfi-27)}} the following will be available in the namespace: [rng-type] *mt19937* [rng-type] *ranlxd1* [rng-type] *ranlxd2* [rng-type] *cmrg* [rng-type] *mrg* [rng-type] *taus* [rng-type] *taus2* [rng-type] *gfsr4* A subset of the GSL simulation-quality generator types, suitable to pass to {{(make-random-source TYPE)}}. Don't accept anything less than a simulation-quality generator! [procedure] (rng-type? OBJ) {{#f}} unless {{OBJ}} is one of the above generator types. ==== Standards Violation The {{gsl-srfi-27}} egg does not completely conform to the SRFI-27 standard: {{(random-source-make-reals SOURCE [UNIT])}} throws an error if the {{UNIT}} parameter is passed instead of generating a random source with the given quantization. === Version History ; Version 1.0 : Initial release.
Description of your changes:
I would like to authenticate
Authentication
Username:
Password:
Spam control
What do you get when you subtract 2 from 9?