Loading random/dirichlet.lisp +3 −3 Original line number Diff line number Diff line ;; Dirichlet distribution ;; Liam Healy, Sun Oct 29 2006 ;; Time-stamp: <2010-07-07 14:24:59EDT dirichlet.lisp> ;; Time-stamp: <2011-07-29 12:23:09EDT dirichlet.lisp> ;; ;; Copyright 2006, 2007, 2008, 2009 Liam M. Healy ;; Distributed under the terms of the GNU General Public License Loading Loading @@ -54,7 +54,7 @@ (defmfun dirichlet-pdf (alpha theta) "gsl_ran_dirichlet_pdf" (((1- (dim0 alpha)) sizet) (((dim0 alpha) sizet) ((foreign-pointer alpha) :pointer) ;; theta had better be at least as long as alpha, or they'll be trouble ((foreign-pointer theta) :pointer)) Loading @@ -67,7 +67,7 @@ (defmfun dirichlet-log-pdf (alpha theta) "gsl_ran_dirichlet_lnpdf" (((1- (dim0 alpha)) sizet) (((dim0 alpha) sizet) ((foreign-pointer alpha) :pointer) ;; theta had better be at least as long as alpha, or they'll be trouble ((foreign-pointer theta) :pointer)) Loading tests/dirichlet.lisp +2 −3 Original line number Diff line number Diff line Loading @@ -28,7 +28,7 @@ (alpha #m(1.0d0 2.0d0 3.0d0 4.0d0))) (grid:copy-to (sample rng :dirichlet :alpha alpha))))) (LISP-UNIT::ASSERT-NUMERICAL-EQUAL (LIST 1080.0000000000025d0) (list 3.483648000000004d7) (MULTIPLE-VALUE-LIST (LET ((ALPHA (GRID:MAKE-FOREIGN-ARRAY 'DOUBLE-FLOAT :INITIAL-CONTENTS Loading @@ -38,7 +38,7 @@ '(1.0d0 2.0d0 3.0d0 4.0d0)))) (DIRICHLET-PDF ALPHA THETA)))) (LISP-UNIT::ASSERT-NUMERICAL-EQUAL (LIST 6.984716320118268d0) (list 17.366175671549307d0) (MULTIPLE-VALUE-LIST (LET ((ALPHA (GRID:MAKE-FOREIGN-ARRAY 'DOUBLE-FLOAT :INITIAL-CONTENTS Loading @@ -47,4 +47,3 @@ (GRID:MAKE-FOREIGN-ARRAY 'DOUBLE-FLOAT :INITIAL-CONTENTS '(1.0d0 2.0d0 3.0d0 4.0d0)))) (DIRICHLET-LOG-PDF ALPHA THETA))))) Loading
random/dirichlet.lisp +3 −3 Original line number Diff line number Diff line ;; Dirichlet distribution ;; Liam Healy, Sun Oct 29 2006 ;; Time-stamp: <2010-07-07 14:24:59EDT dirichlet.lisp> ;; Time-stamp: <2011-07-29 12:23:09EDT dirichlet.lisp> ;; ;; Copyright 2006, 2007, 2008, 2009 Liam M. Healy ;; Distributed under the terms of the GNU General Public License Loading Loading @@ -54,7 +54,7 @@ (defmfun dirichlet-pdf (alpha theta) "gsl_ran_dirichlet_pdf" (((1- (dim0 alpha)) sizet) (((dim0 alpha) sizet) ((foreign-pointer alpha) :pointer) ;; theta had better be at least as long as alpha, or they'll be trouble ((foreign-pointer theta) :pointer)) Loading @@ -67,7 +67,7 @@ (defmfun dirichlet-log-pdf (alpha theta) "gsl_ran_dirichlet_lnpdf" (((1- (dim0 alpha)) sizet) (((dim0 alpha) sizet) ((foreign-pointer alpha) :pointer) ;; theta had better be at least as long as alpha, or they'll be trouble ((foreign-pointer theta) :pointer)) Loading
tests/dirichlet.lisp +2 −3 Original line number Diff line number Diff line Loading @@ -28,7 +28,7 @@ (alpha #m(1.0d0 2.0d0 3.0d0 4.0d0))) (grid:copy-to (sample rng :dirichlet :alpha alpha))))) (LISP-UNIT::ASSERT-NUMERICAL-EQUAL (LIST 1080.0000000000025d0) (list 3.483648000000004d7) (MULTIPLE-VALUE-LIST (LET ((ALPHA (GRID:MAKE-FOREIGN-ARRAY 'DOUBLE-FLOAT :INITIAL-CONTENTS Loading @@ -38,7 +38,7 @@ '(1.0d0 2.0d0 3.0d0 4.0d0)))) (DIRICHLET-PDF ALPHA THETA)))) (LISP-UNIT::ASSERT-NUMERICAL-EQUAL (LIST 6.984716320118268d0) (list 17.366175671549307d0) (MULTIPLE-VALUE-LIST (LET ((ALPHA (GRID:MAKE-FOREIGN-ARRAY 'DOUBLE-FLOAT :INITIAL-CONTENTS Loading @@ -47,4 +47,3 @@ (GRID:MAKE-FOREIGN-ARRAY 'DOUBLE-FLOAT :INITIAL-CONTENTS '(1.0d0 2.0d0 3.0d0 4.0d0)))) (DIRICHLET-LOG-PDF ALPHA THETA)))))