Hi,
I have added the following example of `evaluate-integral' to spline-example.lisp:
(defun evaluate-integral-example (&optional (intervals 4)) "Evaluate integral of sin(x) in interval 0-pi. sin(x) is tabulated over a 0-2pi interval and interpolated with +periodic-cubic-spline-interpolation+" (let* ((nodes (1+ intervals)) (max-node (1- nodes)) (xarr (loop with step = (/ (* 2.0 pi) intervals) for i from 0 upto max-node collect (* i step))) (xmarr (make-marray 'double-float :initial-contents xarr)) ;; cannot use (loop for x on (cl-array xmarr)...) -- c function gives error (ymarr (make-marray 'double-float :initial-contents (loop for x in xarr collect (sin x)))) (acc (make-acceleration)) (spline (make-spline +periodic-cubic-spline-interpolation+ xmarr ymarr))) (evaluate-integral spline 0d0 (coerce pi 'double-float) :acceleration acc)))
Right now it is sitting in the `master' branch on my laptop. How would you like me to upload it. As a master, or something else?
Mirko
Hi Mirko,
Thank you for the contribution. There are a couple ways you can make your patches available. You can email them using format-patch; see http://book.git-scm.com/5_git_and_email.html and git help format-patch, or you can fork the repository somewhere public like repo.or.cz or github and I can pull your commit(s). In the latter case of course send an email to the list alerting everyone to the URL and what it is you've done.
In the case of small separate changes/additions like this, email probably makes the most sense. For more extended development, a separate repository would be easier.
Contributions are very welcome, and anyone who would like to submit something is invited to do so in one of these ways.
Liam
On Wed, Nov 11, 2009 at 7:46 AM, Mirko Vukovic mirko.vukovic@gmail.com wrote:
Hi,
I have added the following example of `evaluate-integral' to spline-example.lisp:
(defun evaluate-integral-example (&optional (intervals 4)) "Evaluate integral of sin(x) in interval 0-pi. sin(x) is tabulated over a 0-2pi interval and interpolated with +periodic-cubic-spline-interpolation+" (let* ((nodes (1+ intervals)) (max-node (1- nodes)) (xarr (loop with step = (/ (* 2.0 pi) intervals) for i from 0 upto max-node collect (* i step))) (xmarr (make-marray 'double-float :initial-contents xarr)) ;; cannot use (loop for x on (cl-array xmarr)...) -- c function gives error (ymarr (make-marray 'double-float :initial-contents (loop for x in xarr collect (sin x)))) (acc (make-acceleration)) (spline (make-spline +periodic-cubic-spline-interpolation+ xmarr ymarr))) (evaluate-integral spline 0d0 (coerce pi 'double-float) :acceleration acc)))
Right now it is sitting in the `master' branch on my laptop. How would you like me to upload it. As a master, or something else?
Mirko
Gsll-devel mailing list Gsll-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/gsll-devel