PI has type long-float, not double-float, so the following patch is necessary: ========================================================= diff --git a/calculus/monte-carlo.lisp b/calculus/monte-carlo.lisp index cb18bb1..32bae65 100644 --- a/calculus/monte-carlo.lisp +++ b/calculus/monte-carlo.lisp @@ -211,7 +211,8 @@ (defparameter *mc-lower* #m(0.0d0 0.0d0 0.0d0))
(defparameter *mc-upper* - (grid:make-foreign-array 'double-float :initial-contents (list pi pi pi))) + (grid:make-foreign-array 'double-float :initial-contents + (list #1=#.(float pi 0d0) #1# #1#)))
(defun random-walk-plain-example (&optional (nsamples 500000)) (monte-carlo-integrate-plain 'mcrw *mc-lower* *mc-upper* nsamples)) ========================================================= alternatively, you may need to call COERCE in grid:make-foreign-array or something.
OK, I've fixed this by defining 'dpi as the double-float version of pi. There were quite a number of places where pi was assumed to be double-float, so this should work better overall for CLISP.
As for coercing, there has been a request for general coercing to double float (or whatever GSL requires for a particular function). I somewhat agree with this and somewhat disagree, but it is a low priority. In the meantime, things have actually got a bit worse as far as arrays are concerned; with foreign arrays built-in to GSLL, there was an auto-coerce on defining initial values; since they are now in GSD (foreign-array), that has for the time being gone away.
Liam
On Wed, Jul 28, 2010 at 4:58 PM, Sam Steingold sds@gnu.org wrote:
PI has type long-float, not double-float, so the following patch is necessary:
diff --git a/calculus/monte-carlo.lisp b/calculus/monte-carlo.lisp index cb18bb1..32bae65 100644 --- a/calculus/monte-carlo.lisp +++ b/calculus/monte-carlo.lisp @@ -211,7 +211,8 @@ (defparameter *mc-lower* #m(0.0d0 0.0d0 0.0d0))
(defparameter *mc-upper*
- (grid:make-foreign-array 'double-float :initial-contents (list pi pi pi)))
- (grid:make-foreign-array 'double-float :initial-contents
- (list #1=#.(float pi 0d0) #1# #1#)))
(defun random-walk-plain-example (&optional (nsamples 500000)) (monte-carlo-integrate-plain 'mcrw *mc-lower* *mc-upper* nsamples)) ========================================================= alternatively, you may need to call COERCE in grid:make-foreign-array or something.
-- Sam Steingold http://sds.podval.org
On 8/7/10, Liam Healy lhealy@common-lisp.net wrote:
OK, I've fixed this by defining 'dpi as the double-float version of pi.
;; Loading file ......cache/common-lisp/clisp-2.49+-unix-x86/....../gsll/special-functions/elliptic-functions.fas ... *** - #:|33 33 (DEFVAR *ELLJAC-K* (/ DPI #))-3|: variable DPI has no value
PS. why is this "cache" directory used? how do I compile in-place?
OK I've added all the dependencies in the asd file.
As far as the cache directory goes --- isn't that an ASDF or CLISP issue? I suspect it might have to do with ASDF 2 that was just introduced.
Liam
On Mon, Aug 9, 2010 at 3:43 PM, Sam Steingold sds@gnu.org wrote:
On 8/7/10, Liam Healy lhealy@common-lisp.net wrote:
OK, I've fixed this by defining 'dpi as the double-float version of pi.
;; Loading file ......cache/common-lisp/clisp-2.49+-unix-x86/....../gsll/special-functions/elliptic-functions.fas ... *** - #:|33 33 (DEFVAR *ELLJAC-K* (/ DPI #))-3|: variable DPI has no value
PS. why is this "cache" directory used? how do I compile in-place?
-- Sam Steingold http://sds.podval.org
On 8/9/10, Liam Healy lhealy@common-lisp.net wrote:
OK I've added all the dependencies in the asd file.
thanks!
As far as the cache directory goes --- isn't that an ASDF or CLISP issue?
sure, this is an ASDF issue. I just thought I might me missing something simple which you already know.
On Tue, Aug 10, 2010 at 10:28 AM, Sam Steingold sds@gnu.org wrote:
On 8/9/10, Liam Healy lhealy@common-lisp.net wrote:
OK I've added all the dependencies in the asd file.
thanks!
As far as the cache directory goes --- isn't that an ASDF or CLISP issue?
sure, this is an ASDF issue. I just thought I might me missing something simple which you already know.
Not sure, I know in ASDF 2 they absorbed the functionality of asdf-binary-locations and I think that's what you're seeing. I'm not sure how to get what you want, if you can find Fare (he is on #lisp a lot) he might be able to tell you.
Liam