Commit 64fea6a9 by Liam Healy

Updated tests; all pass

Fixes to some definitions 
lognormal, discrete: use #'mpointer
lu: new syntax for making array
quasi: order of arguments fixed in make-quasi-random-number-generator
sorting: syntax to make combination
All tests have been regenerated because syntax for arrays etc. has
changed.  Visually inspected that results match previous check in.
parent e88a5593
;; Use the foreign-friendly arrays package.
;; Liam Healy 2008-03-22 15:40:08EDT
;; Time-stamp: <2008-12-26 10:10:40EST foreign-friendly.lisp>
;; Time-stamp: <2008-12-27 10:23:27EST foreign-friendly.lisp>
;; $Id$
;;; Foreign-friendly arrays (original implementation by Tamas Papp)
......@@ -48,7 +48,7 @@
(error "dimensions must be specified if contents are not")))
(when (and initial-matrix initial-contents-p)
;; flatten matrix spec
(setf initial-contents (mapcar #'append initial-contents)))
(setf initial-contents (apply #'append initial-contents)))
(when complex-initial-real
(setf initial-contents (list-complex-from-real initial-contents)))
(apply 'make-ffa-1d
......
;; Load GSL
;; Liam Healy Sat Mar 4 2006 - 18:53
;; Time-stamp: <2008-11-25 16:20:30EST init.lisp>
;; Time-stamp: <2008-12-27 09:33:09EST init.lisp>
;; $Id$
(defpackage gsll
......@@ -11,7 +11,8 @@
(:darwin
(:or "/opt/local/lib/libgslcblas.dylib" "/sw/lib/libgslcblas.dylib"
"/usr/local/lib/libgslcblas.dylib"))
(:unix (:or "/usr/lib/libgslcblas.so.0" "/usr/lib/libgslcblas.so"))
(:unix (:or "/usr/lib/libgslcblas.so.0" "/usr/lib/libgslcblas.so"
"/usr/lib64/libgslcblas.so.0" "/usr/lib64/libgslcblas.so"))
(t (:default "libgslcblas")))
(cffi:use-foreign-library libgslcblas)
......@@ -20,7 +21,8 @@
(:darwin
(:or "/opt/local/lib/libgsl.dylib" "/sw/lib/libgsl.dylib"
"/usr/local/lib/libgsl.dylib"))
(:unix (:or "/usr/lib/libgsl.so.0" "/usr/lib/libgsl.so"))
(:unix (:or "/usr/lib/libgsl.so.0" "/usr/lib/libgsl.so"
"/usr/lib64/libgsl.so.0" "/usr/lib64/libgsl.so"))
(t (:default "libgsl")))
(cffi:use-foreign-library libgsl)
......
;; LU decomposition
;; Liam Healy, Thu Apr 27 2006 - 12:42
;; Time-stamp: <2008-12-26 12:55:48EST lu.lisp>
;; Time-stamp: <2008-12-27 10:57:53EST lu.lisp>
;; $Id$
(in-package :gsl)
......@@ -134,7 +134,7 @@
(defun invert-matrix (mat)
"Invert the matrix."
(let* ((mmat mat) ; BROKEN, requires copy of mat
(dim (array-dimension mat 0))
(dim (first (dimensions mat)))
(per (make-permutation dim))
(inv (make-marray 'double-float :dimensions (list dim dim))))
(LU-decomposition mmat per)
......@@ -143,4 +143,6 @@
(save-test lu
(invert-matrix
(make-marray '(2 2) 'double-float :initial-contents '(1.0d0 2.0d0 3.0d0 4.0d0))))
(make-marray 'double-float
:dimensions '(2 2)
:initial-contents '(1.0d0 2.0d0 3.0d0 4.0d0))))
;; Discrete random variables
;; Liam Healy, Sat Nov 11 2006 - 21:51
;; Time-stamp: <2008-12-26 18:52:04EST discrete.lisp>
;; Time-stamp: <2008-12-27 10:33:36EST discrete.lisp>
;; $Id$
(in-package :gsl)
......@@ -20,7 +20,7 @@
(defmfun discrete (generator table)
"gsl_ran_discrete"
(((mpointer generator) :pointer) (table :pointer))
(((mpointer generator) :pointer) ((mpointer table) :pointer))
:c-return sizet
:documentation ; FDL
"Generate discrete random numbers after running #'discrete-preprocess;
......
;; Lognormal distribution
;; Liam Healy, Sat Sep 30 2006
;; Time-stamp: <2008-12-26 11:41:53EST lognormal.lisp>
;; Time-stamp: <2008-12-27 10:49:01EST lognormal.lisp>
;; $Id$
(in-package :gsl)
(defmfun lognormal (generator zeta sigma)
"gsl_ran_lognormal"
(((generator generator) :pointer) (zeta :double) (sigma :double))
(((mpointer generator) :pointer) (zeta :double) (sigma :double))
:c-return :double
:documentation ; FDL
"A random variate from the lognormal distribution.
......
;; Quasi-random sequences in arbitrary dimensions.
;; Liam Healy, Sun Jul 16 2006 - 15:54
;; Time-stamp: <2008-12-26 18:49:30EST quasi.lisp>
;; Time-stamp: <2008-12-27 11:10:20EST quasi.lisp>
;; $Id$
(in-package :gsl)
......@@ -83,7 +83,7 @@
;;; Examples and unit test
(save-test quasi-random-number-generators
;; This example is given in the GSL documentation
(let ((gen (make-quasi-random-number-generator 2 *sobol*))
(let ((gen (make-quasi-random-number-generator *sobol* 2))
(vec (make-marray 'double-float :dimensions 2)))
(loop repeat 5
do (qrng-get gen vec)
......
;; Sorting
;; Liam Healy, Fri Apr 14 2006 - 20:20
;; Time-stamp: <2008-12-26 12:25:09EST sorting.lisp>
;; Time-stamp: <2008-12-27 11:36:24EST sorting.lisp>
;; $Id$
(in-package :gsl)
......@@ -279,7 +279,7 @@
(cl-array (sort-smallest m2 m1))))
(generate-all-array-tests sort-vector-smallest-index :no-complex
(let ((comb (make-combination '(8 3)))
(let ((comb (make-combination 8 3 nil))
(v1 (array-default 8)))
(cl-array (sort-vector-smallest-index comb v1))))
......@@ -294,6 +294,6 @@
(cl-array (sort-largest m2 m1))))
(generate-all-array-tests sort-vector-largest-index :no-complex
(let ((comb (make-combination '(8 3)))
(let ((comb (make-combination 8 3 nil))
(v1 (array-default 8)))
(cl-array (sort-vector-largest-index comb v1))))
......@@ -6,12 +6,14 @@
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST (LIST 6.18d0 6.647777777777779d0 6.18d0))
(MULTIPLE-VALUE-LIST
(LETM
((VEC (VECTOR-DOUBLE-FLOAT (A -3.21d0 1.0d0 12.8d0)))
(WEIGHTS
(VECTOR-DOUBLE-FLOAT (A 3.0d0 1.0d0 2.0d0))))
(LET ((MEAN (MEAN VEC)))
(LIST (ABSOLUTE-DEVIATION VEC)
(WEIGHTED-ABSOLUTE-DEVIATION VEC WEIGHTS)
(ABSOLUTE-DEVIATION VEC MEAN)))))))
(LET ((VEC
(MAKE-MARRAY 'DOUBLE-FLOAT :INITIAL-CONTENTS
'(-3.21d0 1.0d0 12.8d0)))
(WEIGHTS
(MAKE-MARRAY 'DOUBLE-FLOAT :INITIAL-CONTENTS
'(3.0d0 1.0d0 2.0d0))))
(LET ((MEAN (MEAN VEC)))
(LIST (ABSOLUTE-DEVIATION VEC)
(WEIGHTED-ABSOLUTE-DEVIATION VEC WEIGHTS)
(ABSOLUTE-DEVIATION VEC MEAN)))))))
......@@ -5,56 +5,66 @@
(LISP-UNIT:DEFINE-TEST ABSOLUTE-SUM
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL (LIST 157.99)
(MULTIPLE-VALUE-LIST
(LETM
((V1
(VECTOR-SINGLE-FLOAT
(A -34.5 8.24
3.29 -8.93
34.12 -6.15
49.27 -13.49)
NIL)))
(ABSOLUTE-SUM
V1))))
(LET ((V1
(MAKE-MARRAY
'SINGLE-FLOAT
:INITIAL-CONTENTS
'(-34.5 8.24
3.29 -8.93
34.12
-6.15
49.27
-13.49))))
(ABSOLUTE-SUM
V1))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL (LIST 157.99d0)
(MULTIPLE-VALUE-LIST
(LETM
((V1
(VECTOR-DOUBLE-FLOAT
(A -34.5d0
8.24d0 3.29d0
-8.93d0
34.12d0
-6.15d0
49.27d0
-13.49d0)
NIL)))
(ABSOLUTE-SUM
V1))))
(LET ((V1
(MAKE-MARRAY
'DOUBLE-FLOAT
:INITIAL-CONTENTS
'(-34.5d0
8.24d0
3.29d0
-8.93d0
34.12d0
-6.15d0
49.27d0
-13.49d0))))
(ABSOLUTE-SUM
V1))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL (LIST 388.65997)
(MULTIPLE-VALUE-LIST
(LETM
((V1
(VECTOR-COMPLEX-SINGLE-FLOAT
(A -34.5 8.24
3.29 -8.93
34.12 -6.15
49.27 -13.49
32.5 42.73
-17.24 43.31
-16.12 -8.25
21.44 -49.08)
NIL)))
(ABSOLUTE-SUM
V1))))
(LET ((V1
(MAKE-MARRAY
'(COMPLEX
SINGLE-FLOAT)
:INITIAL-CONTENTS
'(-34.5 8.24
3.29 -8.93
34.12
-6.15
49.27
-13.49
32.5 42.73
-17.24
43.31
-16.12
-8.25
21.44
-49.08))))
(ABSOLUTE-SUM
V1))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST 388.65999999999997d0)
(MULTIPLE-VALUE-LIST
(LETM
((V1
(VECTOR-COMPLEX-DOUBLE-FLOAT
(A -34.5d0 8.24d0 3.29d0 -8.93d0 34.12d0 -6.15d0
49.27d0 -13.49d0 32.5d0 42.73d0 -17.24d0
43.31d0 -16.12d0 -8.25d0 21.44d0 -49.08d0)
NIL)))
(ABSOLUTE-SUM V1)))))
(LET ((V1
(MAKE-MARRAY '(COMPLEX DOUBLE-FLOAT)
:INITIAL-CONTENTS
'(-34.5d0 8.24d0 3.29d0 -8.93d0
34.12d0 -6.15d0 49.27d0 -13.49d0
32.5d0 42.73d0 -17.24d0 43.31d0
-16.12d0 -8.25d0 21.44d0
-49.08d0))))
(ABSOLUTE-SUM V1)))))
......@@ -7,10 +7,10 @@
(LIST
(LIST -0.04646366834251103d0 -0.04646366834251103d0))
(MULTIPLE-VALUE-LIST
(LETM
((VEC
(VECTOR-DOUBLE-FLOAT (A -3.21d0 1.0d0 12.8d0))))
(LET ((MEAN (MEAN VEC)))
(LIST (AUTOCORRELATION VEC)
(AUTOCORRELATION VEC MEAN)))))))
(LET ((VEC
(MAKE-MARRAY 'DOUBLE-FLOAT :INITIAL-CONTENTS
'(-3.21d0 1.0d0 12.8d0))))
(LET ((MEAN (MEAN VEC)))
(LIST (AUTOCORRELATION VEC)
(AUTOCORRELATION VEC MEAN)))))))
......@@ -8,79 +8,84 @@
#(1400.77 -284.0684 -147.7214 397.47382 -1369.3191
235.659 -1932.6083 485.93335))
(MULTIPLE-VALUE-LIST
(LETM
((V1
(VECTOR-SINGLE-FLOAT
(A -34.5 8.24 3.29 -8.93 34.12 -6.15 49.27 -13.49)
NIL))
(V2
(VECTOR-SINGLE-FLOAT
(A 32.5 42.73 -17.24 43.31 -16.12 -8.25 21.44
-49.08)
NIL))
(SCALAR -39.66))
(CL-ARRAY (AXPY SCALAR V1 V2)))))
(LET ((V1
(MAKE-MARRAY 'SINGLE-FLOAT :INITIAL-CONTENTS
'(-34.5 8.24 3.29 -8.93 34.12
-6.15 49.27 -13.49)))
(V2
(MAKE-MARRAY 'SINGLE-FLOAT :INITIAL-CONTENTS
'(32.5 42.73 -17.24 43.31 -16.12
-8.25 21.44 -49.08)))
(SCALAR -39.66))
(CL-ARRAY (AXPY SCALAR V1 V2)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST
#(1400.77d0 -284.06839999999994d0 -147.7214d0
397.4738d0 -1369.3191999999997d0 235.659d0
-1932.6082d0 485.93339999999995d0))
(MULTIPLE-VALUE-LIST
(LETM
((V1
(VECTOR-DOUBLE-FLOAT
(A -34.5d0 8.24d0 3.29d0 -8.93d0 34.12d0 -6.15d0
49.27d0 -13.49d0)
NIL))
(V2
(VECTOR-DOUBLE-FLOAT
(A 32.5d0 42.73d0 -17.24d0 43.31d0 -16.12d0
-8.25d0 21.44d0 -49.08d0)
NIL))
(SCALAR -39.66d0))
(CL-ARRAY (AXPY SCALAR V1 V2)))))
(LET ((V1
(MAKE-MARRAY 'DOUBLE-FLOAT :INITIAL-CONTENTS
'(-34.5d0 8.24d0 3.29d0 -8.93d0
34.12d0 -6.15d0 49.27d0
-13.49d0)))
(V2
(MAKE-MARRAY 'DOUBLE-FLOAT :INITIAL-CONTENTS
'(32.5d0 42.73d0 -17.24d0 43.31d0
-16.12d0 -8.25d0 21.44d0
-49.08d0)))
(SCALAR -39.66d0))
(CL-ARRAY (AXPY SCALAR V1 V2)))))
(LISP-UNIT:ASSERT-ERROR 'SIMPLE-ERROR
(LETM
((V1
(VECTOR-COMPLEX-SINGLE-FLOAT
(A -34.5 8.24 3.29 -8.93
34.12 -6.15 49.27 -13.49
32.5 42.73 -17.24 43.31
-16.12 -8.25 21.44
-49.08)
NIL))
(V2
(VECTOR-COMPLEX-SINGLE-FLOAT
(A 32.5 42.73 -17.24 43.31
-16.12 -8.25 21.44 -49.08
-39.66 -49.46 19.68 -5.55
-8.82 25.37 -30.58 31.67)
NIL))
(SCALAR #C(-39.66 -49.46)))
(CL-ARRAY
(AXPY SCALAR V1 V2))))
(LET ((V1
(MAKE-MARRAY
'(COMPLEX SINGLE-FLOAT)
:INITIAL-CONTENTS
'(-34.5 8.24 3.29 -8.93
34.12 -6.15 49.27
-13.49 32.5 42.73
-17.24 43.31 -16.12
-8.25 21.44 -49.08)))
(V2
(MAKE-MARRAY
'(COMPLEX SINGLE-FLOAT)
:INITIAL-CONTENTS
'(32.5 42.73 -17.24
43.31 -16.12 -8.25
21.44 -49.08 -39.66
-49.46 19.68 -5.55
-8.82 25.37 -30.58
31.67)))
(SCALAR #C(-39.66 -49.46)))
(CL-ARRAY
(AXPY SCALAR V1 V2))))
(LISP-UNIT:ASSERT-ERROR 'SIMPLE-ERROR
(LETM
((V1
(VECTOR-COMPLEX-DOUBLE-FLOAT
(A -34.5d0 8.24d0 3.29d0
-8.93d0 34.12d0 -6.15d0
49.27d0 -13.49d0 32.5d0
42.73d0 -17.24d0 43.31d0
-16.12d0 -8.25d0 21.44d0
-49.08d0)
NIL))
(V2
(VECTOR-COMPLEX-DOUBLE-FLOAT
(A 32.5d0 42.73d0 -17.24d0
43.31d0 -16.12d0 -8.25d0
21.44d0 -49.08d0 -39.66d0
-49.46d0 19.68d0 -5.55d0
-8.82d0 25.37d0 -30.58d0
31.67d0)
NIL))
(SCALAR
#C(-39.66d0 -49.46d0)))
(CL-ARRAY
(AXPY SCALAR V1 V2)))))
(LET ((V1
(MAKE-MARRAY
'(COMPLEX DOUBLE-FLOAT)
:INITIAL-CONTENTS
'(-34.5d0 8.24d0 3.29d0
-8.93d0 34.12d0
-6.15d0 49.27d0
-13.49d0 32.5d0
42.73d0 -17.24d0
43.31d0 -16.12d0
-8.25d0 21.44d0
-49.08d0)))
(V2
(MAKE-MARRAY
'(COMPLEX DOUBLE-FLOAT)
:INITIAL-CONTENTS
'(32.5d0 42.73d0
-17.24d0 43.31d0
-16.12d0 -8.25d0
21.44d0 -49.08d0
-39.66d0 -49.46d0
19.68d0 -5.55d0
-8.82d0 25.37d0
-30.58d0 31.67d0)))
(SCALAR
#C(-39.66d0 -49.46d0)))
(CL-ARRAY
(AXPY SCALAR V1 V2)))))
......@@ -6,9 +6,9 @@
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST (LIST 0 1 1 0 1 1 0 0 0 0 0))
(MULTIPLE-VALUE-LIST
(LETM ((RNG (RANDOM-NUMBER-GENERATOR *MT19937* 0)))
(LOOP FOR I FROM 0 TO 10 COLLECT
(BERNOULLI RNG 0.5d0)))))
(LET ((RNG (MAKE-RANDOM-NUMBER-GENERATOR *MT19937* 0)))
(LOOP FOR I FROM 0 TO 10 COLLECT
(BERNOULLI RNG 0.5d0)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL (LIST 0.5d0)
(MULTIPLE-VALUE-LIST
(BERNOULLI-PDF 0
......
......@@ -17,9 +17,10 @@
#(0.35283402861563773d0 0.12894324947440206d0
0.033995719807568436d0 0.007039629755871686d0))
(MULTIPLE-VALUE-LIST
(LETM ((BESARR (VECTOR-DOUBLE-FLOAT 4)))
(CYLINDRICAL-BESSEL-JN-ARRAY 2.0d0 BESARR 2)
(CL-ARRAY BESARR))))
(LET ((BESARR
(MAKE-MARRAY 'DOUBLE-FLOAT :DIMENSIONS 4)))
(CYLINDRICAL-BESSEL-JN-ARRAY 2.0d0 BESARR 2)
(CL-ARRAY BESARR))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST -0.016940739325064968d0 1.8993556609468549d-16)
(MULTIPLE-VALUE-LIST (CYLINDRICAL-BESSEL-Y0 4.0d0)))
......@@ -34,9 +35,10 @@
#(-0.6174081041906827d0 -1.127783776840428d0
-2.7659432263306014d0 -9.935989128481978d0))
(MULTIPLE-VALUE-LIST
(LETM ((BESARR (VECTOR-DOUBLE-FLOAT 4)))
(CYLINDRICAL-BESSEL-YN-ARRAY 2.0d0 BESARR 2)
(CL-ARRAY BESARR))))
(LET ((BESARR
(MAKE-MARRAY 'DOUBLE-FLOAT :DIMENSIONS 4)))
(CYLINDRICAL-BESSEL-YN-ARRAY 2.0d0 BESARR 2)
(CL-ARRAY BESARR))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST 11.301921952136329d0 2.7297681442535893d-14)
(MULTIPLE-VALUE-LIST (CYLINDRICAL-BESSEL-I0 4.0d0)))
......@@ -51,9 +53,10 @@
#(0.6889484476987382d0 0.21273995923985267d0
0.05072856997918024d0 0.009825679323131702d0))
(MULTIPLE-VALUE-LIST
(LETM ((BESARR (VECTOR-DOUBLE-FLOAT 4)))
(CYLINDRICAL-BESSEL-IN-ARRAY 2.0d0 BESARR 2)
(CL-ARRAY BESARR))))
(LET ((BESARR
(MAKE-MARRAY 'DOUBLE-FLOAT :DIMENSIONS 4)))
(CYLINDRICAL-BESSEL-IN-ARRAY 2.0d0 BESARR 2)
(CL-ARRAY BESARR))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST 0.2070019212239867d0 2.241925168997723d-16)
(MULTIPLE-VALUE-LIST
......@@ -71,10 +74,10 @@
#(0.09323903330473338d0 0.028791222639470898d0
0.006865365386320685d0 0.0013297610941881578d0))
(MULTIPLE-VALUE-LIST
(LETM ((BESARR (VECTOR-DOUBLE-FLOAT 4)))
(CYLINDRICAL-BESSEL-IN-SCALED-ARRAY 2.0d0 BESARR
2)
(CL-ARRAY BESARR))))
(LET ((BESARR
(MAKE-MARRAY 'DOUBLE-FLOAT :DIMENSIONS 4)))
(CYLINDRICAL-BESSEL-IN-SCALED-ARRAY 2.0d0 BESARR 2)
(CL-ARRAY BESARR))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST 0.011159676085853023d0 2.0424662435034432d-17)
(MULTIPLE-VALUE-LIST (CYLINDRICAL-BESSEL-K0 4.0d0)))
......@@ -101,9 +104,10 @@
#(0.2537597545660558d0 0.6473853909486341d0
2.1959159274119586d0 9.431049100596468d0))
(MULTIPLE-VALUE-LIST
(LETM ((BESARR (VECTOR-DOUBLE-FLOAT 4)))
(CYLINDRICAL-BESSEL-KN-ARRAY 2.0d0 BESARR 2)
(CL-ARRAY BESARR))))
(LET ((BESARR
(MAKE-MARRAY 'DOUBLE-FLOAT :DIMENSIONS 4)))
(CYLINDRICAL-BESSEL-KN-ARRAY 2.0d0 BESARR 2)
(CL-ARRAY BESARR))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST -0.18920062382698205d0 1.6804391107692678d-16)
(MULTIPLE-VALUE-LIST (SPHERICAL-BESSEL-J0 4.0d0)))
......@@ -121,17 +125,19 @@
#(-0.18920062382698202d0 0.11611074925915743d0
0.2762836857713501d0 0.22924385795503022d0))
(MULTIPLE-VALUE-LIST
(LETM ((BESARR (VECTOR-DOUBLE-FLOAT 4)))
(SPHERICAL-BESSEL-JL-ARRAY 4.0d0 BESARR)
(CL-ARRAY BESARR))))
(LET ((BESARR
(MAKE-MARRAY 'DOUBLE-FLOAT :DIMENSIONS 4)))
(SPHERICAL-BESSEL-JL-ARRAY 4.0d0 BESARR)
(CL-ARRAY BESARR))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST
#(-0.18920062382698208d0 0.11611074925915742d0
0.27628368577135015d0 0.22924385795503024d0))
(MULTIPLE-VALUE-LIST
(LETM ((BESARR (VECTOR-DOUBLE-FLOAT 4)))
(SPHERICAL-BESSEL-JL-STEED-ARRAY 4.0d0 BESARR)
(CL-ARRAY BESARR))))
(LET ((BESARR
(MAKE-MARRAY 'DOUBLE-FLOAT :DIMENSIONS 4)))
(SPHERICAL-BESSEL-JL-STEED-ARRAY 4.0d0 BESARR)
(CL-ARRAY BESARR))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST 0.16341090521590299d0 1.4513803955642766d-16)
(MULTIPLE-VALUE-LIST (SPHERICAL-BESSEL-Y0 4.0d0)))
......@@ -149,9 +155,10 @@
#(0.16341090521590299d0 0.2300533501309578d0
0.009129107382315343d0 -0.21864196590306362d0))
(MULTIPLE-VALUE-LIST
(LETM ((BESARR (VECTOR-DOUBLE-FLOAT 4)))
(SPHERICAL-BESSEL-YL-ARRAY 4.0d0 BESARR)
(CL-ARRAY BESARR))))
(LET ((BESARR
(MAKE-MARRAY 'DOUBLE-FLOAT :DIMENSIONS 4)))
(SPHERICAL-BESSEL-YL-ARRAY 4.0d0 BESARR)
(CL-ARRAY BESARR))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST 0.12495806717151219d0 5.5492529314587895d-17)
(MULTIPLE-VALUE-LIST
......@@ -173,9 +180,10 @@
#(0.12495806717151212d0 0.09380241603560971d0
0.05460625514480483d0 0.02554459710460367d0))
(MULTIPLE-VALUE-LIST
(LETM ((BESARR (VECTOR-DOUBLE-FLOAT 4)))
(SPHERICAL-BESSEL-IL-SCALED-ARRAY 4.0d0 BESARR)
(CL-ARRAY BESARR))))
(LET ((BESARR
(MAKE-MARRAY 'DOUBLE-FLOAT :DIMENSIONS 4)))
(SPHERICAL-BESSEL-IL-SCALED-ARRAY 4.0d0 BESARR)
(CL-ARRAY BESARR))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST 0.39269908169872414d0 1.743934249004316d-16)
(MULTIPLE-VALUE-LIST
......@@ -197,9 +205,10 @@
#(0.39269908169872414d0 0.4908738521234052d0
0.760854470791278d0 1.4419419406125027d0))
(MULTIPLE-VALUE-LIST
(LETM ((BESARR (VECTOR-DOUBLE-FLOAT 4)))
(SPHERICAL-BESSEL-KL-SCALED-ARRAY 4.0d0 BESARR)
(CL-ARRAY BESARR))))
(LET ((BESARR
(MAKE-MARRAY 'DOUBLE-FLOAT :DIMENSIONS 4)))
(SPHERICAL-BESSEL-KL-SCALED-ARRAY 4.0d0 BESARR)
(CL-ARRAY BESARR))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST 0.43017147387562193d0 7.641380397338472d-16)
(MULTIPLE-VALUE-LIST (BESSEL-JNU 3.0d0 4.0d0)))
......@@ -208,11 +217,11 @@
#(0.6713967071418024d0 0.5130161365618323d0
0.06500818287738516d0))
(MULTIPLE-VALUE-LIST
(LETM
((BESARR
(VECTOR-DOUBLE-FLOAT (A 1.0d0 2.0d0 3.0d0))))
(SPHERICAL-JNU-ARRAY 0.5d0 BESARR)
(CL-ARRAY BESARR))))
(LET ((BESARR
(MAKE-MARRAY 'DOUBLE-FLOAT :INITIAL-CONTENTS
'(1.0d0 2.0d0 3.0d0))))
(SPHERICAL-JNU-ARRAY 0.5d0 BESARR)
(CL-ARRAY BESARR))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST -0.1820221159534852d0 2.020851441225493d-15)
(MULTIPLE-VALUE-LIST (BESSEL-YNU 3.0d0 4.0d0)))
......
......@@ -12,9 +12,9 @@
0.1731331145031117d0 0.4270743075655188d0
0.3353314142479658d0))
(MULTIPLE-VALUE-LIST
(LETM ((RNG (RANDOM-NUMBER-GENERATOR *MT19937* 0)))
(LOOP FOR I FROM 0 TO 10 COLLECT
(BETA-RD RNG 1.0d0 2.0d0)))))
(LET ((RNG (MAKE-RANDOM-NUMBER-GENERATOR *MT19937* 0)))
(LOOP FOR I FROM 0 TO 10 COLLECT
(BETA-RD RNG 1.0d0 2.0d0)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST 1.8000000000000016d0)
(MULTIPLE-VALUE-LIST (BETA-PDF 0.1d0 1.0d0 2.0d0)))
......
......@@ -6,9 +6,9 @@
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST (LIST 11 3 4 8 4 5 8 6 5 6 6))
(MULTIPLE-VALUE-LIST
(LETM ((RNG (RANDOM-NUMBER-GENERATOR *MT19937* 0)))
(LOOP FOR I FROM 0 TO 10 COLLECT
(BINOMIAL RNG 0.4d0 12)))))
(LET ((RNG (MAKE-RANDOM-NUMBER-GENERATOR *MT19937* 0)))
(LOOP FOR I FROM 0 TO 10 COLLECT
(BINOMIAL RNG 0.4d0 12)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST 0.22703033548799986d0)
(MULTIPLE-VALUE-LIST (BINOMIAL-PDF 5 0.4d0 12)))
......
......@@ -6,38 +6,47 @@
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST #(-34.5 8.24 3.29))
(MULTIPLE-VALUE-LIST
(LETM
((V1 (VECTOR-SINGLE-FLOAT (A -34.5 8.24 3.29) NIL))
(V2 (VECTOR-SINGLE-FLOAT '3 NIL)))
(BLAS-COPY V1 V2) (CL-ARRAY V2))))
(LET ((V1
(MAKE-MARRAY 'SINGLE-FLOAT :INITIAL-CONTENTS
'(-34.5 8.24 3.29)))
(V2 (MAKE-MARRAY 'SINGLE-FLOAT :DIMENSIONS '3)))
(BLAS-COPY V1 V2)
(CL-ARRAY V2))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST #(-34.5d0 8.24d0 3.29d0))
(MULTIPLE-VALUE-LIST
(LETM
((V1
(VECTOR-DOUBLE-FLOAT (A -34.5d0 8.24d0 3.29d0)
NIL))
(V2 (VECTOR-DOUBLE-FLOAT '3 NIL)))
(BLAS-COPY V1 V2) (CL-ARRAY V2))))
(LET ((V1
(MAKE-MARRAY 'DOUBLE-FLOAT :INITIAL-CONTENTS
'(-34.5d0 8.24d0 3.29d0)))
(V2 (MAKE-MARRAY 'DOUBLE-FLOAT :DIMENSIONS '3)))
(BLAS-COPY V1 V2)
(CL-ARRAY V2))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST #(#C(-34.5 8.24) #C(3.29 -8.93) #C(34.12 -6.15)))
(MULTIPLE-VALUE-LIST
(LETM
((V1
(VECTOR-COMPLEX-SINGLE-FLOAT
(A -34.5 8.24 3.29 -8.93 34.12 -6.15) NIL))
(V2 (VECTOR-COMPLEX-SINGLE-FLOAT '3 NIL)))
(BLAS-COPY V1 V2) (CL-ARRAY V2))))
(LET ((V1
(MAKE-MARRAY '(COMPLEX SINGLE-FLOAT)
:INITIAL-CONTENTS
'(-34.5 8.24 3.29 -8.93 34.12
-6.15)))
(V2
(MAKE-MARRAY '(COMPLEX SINGLE-FLOAT)
:DIMENSIONS '3)))