| 1 | ;; Discrete Hankel Transforms. |
|---|
| 2 | ;; Liam Healy, Sat Dec 8 2007 - 16:50 |
|---|
| 3 | ;; Time-stamp: <2008-02-17 18:10:15EST hankel.lisp> |
|---|
| 4 | ;; $Id$ |
|---|
| 5 | |
|---|
| 6 | (in-package :gsl) |
|---|
| 7 | |
|---|
| 8 | ;;; Everything compiles, but not tested -- need example. |
|---|
| 9 | |
|---|
| 10 | (defgo-s (hankel size nu xmax) allocate-hankel free-hankel init-hankel) |
|---|
| 11 | |
|---|
| 12 | (defmfun allocate-hankel (size) |
|---|
| 13 | "gsl_dht_alloc" |
|---|
| 14 | ((size size)) |
|---|
| 15 | :c-return :pointer |
|---|
| 16 | :export nil |
|---|
| 17 | :index (letm hankel) |
|---|
| 18 | :documentation ; FDL |
|---|
| 19 | "Allocate a Discrete Hankel transform object of given size.") |
|---|
| 20 | |
|---|
| 21 | (defmfun init-hankel (hankel nu xmax) |
|---|
| 22 | "gsl_dht_new" |
|---|
| 23 | ((hankel :pointer) (nu :double) (xmax :double)) |
|---|
| 24 | :export nil |
|---|
| 25 | :index (letm hankel) |
|---|
| 26 | :documentation ; FDL |
|---|
| 27 | "Initialize the transform for the given values of nu and x.") |
|---|
| 28 | |
|---|
| 29 | ;; This seems redundant; does it effectively combine allocate-hankel |
|---|
| 30 | ;; and init-hankel? In this case we don't really need, and shouldn't |
|---|
| 31 | ;; export it. |
|---|
| 32 | (defmfun new-hankel (size nu xmax) |
|---|
| 33 | "gsl_dht_new" |
|---|
| 34 | ((size size) (nu :double) (xmax :double)) |
|---|
| 35 | :c-return :pointer |
|---|
| 36 | :documentation ; FDL |
|---|
| 37 | "Allocate a Discrete Hankel transform object of size |
|---|
| 38 | size and initializes it for the given values of nu and |
|---|
| 39 | xmax.") |
|---|
| 40 | |
|---|
| 41 | (defmfun free-hankel (hankel) |
|---|
| 42 | "gsl_dht_free" |
|---|
| 43 | ((hankel :pointer)) |
|---|
| 44 | :c-return :void |
|---|
| 45 | :export nil |
|---|
| 46 | :index (letm hankel) |
|---|
| 47 | :documentation ; FDL |
|---|
| 48 | "Free the Hankel object.") |
|---|
| 49 | |
|---|
| 50 | (defmfun apply-hankel (hankel array-in array-out) |
|---|
| 51 | "gsl_dht_apply" |
|---|
| 52 | ((hankel :pointer) ((gsl-array array-in) :pointer) |
|---|
| 53 | ((gsl-array array-out) :pointer)) |
|---|
| 54 | :documentation ; FDL |
|---|
| 55 | "Apply the transform to the array array-in |
|---|
| 56 | whose size is equal to the size of the transform. The result is stored |
|---|
| 57 | in the array array-out which must be of the same length.") |
|---|
| 58 | |
|---|
| 59 | (defmfun sample-x-hankel (hankel n) |
|---|
| 60 | "gsl_dht_x_sample" |
|---|
| 61 | ((hankel :pointer) (n :int)) |
|---|
| 62 | :c-return :double |
|---|
| 63 | :documentation ; FDL |
|---|
| 64 | "The points where the function f(t) is assumed to be sampled.") |
|---|
| 65 | |
|---|
| 66 | (defmfun sample-k-hankel (hankel n) |
|---|
| 67 | "gsl_dht_k_sample" |
|---|
| 68 | ((hankel :pointer) (n :int)) |
|---|
| 69 | :c-return :double |
|---|
| 70 | :documentation ; FDL |
|---|
| 71 | "The value of the n-th sample point in k-space, j_{\nu,n+1}/X}.") |
|---|