II am hoping for advice from folk higher up the food chain than me; I have
an error message which is not helpful enough.

I am enlarging Kurt and Bill's gsl.* function to include the gsl/gsll
function integration-qag.  This can be invoked, for example as

)lisp (gsll:integration-qag (lambda (x) (exp (- (* x x)))) 0.0 1.0 :gauss21)

where the final :gauss21 is one of a number of parameters which define the
integration rule to be used.

In my gsl.lisp file I have

(defvar intrules (list ':gauss15 ':gauss21 ':gauss31 ':gauss41 ':gauss51
':gauss61))

(defun integration-qag-list (f a b n)
  (multiple-value-list (integration-qag f a b (eval (nth n intrules)))))

and in my corresponding gsl.spad:

    gslIntegrationQag(f,a,b,n) ==
      r:List DF:=INTEGRATION_-QAG_-LIST(mkLispFunction1(f@
(DF->DF))$Lisp,a,b,n)$Lisp
      [r(1),r(2),r(3) pretend Integer]

This all compiles OK.  But in FriCAS:

(1) -> gslIntegrationQag(x+->exp(-x^2),0.0,1.0,2)

   >> Error detected within library code:
   index out of range

so clearly I've not set something up correctly - I suspect it's my
cack-handed defvar list of parameters and my use of (nth n intrules).  But
I don't know why this isn't working, and what I should be doing instead.

Sigh.  Maybe I need to drink more tea.

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to