From be311859ac62d6329a19242a2211e459f1e74561 Mon Sep 17 00:00:00 2001 From: Sumant Oemrawsingh <soemraws@xs4all.nl> Date: Fri, 3 Sep 2010 00:07:35 +0200 Subject: [PATCH] Expected number of assertions fail consistently in fast-fourier-transform. There was one case left where even out-of-stride elements were scaled as well. Tests are still not enabled. --- fast-fourier-transforms/example.lisp | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/fast-fourier-transforms/example.lisp b/fast-fourier-transforms/example.lisp index c5b1592f..0c1f5d1f 100644 --- a/fast-fourier-transforms/example.lisp +++ b/fast-fourier-transforms/example.lisp @@ -195,22 +195,19 @@ random-vector ; The original vector for reference inverse ; The inverse FFT applied to the forward result (if (and (have-at-least-gsl-version '(1 12)) #+fsbv t #-fsbv nil) - (elt/ (copy backward) (size-vector-scalar backward :stride stride)) + (vector/length backward :stride stride) ;; Hack for old GSL version without complex vector math - (grid:make-foreign-array - (element-type backward) - :dimensions (dimensions backward) - :initial-contents - (map 'list - (lambda (x) (/ x (floor (size backward) stride))) - (grid:copy-to backward)))))) + (vector/length (grid:make-foreign-array + (element-type backward) + :dimensions (dimensions backward) + :initial-contents (grid:copy-to backward)) + :stride stride)))) (multiple-value-bind (forward inverse) (test-real-fft-noise random-vector :stride stride) (values dft-random-vector forward random-vector inverse))))) -(test-fft-noise 'double-float 10 :stride 2) -(test-fft-noise '(complex double-float) 10 :stride 2) - +;; (test-fft-noise '(complex double-float) 2 :stride 2) +;; (test-fft-noise '(complex double-float) 10 :stride 2) ;; (test-fft-noise 'double-float 10 :stride 1) ;; (test-fft-noise '(complex double-float) 10 :stride 1) -- GitLab