-----drdieterkaiser at web.de wrote: -----
>dbesj?does?not?return?the?result?of?the?numerical?evaluation,?but?writes
>the
result?into?the?array?jvals.?The?entries?into?the?array?correspond?to?the
>results?of?bessel_j(0,2.0),?bessel_j(1,2.0),?bessel_j(2,2.0)?and
>bessel_j(3,2.0):
>
>MAXIMA>?jvals
>#(0.22389077914123579?0.57672480775687363?0.35283402861563784
>??0.12894324947440208)
>
>You?can?compare?the?entries?in?the?array?with?a?call?to?$bessel_j:
>
>MAXIMA>?($bessel_j?3?2.0)
>0.12894324947440208
>MAXIMA>?($bessel_j?2?2.0)
>0.35283402861563773
>MAXIMA>?($bessel_j?1?2.0)
>0.5767248077568734
>MAXIMA>?($bessel_j?0?2.0)
>0.22389077914123562
>
>So?the?best?would?be?at?first?to?check?if?the?array?jvals?after?the
>calculation contains?the?expected?values.
>
>Dieter?Kaiser
Good experiment--As RJF suggested, let's try interperted mode and
let's initialize each member of jvals to 0.0; here is what happens
in Clozure:
Maxima 5.17post http://maxima.sourceforge.net
Using Lisp Clozure Common Lisp Version 1.3-dev-r11537M-trunk
(WindowsX8632)
(%i1) to_lisp();
MAXIMA> (load "bessel.lisp")
MAXIMA> (setq jvals (make-array 4 :element-type
'double-float :initial-element 0.0d0))
#(0.0 0.0 0.0 0.0)
MAXIMA> (slatec:dbesj 2.0 0.0 4 jvals 0)
NIL
NIL
NIL
NIL
0
MAXIMA> jvals
#(0.0 0.0 0.0 0.0)
Is this a Clozure bug? I still do not understand how calling slatec:dbesj
has the side-effect of
modifying the array jvals. But from what I understand, the complex case
(zbesj) also works by
side-effects on arrays--that code works at least sometimes with Clozure CL.
Barton