Commit 8c92fe16 authored by liam's avatar liam
Browse files

Add dependency. Fix minor spelling errors. Add mathematica test.

Add #'generator method.


git-svn-id: svn+ssh://pop/opt/space/mathematics/gsl/trunk@3184 a3d8a0fb-c1db-0310-ace7-a616afeb9e30
parent 30436f21
......@@ -3,7 +3,7 @@
; description: Vectors
; date: Sun Mar 26 2006 - 11:51
; author: Liam M. Healy
; modified: Sun Dec 3 2006 - 18:44
; modified: Sun Feb 18 2007 - 19:08
;********************************************************
;;; $Id: $
......@@ -72,7 +72,7 @@ deallocated with the vector.
args))
(defmethod gsl-array ((object gsl-vector))
(foreign-slot-value (pointer object) 'gsl-vector-c 'data))
(cffi:foreign-slot-value (pointer object) 'gsl-vector-c 'data))
;;;;****************************************************************************
;;;; Getting values
......
......@@ -3,7 +3,7 @@
; description: Definition of GSLL system
; date:
; author: Liam Healy
; modified: Sun Feb 4 2007 - 23:06
; modified: Sun Feb 11 2007 - 16:14
;********************************************************
;;; $Id: $
......@@ -151,4 +151,4 @@
(:file "read-write" :depends-on (histogram))
(:file "probability-distribution" :depends-on (histogram))
(:file "ntuple")))
(:file "monte-carlo" :depends-on (init data random))))
(:file "monte-carlo" :depends-on (init data random numerical-integration))))
......@@ -3,7 +3,7 @@
; description: Generators of random numbers.
; date: Sat Jul 15 2006 - 14:43
; author: Liam M. Healy
; modified: Sun Jul 16 2006 - 17:41
; modified: Sat Feb 17 2007 - 21:56
;********************************************************
;;; $Id: $
......@@ -13,6 +13,13 @@
(export '(random-number-generator make-random-number-generator))
(defgeneric generator (object)
(:method ((object t))
(if (cffi:pointerp object)
object
(call-next-method)))
(:documentation "The foreign pointer to the GSL generator function."))
(defclass gsl-random ()
((type :initarg :type :reader rng-type)
(generator :initarg :generator :accessor generator)))
......@@ -207,7 +214,7 @@
:type :method
:documentation
"Create a new generator which is an exact copy of the original.
Dont' use; use #'make-random-number-generator, #'copy instead.")
Don't use; use #'make-random-number-generator, #'copy instead.")
(defun-gsl write-binary
((object random-number-generator) stream)
......@@ -227,6 +234,7 @@
(defparameter *rng-mt19937* (make-random-number-generator *mt19937*))
(defparameter *rng-cmrg* (make-random-number-generator *cmrg*))
;;; (defparameter *rng-default* (make-random-number-generator *default-type*))
(lisp-unit:define-test random-number-generators
(lisp-unit:assert-equal
......
;********************************************************
; file: quasi.lisp
; description: Quasi-Random Number Generators
; description: Quasi-random sequences in arbitrary dimensions.
; date: Sun Jul 16 2006 - 15:54
; author: Liam M. Healy
; modified: Sun Dec 31 2006 - 22:59
; modified: Sat Feb 17 2007 - 17:45
;********************************************************
;;; $Id: $
......@@ -106,7 +106,7 @@
:type :method
:documentation
"Create a new generator which is an exact copy of the original.
Dont' use; use #'make-random-number-generator, #'copy instead.")
Don't use; use #'make-random-number-generator, #'copy instead.")
(def-rng-type *niederreiter2*
"Described in Bratley, Fox, Niederreiter,
......@@ -115,7 +115,8 @@
"gsl_qrng_niederreiter_2")
(eval-when (:load-toplevel :execute)
(setf *default-quasi-random-number-generator* *niederreiter2*))
(setf *default-quasi-random-number-generator*
(make-quasi-random-number-generator 2 *niederreiter2*)))
(def-rng-type *sobol*
"This generator uses the Sobol sequence described in Antonov, Saleev,
......
......@@ -3,7 +3,7 @@
; description: Airy functions
; date: Fri Mar 17 2006 - 18:41
; author: Liam M. Healy
; modified: Wed Jun 7 2006 - 17:32
; modified: Sun Feb 18 2007 - 12:16
;********************************************************
(in-package :gsl)
......@@ -92,3 +92,16 @@
(lisp-unit:assert-first-fp-equal "-0.117371322271d+01" (airy-zero-bi 1))
(lisp-unit:assert-first-fp-equal "-0.101879297165d+01" (airy-zero-ai-deriv 1))
(lisp-unit:assert-first-fp-equal "-0.229443968261d+01" (airy-zero-bi-deriv 1)))
#|
;;; Mathematica results
In[4]:= AiryAi[2.5]
Out[4]= 0.01572592338047049
In[5]:= AiryBi[2.5]
Out[5]= 6.481660738460579
In[6]:= AiryAiPrime[2.5]
Out[6]= -0.02625088103590323
In[7]:= AiryBiPrime[2.5]
Out[7]= 9.4214233173343
|#
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment