[DRE-commits] [SCM] ruby-fftw3.git branch, master, updated. debian/0.4-3-4-gb0a9a22

Youhei SASAKI uwabami at gfd-dennou.org
Sat Nov 24 05:47:17 UTC 2012


The following commit has been merged in the master branch:
commit b0a9a22195e9a55628dfdac5d7cab381562b7cf9
Author: Youhei SASAKI <uwabami at gfd-dennou.org>
Date:   Sat Nov 24 14:46:12 2012 +0900

    unapply patches after build
    
    Signed-off-by: Youhei SASAKI <uwabami at gfd-dennou.org>

diff --git a/debian/source/local-options b/debian/source/local-options
new file mode 100644
index 0000000..4aceb10
--- /dev/null
+++ b/debian/source/local-options
@@ -0,0 +1 @@
+unapply-patches
diff --git a/extconf.rb b/extconf.rb
index 8e53119..1607ea7 100644
--- a/extconf.rb
+++ b/extconf.rb
@@ -1,7 +1,7 @@
 require "mkmf"
 
-dir_config('narray',$vendorarchdir,$vendorarchdir)
-dir_config('fftw3','/usr')
+dir_config('narray',$sitearchdir,$sitearchdir)
+dir_config('fftw3','/usr/local')
 
 if ( ! ( have_header("narray.h") && have_header("narray_config.h") ) ) then
    print <<-EOS
diff --git a/test/complexFFT.rb b/test/complexFFT.rb
index 39ae57e..e92f64e 100644
--- a/test/complexFFT.rb
+++ b/test/complexFFT.rb
@@ -1,39 +1,38 @@
-require "test/unit"
-require "narray"
 require "numru/fftw3"
 include NumRu
 
-class ComplexTest < Test::Unit::TestCase
-
-  def setup
-    @na_double = NArray.float(8,4).fill(1.0)
-    @na_single = NArray.sfloat(8,4).indgen!
-    @na_complex = NArray.float(4,3,8,3)
-    @na_complex[1,1,1,0] = 1.0
-    @sfloat_delta = 5.0e-5
-    @float_delta = 1.0e-13
-  end
-
-  define_method("test_double_float") do
-    fc_double = FFTW3.fft(@na_double, -1)/@na_double.length
-    assert_in_delta @na_double, FFTW3.fft(fc_double, 1).real, @float_delta
-  end
-
-  define_method("test_single_float") do
-    fc_single = FFTW3.fft(@na_single, -1)/@na_single.length
-    assert_in_delta @na_single, FFTW3.fft(fc_single, 1).real, @sfloat_delta
-  end
-
-  define_method("test_dimenssion_selection") do
-    fc_double = FFTW3.fft(@na_double, -1, 0)/@na_double.shape[0]
-    assert_in_delta @na_double, FFTW3.fft(fc_double, 1, 0).real, @float_delta
-    fc_single = FFTW3.fft(@na_single, -1, 0)/@na_single.shape[0]
-    assert_in_delta @na_single, FFTW3.fft(fc_single, 1, 0).real, @sfloat_delta
-  end
-
-  define_method("test_complex") do
-    fc_complex = FFTW3.fft(@na_complex, -1, 0, 1, 2)/(@na_complex.shape[0]*@na_complex.shape[1]*@na_complex.shape[2])
-    assert_in_delta @na_complex, FFTW3.fft(fc_complex, 1, 0, 1, 2).real, @float_delta
-  end
-
-end
+print "\n**TEST** all dimensions\n\n"
+
+na = NArray.float(8,4).fill(1)  # will be corced to complex
+na[1,1]=5
+p na
+fc = FFTW3.fft(na, -1)/na.length 
+p fc
+p fc.real
+
+p FFTW3.fft(fc, 1).real
+
+print "\n**TEST** single float (treated as single if lib fftw3f exits)\n"
+print " --- see http://www.fftw.org/fftw3_doc/Precision.html for more info\n\n"
+na = NArray.sfloat(8,4).indgen!
+fc = FFTW3.fft(na, -1)/na.length 
+p fc
+p FFTW3.fft(fc, 1).real
+
+print "\n**TEST** dimension selection\n\n"
+
+fc = FFTW3.fft(na, -1, 0)/na.shape[0]
+p fc
+p FFTW3.fft(fc, 1, 0).real
+fc = FFTW3.fft(na, -1, 1)/na.shape[1]
+p fc
+p FFTW3.fft(fc, 1, 1).real
+
+na = NArray.float(4,3,8,3)
+na[1,1,1,0]= 1
+p( fc=FFTW3.fft(na, -1, 0,2) / (na.shape[0]*na.shape[2]) )
+p( fc=FFTW3.fft(na, -1, 1) / na.shape[1] )
+p( fc=FFTW3.fft(na, -1, 0,1,2)  / (na.shape[0]*na.shape[1]*na.shape[2]) )
+p FFTW3.fft(fc, 1, 0,1,2).real
+
+

-- 
ruby-fftw3.git



More information about the Pkg-ruby-extras-commits mailing list