Commit f42d6f00 authored by Liam Healy's avatar Liam Healy

Tests in separate system gsll-tests

Tests are now separated from examples and defined in a new system
gsll-tests.  Change name of condition 'input-error from 'EDOM.
parent 9b15d4b5
;; Definition of GSLL system
;; Liam Healy
;; Time-stamp: <2008-11-16 13:29:58EST gsll-tests.asd>
;; $Id$
(asdf:defsystem "gsll-tests"
:name "gsll-tests"
:description "Regression (unit) tests for GNU Scientific Library for Lisp."
:version "0"
:author "Liam M. Healy"
:licence "LLGPL v3, FDL"
:depends-on (gsll)
:components
((:module test-unit
:components
;; http://www.cs.northwestern.edu/academics/courses/325/readings/lisp-unit.html
((:file "lisp-unit")
(:file "additional-definitions" :depends-on (lisp-unit))))
(:module tests
:depends-on (test-unit)
:components
((:file "absolute-deviation")
(:file "absolute-sum")
(:file "airy")
(:file "autocorrelation")
(:file "axpy")
(:file "bernoulli")
(:file "bessel")
(:file "beta")
(:file "binomial")
(:file "blas-copy")
(:file "blas-swap")
(:file "cauchy")
(:file "cdot")
(:file "chebyshev")
(:file "chi-squared")
(:file "clausen")
(:file "column")
(:file "combination")
(:file "coulomb")
(:file "coupling")
(:file "covariance")
(:file "dawson")
(:file "debye")
(:file "dilogarithm")
(:file "dirichlet")
(:file "discrete")
(:file "dot")
(:file "eigensystems")
(:file "elementary")
(:file "elliptic-functions")
(:file "elliptic-integrals")
(:file "error-functions")
(:file "euclidean-norm")
(:file "exponential-functions")
(:file "exponential-integrals")
(:file "exponential")
(:file "exponential-power")
(:file "fdist")
(:file "fermi-dirac")
(:file "flat")
(:file "gamma")
(:file "gamma-randist")
(:file "gaussian-bivariate")
(:file "gaussian")
(:file "gaussian-tail")
(:file "gegenbauer")
(:file "geometric")
(:file "givens")
(:file "gumbel1")
(:file "gumbel2")
(:file "higher-moments")
(:file "histogram")
(:file "hypergeometric")
(:file "hypergeometric-randist")
(:file "index-max")
(:file "inverse-matrix-product")
(:file "laguerre")
(:file "lambert")
(:file "landau")
(:file "laplace")
(:file "legendre")
(:file "levy")
(:file "logarithmic")
(:file "logarithm")
(:file "logistic")
(:file "lognormal")
(:file "lu")
(:file "mathematical")
(:file "matrix-copy")
(:file "matrix-div")
(:file "matrix-max-index")
(:file "matrix-max")
(:file "matrix-mean")
(:file "matrix-min-index")
(:file "matrix-minmax-index")
(:file "matrix-minmax")
(:file "matrix-m-")
(:file "matrix-m+")
(:file "matrix-mult")
(:file "matrix-product-hermitian")
(:file "matrix-product")
(:file "matrix-product-symmetric")
(:file "matrix-product-triangular")
(:file "matrix-set-all-m+")
(:file "matrix-set-zero")
(:file "matrix-standard-deviation")
(:file "matrix-standard-deviation-with-fixed-mean")
(:file "matrix-standard-deviation-with-mean")
(:file "matrix-swap")
(:file "matrix-transpose-copy")
(:file "matrix-transpose")
(:file "matrix-variance")
(:file "matrix-variance-with-fixed-mean")
(:file "matrix-variance-with-mean")
(:file "median-percentile")
(:file "monte-carlo")
(:file "multinomial")
(:file "negative-binomial")
(:file "numerical-differentiation")
(:file "numerical-integration")
(:file "pareto")
(:file "permutation")
(:file "poisson")
(:file "polynomial")
(:file "power")
(:file "psi")
(:file "quasi-random-number-generators")
(:file "random-number-generators")
(:file "rayleigh")
(:file "rayleigh-tail")
(:file "row")
(:file "scale")
(:file "set-basis")
(:file "setf-column")
(:file "setf-row")
(:file "set-identity")
(:file "shuffling-sampling")
(:file "sort-matrix-largest")
(:file "sort-matrix")
(:file "sort-matrix-smallest")
(:file "sort-vector-index")
(:file "sort-vector-largest-index")
(:file "sort-vector-largest")
(:file "sort-vector")
(:file "sort-vector-smallest-index")
(:file "sort-vector-smallest")
(:file "spherical-vector")
(:file "swap-columns")
(:file "swap-elements")
(:file "swap-row-column")
(:file "swap-rows")
(:file "synchrotron")
(:file "tdist")
(:file "transport")
(:file "trigonometry")
(:file "vector-copy")
(:file "vector-div")
(:file "vector-max-index")
(:file "vector-max")
(:file "vector-mean")
(:file "vector-min-index")
(:file "vector-minmax-index")
(:file "vector-minmax")
(:file "vector-m-")
(:file "vector-m+")
(:file "vector-mult")
(:file "vector-reverse")
(:file "vector-set-all-m+")
(:file "vector-set-zero")
(:file "vector-standard-deviation")
(:file "vector-standard-deviation-with-fixed-mean")
(:file "vector-standard-deviation-with-mean")
(:file "vector-swap")
(:file "vector-variance")
(:file "vector-variance-with-fixed-mean")
(:file "vector-variance-with-mean")
(:file "weibull")
(:file "zeta")))))
;; Definition of GSLL system
;; Liam Healy
;; Time-stamp: <2008-11-15 13:41:12EST gsll.asd>
;; Time-stamp: <2008-11-16 12:14:14EST gsll.asd>
;; $Id$
(asdf:defsystem "gsll"
......@@ -22,10 +22,7 @@
:depends-on (init conditions element-types number-conversion))
(:file "defmfun" :depends-on (init element-types interface))
(:file "callback" :depends-on (init))
;; http://www.cs.northwestern.edu/academics/courses/325/readings/lisp-unit.html
(:file "lisp-unit")
(:file "tests" :depends-on (init lisp-unit))
(:file "generate-tests" :depends-on (tests))))
(:file "generate-examples" :depends-on (init))))
(:module floating-point
:depends-on (init)
:components
......
;; Histogram probability distribution.
;; Liam Healy, Mon Jan 1 2007 - 17:51
;; Time-stamp: <2008-08-17 09:37:15EDT probability-distribution.lisp>
;; Time-stamp: <2008-11-16 13:26:02EST probability-distribution.lisp>
;; $Id$
(in-package :gsl)
......@@ -59,7 +59,7 @@
:documentation ; FDL
"Initialize the probability distribution pdf with the contents
of the histogram. If any of the bins are negative then an
EDOM error is signalled because a probability distribution
input-domain error is signalled because a probability distribution
cannot contain negative values.")
(defmfun pdf-init-2 (pdf histogram)
......@@ -71,14 +71,14 @@
:documentation ; FDL
"Initialize the probability distribution pdf with the contents
of the histogram. If any of the bins are negative then an
EDOM error is signalled because a probability distribution
input-domain error is signalled because a probability distribution
cannot contain negative values.")
(export 'pdf-init)
(defun pdf-init (pdf histogram) ; FDL
"Initialize the probability distribution pdf with the contents
of the histogram. If any of the bins are negative then an
EDOM error is signalled because a probability distribution
input-domain error is signalled because a probability distribution
cannot contain negative values."
(histo-1d2d pdf pdf-init (histogram)))
......
;; Updating and accessing histogram elements.
;; Liam Healy, Mon Jan 1 2007 - 14:43
;; Time-stamp: <2008-10-25 18:24:41EDT updating-accessing.lisp>
;; Time-stamp: <2008-11-16 13:26:01EST updating-accessing.lisp>
;; $Id$
(in-package :gsl)
......@@ -16,10 +16,10 @@
If x lies in the valid range of the histogram then the function
returns zero to indicate success. If x is less than the lower
limit of the histogram then the function issues a warning :EDOM, and
limit of the histogram then the function issues a warning input-domain, and
none of bins are modified. Similarly, if the value of x is greater
than or equal to the upper limit of the histogram then the function
issues a warning :EDOM, and none of the bins are modified. The error
issues a warning input-domain, and none of the bins are modified. The error
handler is not called, however, since it is often necessary to compute
histograms for a small range of a larger dataset, ignoring the values
outside the range of interest.")
......@@ -32,7 +32,7 @@
:documentation ; FDL
"Return the contents of the i-th bin of the histogram.
If i lies outside the valid range of indices for the
histogram then an error (:EDOM) is signalled.")
histogram then an error (input-domain) is signalled.")
(defmfun range (histogram i)
"gsl_histogram_get_range"
......@@ -47,7 +47,7 @@
the coordinate of the upper limit are excluded and fall in the
neighboring higher bin, if it exists).
If i lies outside the valid range of indices for
the histogram, then the error :EDOM is signalled.")
the histogram, then the error input-domain is signalled.")
(defmfun max-range (histogram)
"gsl_histogram_max"
......@@ -89,7 +89,7 @@
range, and will return the correct bin immediately in this
case. If the value is found in the range of the histogram
then the function returns the index. If value lies outside
the valid range of the histogram then the error :EDOM is
the valid range of the histogram then the error input-domain is
signalled.")
#|
......
;; GSL errors
;; Liam Healy Sat Mar 4 2006 - 18:33
;; Time-stamp: <2008-08-31 22:52:09EDT conditions.lisp>
;; Time-stamp: <2008-11-16 13:26:03EST conditions.lisp>
;; $Id$
(in-package :gsl)
......@@ -48,7 +48,7 @@
(setf *errorno-keyword* (acons ,number ',keyword *errorno-keyword*))
(export ',keyword)))
(define-gsl-condition EDOM 1 "Input domain error")
(define-gsl-condition input-domain 1 "Input domain error")
(define-gsl-condition ERANGE 2 "Output range error")
(define-gsl-condition EFAULT 3 "Invalid pointer")
(define-gsl-condition EINVAL 4 "Invalid argument")
......
;; Make tests and examples
;; Define examples.
;; Liam Healy 2008-09-07 21:00:48EDT generate-tests.lisp
;; Time-stamp: <2008-11-15 13:29:28EST generate-tests.lisp>
;; Time-stamp: <2008-11-16 12:13:10EST generate-examples.lisp>
;; $Id: $
;;; Througout the GSLL interface definition files are #'save-test
;;; forms. These serve to define both examples and tests. Getting an
;;; example involves calling (examples) to get a list of names, then
;;; the calling the function with a particular name to get the
;;; examples, e.g.
;;; (examples)
;;; (examples 'matrix-m+)
;;; To do all the tests,
;;; (lisp-unit:run-tests)
;;; The files that define the tests are in tests/. These files are
;;; generated automatically and checked into the repository; they
;;; shouldn't be changed very often. Rarely, it may be necessary to
;;; generate such a file. In this case, #'write-test-to-file recreates
;;; the file, e.g.
;;; (write-test-to-file 'matrix-m+ "test/")
;;; Define examples that can be displayed by users with the function
;;; #'examples and can be used to generate regression (unit) tests.
;;; The latter has been done in the gsll-tests system.
(in-package :gsl)
(export 'examples)
;;;;****************************************************************************
;;;; Data pool
;;;; Defining examples
;;;;****************************************************************************
(defun numerical-serialize (form)
(if (typep form 'list)
(cons 'list (mapcar #'numerical-serialize form))
form))
;;; (make-test '(legendre-conicalP-half 3.5d0 10.0d0))
(defun make-test (form)
"Make a test for lisp-unit."
(let ((vals (multiple-value-list (ignore-errors (eval form)))))
(if (typep (second vals) 'condition)
`(lisp-unit::assert-error
',(type-of (second vals))
,form)
`(lisp-unit::assert-numerical-equal
,(numerical-serialize vals)
(multiple-value-list ,form)))))
(defparameter *all-generated-tests* nil)
(defmacro save-test (name &rest forms)
......@@ -71,52 +40,6 @@
(loop for (key value) on *all-generated-tests* by #'cddr
collect key)))
(defun create-test (test-name)
"Find the saved test by name and create it, with the generated results."
(append
`(lisp-unit:define-test ,test-name)
(mapcar #'make-test (getf *all-generated-tests* test-name))))
(defun write-test-to-file (test path)
"Write the test to a file with the same name under path.
Use this function with caution; it will replace an existing
test file and thus the opportunity for regression test will be lost."
(let ((pathname (merge-pathnames (format nil "~(~a~).lisp" test) path))
(*read-default-float-format* 'single-float))
(with-open-file
(stream pathname :direction :output :if-exists :rename)
(format
stream
";; Regression test ~a for GSLL, automatically generated~%~%" test)
(format stream "(in-package :gsl)~%~%")
(format t "Writing test ~a to file ~a~&" test pathname)
(format stream "~s~%~%" (create-test test)))))
;;; This is commented out because it shouldn't be run. It will
;;; regenerate all tests, so there will be no regression tests to
;;; previous versions.
#+(or)
(defun write-tests (path)
"Write all the tests to the appropriate file."
(iter
(for (key val) on *all-generated-tests* by #'cddr)
(write-test-to-file key path)))
#|
;;; Obsolete; to put all tests in one file.
(defun write-tests-to-file (filename)
"Write all the saved tests with expected results to the file."
(with-open-file (stream filename :direction :output :if-exists :supersede)
(format stream ";; Regression tests for GSLL, automatically generated~%~%")
(format stream "(in-package :gsl)~%~%")
(loop for (test-name forms) on *all-generated-tests* by #'cddr
do
(format t "Writing test ~a to file~&" test-name)
(format stream "~s~%~%" (create-test test-name)))))
|#
;;;;****************************************************************************
;;;; Data pool
;;;;****************************************************************************
......
;; Cholesky Decomposition
;; Liam Healy, Wed May 3 2006 - 16:38
;; Time-stamp: <2008-08-11 22:49:09EDT cholesky.lisp>
;; Time-stamp: <2008-11-16 13:26:42EST cholesky.lisp>
;; $Id$
(in-package :gsl)
......@@ -29,7 +29,7 @@
L. The upper triangular part of the input matrix contains
L^T, the diagonal terms being identical for both L and
L^T. If the matrix is not positive-definite then the
decomposition will fail, returning the error EDOM.")
decomposition will fail, returning the error input-domain.")
(defmfun cholesky-solve (A x b)
"gsl_linalg_cholesky_solve"
......
;; Numerical differentiation.
;; Liam Healy Mon Nov 12 2007 - 22:07
;; Time-stamp: <2008-10-25 12:00:36EDT numerical-differentiation.lisp>
;; Time-stamp: <2008-11-15 22:31:32EST numerical-differentiation.lisp>
;; $Id$
(in-package :gsl)
......@@ -122,77 +122,4 @@
(forward-derivative deriv-f6 10.0d0 1.0d-4)
(backward-derivative deriv-f6 10.0d0 1.0d-4))
(LISP-UNIT:DEFINE-TEST NUMERICAL-DIFFERENTIATION
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST 2.718281828441488 4.123659913167868e-10)
(MULTIPLE-VALUE-LIST
(CENTRAL-DERIVATIVE DERIV-F1 1.0 1.e-4)))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST 2.7182817825298398 9.540320743340577e-7)
(MULTIPLE-VALUE-LIST
(FORWARD-DERIVATIVE DERIV-F1 1.0 1.e-4)))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST 2.7182818293827378 9.086969640080628e-7)
(MULTIPLE-VALUE-LIST
(BACKWARD-DERIVATIVE DERIV-F1 1.0 1.e-4)))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST 0.474341649024533 3.3922603135575853e-11)
(MULTIPLE-VALUE-LIST
(CENTRAL-DERIVATIVE DERIV-F2 0.1 1.e-4)))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST 0.47434164943235285 9.102230432046565e-8)
(MULTIPLE-VALUE-LIST
(FORWARD-DERIVATIVE DERIV-F2 0.1 1.e-4)))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST 0.4743416462049176 8.787851752748856e-8)
(MULTIPLE-VALUE-LIST
(BACKWARD-DERIVATIVE DERIV-F2 0.1 1.e-4)))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST 2.9941773945923913 6.730277498876722e-10)
(MULTIPLE-VALUE-LIST
(CENTRAL-DERIVATIVE DERIV-F3 0.45 1.e-4)))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST 2.994177385772526 1.6952086150997503e-6)
(MULTIPLE-VALUE-LIST
(FORWARD-DERIVATIVE DERIV-F3 0.45 1.e-4)))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST 2.9941775182635064 1.568063267060477e-6)
(MULTIPLE-VALUE-LIST
(BACKWARD-DERIVATIVE DERIV-F3 0.45 1.e-4)))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST -0.7788007830653751 1.7227267499194736e-10)
(MULTIPLE-VALUE-LIST
(CENTRAL-DERIVATIVE DERIV-F4 0.5 1.e-4)))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST -0.7788007884386108 2.530006603059119e-7)
(MULTIPLE-VALUE-LIST
(FORWARD-DERIVATIVE DERIV-F4 0.5 1.e-4)))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST -0.7788007743421791 2.503617930568489e-7)
(MULTIPLE-VALUE-LIST
(BACKWARD-DERIVATIVE DERIV-F4 0.5 1.e-4)))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST 0.0 6.66133814775094e-20)
(MULTIPLE-VALUE-LIST
(CENTRAL-DERIVATIVE DERIV-F5 0.0 1.e-4)))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST -2.6337311035821125e-26 1.606762230663824e-11)
(MULTIPLE-VALUE-LIST
(FORWARD-DERIVATIVE DERIV-F5 0.0 1.e-4)))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST 2.6337311035821125e-26 1.606762230663824e-11)
(MULTIPLE-VALUE-LIST
(BACKWARD-DERIVATIVE DERIV-F5 0.0 1.e-4)))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST -0.009999999999871223 2.6645352591887814e-12)
(MULTIPLE-VALUE-LIST
(CENTRAL-DERIVATIVE DERIV-F6 10.0 1.e-4)))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST -0.010000000266238856 4.9950606958271945e-9)
(MULTIPLE-VALUE-LIST
(FORWARD-DERIVATIVE DERIV-F6 10.0 1.e-4)))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST -0.010000000076196142 4.641550044799095e-9)
(MULTIPLE-VALUE-LIST
(BACKWARD-DERIVATIVE DERIV-F6 10.0 1.e-4))))
;; Gaussian bivariate distribution
;; Liam Healy, Sat Sep 2 2006 - 16:32
;; Time-stamp: <2008-10-25 13:30:58EDT gaussian-bivariate.lisp>
;; Time-stamp: <2008-11-15 22:36:38EST gaussian-bivariate.lisp>
;; $Id$
(in-package :gsl)
......@@ -40,22 +40,3 @@
(bivariate-gaussian rng 1.0d0 0.75d0 0.25d0)))
(bivariate-gaussian-pdf 0.25d0 0.5d0 0.25d0
0.4d0 0.2d0))
(LISP-UNIT:DEFINE-TEST GAUSSIAN-BIVARIATE
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST
(LIST -0.06509716124488897d0 -1.5733207749096374d0
0.27942740172325414d0 1.2021528358889673d0
-0.6041530626907894d0 0.07582702719413444d0
-0.5446229412165632d0 -0.6592026841613081d0
-0.11029516610819164d0 0.17931840412143885d0
2.1025104980291696d0))
(MULTIPLE-VALUE-LIST
(LETM ((RNG (RANDOM-NUMBER-GENERATOR *MT19937* 0)))
(LOOP FOR I FROM 0 TO 10 COLLECT
(BIVARIATE-GAUSSIAN RNG 1.0d0 0.75d0 0.25d0)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST 0.5548265557970462d0)
(MULTIPLE-VALUE-LIST
(BIVARIATE-GAUSSIAN-PDF 0.25d0 0.5d0 0.25d0 0.4d0 0.2d0))))
;; Lognormal distribution
;; Liam Healy, Sat Sep 30 2006
;; Time-stamp: <2008-10-25 17:57:40EDT lognormal.lisp>
;; Time-stamp: <2008-11-15 22:37:16EST lognormal.lisp>
;; $Id$
(in-package :gsl)
......@@ -65,35 +65,3 @@
(lognormal-Q 1.2d0 1.0d0 2.0d0)
(lognormal-Pinv 0.3413288272347352d0 1.0d0 2.0d0)
(lognormal-Qinv 0.6586711727652649d0 1.0d0 2.0d0))
(LISP-UNIT:DEFINE-TEST LOGNORMAL
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST
(LIST 2.386447068127768d0 0.11687602167359055d0
4.753374578796263d0 30.093393775755004d0
0.8119584375760986d0 3.163421055157545d0
0.9146206567715651d0 0.727307901065758d0
2.180184852178898d0 3.8908856616896017d0
182.18469788916977d0))
(MULTIPLE-VALUE-LIST
(LETM ((RNG (RANDOM-NUMBER-GENERATOR *MT19937* 0)))
(LOOP FOR I FROM 0 TO 10 COLLECT
(LOGNORMAL RNG 1.0d0 2.0d0)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST 0.15289833965691607d0)
(MULTIPLE-VALUE-LIST
(LOGNORMAL-PDF 1.2d0 1.0d0 2.0d0)))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST 0.3413288272347351d0)
(MULTIPLE-VALUE-LIST (LOGNORMAL-P 1.2d0 1.0d0 2.0d0)))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST 0.6586711727652649d0)
(MULTIPLE-VALUE-LIST (LOGNORMAL-Q 1.2d0 1.0d0 2.0d0)))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST 1.2000000000000004d0)
(MULTIPLE-VALUE-LIST
(LOGNORMAL-PINV 0.3413288272347352d0 1.0d0 2.0d0)))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST 1.2d0)
(MULTIPLE-VALUE-LIST
(LOGNORMAL-QINV 0.6586711727652649d0 1.0d0 2.0d0))))
;; Negative binomial and Pascal distributions
;; Liam Healy, Sat Nov 25 2006 - 16:00
;; Time-stamp: <2008-10-25 18:06:14EDT negative-binomial.lisp>
;; Time-stamp: <2008-11-15 22:37:16EST negative-binomial.lisp>
;; $Id$
(in-package :gsl)
......@@ -103,38 +103,3 @@
(pascal-pdf 5 0.4d0 12)
(pascal-P 5 0.4d0 12)
(pascal-Q 5 0.4d0 12))
(LISP-UNIT:DEFINE-TEST NEGATIVE-BINOMIAL
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST (LIST 15 21 19 15 8 18 23 18 33 16 10))
(MULTIPLE-VALUE-LIST
(LETM ((RNG (RANDOM-NUMBER-GENERATOR *MT19937* 0)))
(LOOP FOR I FROM 0 TO 10 COLLECT
(NEGATIVE-BINOMIAL RNG 0.4 12.0)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST 0.0056984767089869)
(MULTIPLE-VALUE-LIST
(NEGATIVE-BINOMIAL-PDF 5 0.4 12.0)))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST 0.010594202555514881)
(MULTIPLE-VALUE-LIST (NEGATIVE-BINOMIAL-P 5 0.4 12.0)))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST 0.9894057974444851)
(MULTIPLE-VALUE-LIST (NEGATIVE-BINOMIAL-Q 5 0.4 12.0)))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST (LIST 15 21 19 15 8 18 23 18 33 16 10))
(MULTIPLE-VALUE-LIST
(LETM ((RNG (RANDOM-NUMBER-GENERATOR *MT19937* 0)))
(LOOP FOR I FROM 0 TO 10 COLLECT
(PASCAL RNG 0.4 12)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST 0.0056984767089869)
(MULTIPLE-VALUE-LIST (PASCAL-PDF 5 0.4 12)))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST 0.010594202555514881)
(MULTIPLE-VALUE-LIST (PASCAL-P 5 0.4 12)))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST 0.9894057974444851)
(MULTIPLE-VALUE-LIST (PASCAL-Q 5 0.4 12))))
;; Sorting
;; Liam Healy, Fri Apr 14 2006 - 20:20
;; Time-stamp: <2008-11-09 13:10:16EST sorting.lisp>
;; Time-stamp: <2008-11-15 22:51:52EST sorting.lisp>
;; $Id$
(in-package :gsl)
......@@ -249,11 +249,11 @@
(generate-all-array-tests sort-vector :no-complex
(letm ((v1 (array-default 8)))
;; or you can use msort
(sort-vector v1)))
(cl-array (sort-vector v1))))
(generate-all-array-tests sort-matrix :no-complex
(letm ((m1 (array-default '(3 3))))
(msort m1)))
(cl-array (msort m1))))
(generate-all-array-tests sort-vector-index :no-complex
(letm ((perm (permutation 8))
......
;; Jacobian elliptic functions
;; Liam Healy, Mon Mar 20 2006 - 22:21
;; Time-stamp: <2008-10-21 23:08:02EDT elliptic-functions.lisp>
;; Time-stamp: <2008-11-15 22:31:54EST elliptic-functions.lisp>