• Download Gist
Valiant-refactor-that-still-doesn-t-fix-the-problem.patch
Diff
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
From bc237fda172824e36a6de376e56e9865f6d857f4 Mon Sep 17 00:00:00 2001
From: Duke Leto <jonathan@leto.net>
Date: Tue, 18 Nov 2008 08:59:44 -0800
Subject: [PATCH] Valiant refactor that still doesn't fix the problem
 
---
swig/FFT.i | 14 ++++++++++++--
t/FFT.t | 23 ++++++++++++-----------
2 files changed, 24 insertions(+), 13 deletions(-)
 
diff --git a/swig/FFT.i b/swig/FFT.i
index 0cd8bd5..3c5f7f2 100644
--- a/swig/FFT.i
+++ b/swig/FFT.i
@@ -1,6 +1,11 @@
%module "Math::GSL::FFT"
%include "typemaps.i"
%include "gsl_typemaps.i"
+%include "gsl/gsl_math.h"
+%include "gsl/gsl_sys.h"
+%include "gsl/gsl_pow_int.h"
+%include "gsl/gsl_nan.h"
+%include "gsl/gsl_machine.h"
%include "gsl/gsl_complex.h"
%include "gsl/gsl_fft.h"
%include "gsl/gsl_fft_complex.h"
@@ -8,6 +13,7 @@
%include "gsl/gsl_fft_real.h"
%include "../pod/FFT.pod"
+
%typemap(argout) (double data[], const size_t stride, const size_t n) {
int i=0;
AV* tempav = newAV();
@@ -36,10 +42,14 @@
}
%{
+ #include "gsl/gsl_complex.h"
+ #include "gsl/gsl_sys.h"
+ #include "gsl/gsl_pow_int.h"
+ #include "gsl/gsl_nan.h"
+ #include "gsl/gsl_machine.h"
+ #include "gsl/gsl_math.h"
#include "gsl/gsl_fft.h"
#include "gsl/gsl_fft_complex.h"
#include "gsl/gsl_fft_halfcomplex.h"
#include "gsl/gsl_fft_real.h"
- #include "gsl/gsl_complex.h"
%}
-
diff --git a/t/FFT.t b/t/FFT.t
index a2ce667..2bdb782 100644
--- a/t/FFT.t
+++ b/t/FFT.t
@@ -1,11 +1,11 @@
package Math::GSL::FFT::Test;
-use Math::GSL::Test qw/:all/;
use base q{Test::Class};
-use Test::More;
-use Math::GSL::FFT qw/:all/;
-use Math::GSL qw/:all/;
-use Data::Dumper;
+use Math::GSL::Test qw/:all/;
+use Math::GSL::FFT qw/:all/;
+use Math::GSL qw/:all/;
use Math::GSL::Errno qw/:all/;
+use Data::Dumper;
+use Test::More;
use strict;
BEGIN { gsl_set_error_handler_off() }
@@ -18,17 +18,18 @@ sub teardown : Test(teardown) {
}
sub FFT_REAL_RADIX2_TRANSFORM : Tests
{
- my $data = [ (0) x 5, (1) x 22, (0) x 5 ];
- my ($status, $pass ) = gsl_fft_real_radix2_transform ($data, 1, 32);
- ok_status($status);
- ok_similar( $pass, [
- 22, -8.44205264582682, -4.64465605976076, -0.643126602526688, 1.70710678118655, 1.8349201998544,
+ my $input = [ (0) x 5, (1) x 22, (0) x 5 ];
+ my $expected = [ 22, -8.44205264582682, -4.64465605976076, -0.643126602526688, 1.70710678118655, 1.8349201998544,
0.572726230154202, -0.676964287646119, -1, -0.455944707054924, 0.255700894591988, 0.524240654352147,
0.292893218813453, -0.059180002187481, -0.183771064985432, -0.0818926089645147, 0, -0.831469612302545,
-0.923879532511287, -0.195090322016128, 0.707106781186547, 0.98078528040323, 0.38268343236509,
-0.555570233019602, -1, -0.555570233019602, 0.38268343236509, 0.980785280403231, 0.707106781186547,
-0.195090322016128, -0.923879532511287, -0.831469612302545
- ]);
+ ];
+ my ($status, $output ) = gsl_fft_real_radix2_transform ($input, 1, 32);
+ ok_status($status);
+
+ ok_similar( $output, $expected );
}
sub FFT_COMPLEX_RADIX2_FORWARD : Tests
--
1.6.0.1+GitX

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.