Commit 3c6a2d2e authored by Sumant Oemrawsingh's avatar Sumant Oemrawsingh
Browse files

Vector size passed to GSL functions now take stride into account.

For the FFT functions in GSLL, the vector sizes cannot be supplied by the
caller, but the stride can. The vector size passed to GSL is not the actual
vector size, but rather the size of the vector taking the stride into account:
(floor (size vector) stride). This is now fixed.
parent a25477a5
......@@ -15,9 +15,9 @@
;;; Backward transformations where the size is a power of 2
(defmfun backward-fourier-transform-radix2
((vector vector) &key (stride 1) (n (expt 2 (floor (log (size vector) 2)))))
((vector vector) &key (stride 1))
("gsl_fft" :type "_radix2_backward")
(((c-pointer vector) :pointer) (stride sizet) (n sizet))
(((c-pointer vector) :pointer) (stride sizet) ((floor (size vector) stride) sizet))
:definition :generic
:element-types :complex
:inputs (vector)
......@@ -29,11 +29,11 @@
"Backward FFT on a vector for which (floor length stride) is a power of 2.")
(defmfun backward-fourier-transform-nonradix2
((vector vector) &key (stride 1) (n (size vector))
(wavetable (make-fft-wavetable element-type (size vector)))
(workspace (make-fft-workspace element-type (size vector))))
((vector vector) &key (stride 1)
(wavetable (make-fft-wavetable element-type (floor (size vector) stride)))
(workspace (make-fft-workspace element-type (floor (size vector) stride))))
("gsl_fft" :type "_backward")
(((c-pointer vector) :pointer) (stride sizet) (n sizet)
(((c-pointer vector) :pointer) (stride sizet) ((floor (size vector) stride) sizet)
((mpointer wavetable) :pointer) ((mpointer workspace) :pointer))
:definition :generic
:element-types :complex
......@@ -51,9 +51,9 @@
;;;;****************************************************************************
(defmfun backward-fourier-transform-halfcomplex-radix2
((vector vector) &key (stride 1) (n (expt 2 (floor (log (size vector) 2)))))
((vector vector) &key (stride 1))
("gsl_fft_halfcomplex" :type "_radix2_backward")
(((c-pointer vector) :pointer) (stride sizet) (n sizet))
(((c-pointer vector) :pointer) (stride sizet) ((floor (size vector) stride) sizet))
:definition :generic
:element-types :float
:inputs (vector)
......@@ -66,11 +66,11 @@
in half complex form.")
(defmfun backward-fourier-transform-halfcomplex-nonradix2
((vector vector) &key (stride 1) (n (size vector))
(wavetable (make-fft-wavetable element-type (size vector) t))
(workspace (make-fft-workspace element-type (size vector))))
((vector vector) &key (stride 1)
(wavetable (make-fft-wavetable element-type (floor (size vector) stride) t))
(workspace (make-fft-workspace element-type (floor (size vector) stride))))
("gsl_fft_halfcomplex" :type "_backward")
(((c-pointer vector) :pointer) (stride sizet) (n sizet)
(((c-pointer vector) :pointer) (stride sizet) ((floor (size vector) stride) sizet)
((mpointer wavetable) :pointer) ((mpointer workspace) :pointer))
:definition :generic
:element-types :float
......@@ -88,9 +88,9 @@
;;;;****************************************************************************
(defmfun backward-fourier-transform-dif-radix2
((vector vector) &key (stride 1) (n (expt 2 (floor (log (size vector) 2)))))
((vector vector) &key (stride 1))
("gsl_fft" :type "_radix2_dif_backward")
(((c-pointer vector) :pointer) (stride sizet) (n sizet))
(((c-pointer vector) :pointer) (stride sizet) ((floor (size vector) stride) sizet))
:definition :generic
:element-types :complex
:inputs (vector)
......
......@@ -15,7 +15,7 @@
&key (stride 1)
(result (make-marray element-type :dimensions (dimensions vector))))
("gsl_dft" :type "_forward")
(((c-pointer vector) :pointer) (stride sizet) ((size vector) sizet)
(((c-pointer vector) :pointer) (stride sizet) ((floor (size vector) stride) sizet)
((c-pointer result) :pointer))
:definition :generic
:element-types :complex
......@@ -31,7 +31,7 @@
&key (stride 1)
(result (make-marray element-type :dimensions (dimensions vector))))
("gsl_dft" :type "_backward")
(((c-pointer vector) :pointer) (stride sizet) ((size vector) sizet)
(((c-pointer vector) :pointer) (stride sizet) ((floor (size vector) stride) sizet)
((c-pointer result) :pointer))
:definition :generic
:element-types :complex
......@@ -47,7 +47,7 @@
&key (stride 1)
(result (make-marray element-type :dimensions (dimensions vector))))
("gsl_dft" :type "_inverse")
(((c-pointer vector) :pointer) (stride sizet) ((size vector) sizet)
(((c-pointer vector) :pointer) (stride sizet) ((floor (size vector) stride) sizet)
((c-pointer result) :pointer))
:definition :generic
:element-types :complex
......@@ -63,7 +63,7 @@
&key (stride 1)
(result (make-marray element-type :dimensions (dimensions vector))))
("gsl_dft" :type "_transform")
(((c-pointer vector) :pointer) (stride sizet) ((size vector) sizet)
(((c-pointer vector) :pointer) (stride sizet) ((floor (size vector) stride) sizet)
((c-pointer result) :pointer))
:definition :generic
:element-types :complex
......
......@@ -21,7 +21,7 @@
single-float "gsl_fft_real_float_radix2_transform"
complex-double-float "gsl_fft_complex_radix2_forward"
complex-single-float "gsl_fft_complex_float_radix2_forward")
(((c-pointer vector) :pointer) (stride sizet) ((size vector) sizet))
(((c-pointer vector) :pointer) (stride sizet) ((floor (size vector) stride) sizet))
:definition :generic
:element-types :float-complex
:inputs (vector)
......@@ -34,13 +34,13 @@
(defmfun forward-fourier-transform-nonradix2
((vector vector) &key (stride 1)
(wavetable (make-fft-wavetable element-type (size vector)))
(workspace (make-fft-workspace element-type (size vector))))
(wavetable (make-fft-wavetable element-type (floor (size vector) stride)))
(workspace (make-fft-workspace element-type (floor (size vector) stride))))
(double-float "gsl_fft_real_transform"
single-float "gsl_fft_real_float_transform"
complex-double-float "gsl_fft_complex_forward"
complex-single-float "gsl_fft_complex_float_forward")
(((c-pointer vector) :pointer) (stride sizet) ((size vector) sizet)
(((c-pointer vector) :pointer) (stride sizet) ((floor (size vector) stride) sizet)
((mpointer wavetable) :pointer) ((mpointer workspace) :pointer))
:definition :generic
:element-types :float-complex
......@@ -59,7 +59,7 @@
(defmfun forward-fourier-transform-halfcomplex-radix2
((vector vector) &key (stride 1))
("gsl_fft_halfcomplex" :type "_radix2_transform")
(((c-pointer vector) :pointer) (stride sizet) ((size vector) sizet))
(((c-pointer vector) :pointer) (stride sizet) ((floor (size vector) stride) sizet))
:definition :generic
:element-types :float
:inputs (vector)
......@@ -73,10 +73,10 @@
(defmfun forward-fourier-transform-halfcomplex-nonradix2
((vector vector) &key (stride 1)
(wavetable (make-fft-wavetable element-type (size vector) t))
(workspace (make-fft-workspace element-type (size vector))))
(wavetable (make-fft-wavetable element-type (floor (size vector) stride) t))
(workspace (make-fft-workspace element-type (floor (size vector) stride))))
("gsl_fft_halfcomplex" :type "_transform")
(((c-pointer vector) :pointer) (stride sizet) ((size vector) sizet)
(((c-pointer vector) :pointer) (stride sizet) ((floor (size vector) stride) sizet)
((mpointer wavetable) :pointer) ((mpointer workspace) :pointer))
:definition :generic
:element-types :float
......@@ -95,7 +95,7 @@
(defmfun forward-fourier-transform-dif-radix2 ((vector vector) &key (stride 1))
("gsl_fft" :type "_radix2_dif_forward")
(((c-pointer vector) :pointer) (stride sizet) ((size vector) sizet))
(((c-pointer vector) :pointer) (stride sizet) ((floor (size vector) stride) sizet))
:definition :generic
:element-types :complex
:inputs (vector)
......
......@@ -15,9 +15,9 @@
;;; Inverse transformations where the size is a power of 2
(defmfun inverse-fourier-transform-radix2
((vector vector) &key (stride 1) (n (expt 2 (floor (log (size vector) 2)))))
((vector vector) &key (stride 1))
("gsl_fft" :type "_radix2_inverse")
(((c-pointer vector) :pointer) (stride sizet) (n sizet))
(((c-pointer vector) :pointer) (stride sizet) ((floor (size vector) stride) sizet))
:definition :generic
:element-types :complex
:inputs (vector)
......@@ -29,11 +29,11 @@
"Inverse FFT on a vector for which (floor length stride) is a power of 2.")
(defmfun inverse-fourier-transform-nonradix2
((vector vector) &key (stride 1) (n (size vector))
(wavetable (make-fft-wavetable element-type (size vector)))
(workspace (make-fft-workspace element-type (size vector))))
((vector vector) &key (stride 1)
(wavetable (make-fft-wavetable element-type (floor (size vector) stride)))
(workspace (make-fft-workspace element-type (floor (size vector) stride))))
("gsl_fft" :type "_inverse")
(((c-pointer vector) :pointer) (stride sizet) (n sizet)
(((c-pointer vector) :pointer) (stride sizet) ((floor (size vector) stride) sizet)
((mpointer wavetable) :pointer) ((mpointer workspace) :pointer))
:definition :generic
:element-types :complex
......@@ -51,9 +51,9 @@
;;;;****************************************************************************
(defmfun inverse-fourier-transform-halfcomplex-radix2
((vector vector) &key (stride 1) (n (expt 2 (floor (log (size vector) 2)))))
((vector vector) &key (stride 1))
("gsl_fft_halfcomplex" :type "_radix2_inverse")
(((c-pointer vector) :pointer) (stride sizet) (n sizet))
(((c-pointer vector) :pointer) (stride sizet) ((floor (size vector) stride) sizet))
:definition :generic
:element-types :float
:inputs (vector)
......@@ -66,11 +66,11 @@
in half complex form.")
(defmfun inverse-fourier-transform-halfcomplex-nonradix2
((vector vector) &key (stride 1) (n (size vector))
(wavetable (make-fft-wavetable element-type (size vector) t))
(workspace (make-fft-workspace element-type (size vector))))
((vector vector) &key (stride 1)
(wavetable (make-fft-wavetable element-type (floor (size vector) stride) t))
(workspace (make-fft-workspace element-type (floor (size vector) stride))))
("gsl_fft_halfcomplex" :type "_inverse")
(((c-pointer vector) :pointer) (stride sizet) (n sizet)
(((c-pointer vector) :pointer) (stride sizet) ((floor (size vector) stride) sizet)
((mpointer wavetable) :pointer) ((mpointer workspace) :pointer))
:definition :generic
:element-types :float
......@@ -88,9 +88,9 @@
;;;;****************************************************************************
(defmfun inverse-fourier-transform-dif-radix2
((vector vector) &key (stride 1) (n (expt 2 (floor (log (size vector) 2)))))
((vector vector) &key (stride 1))
("gsl_fft" :type "_radix2_dif_inverse")
(((c-pointer vector) :pointer) (stride sizet) (n sizet))
(((c-pointer vector) :pointer) (stride sizet) ((floor (size vector) stride) sizet))
:definition :generic
:element-types :complex
:inputs (vector)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment