hornetseye-fftw3 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config.rb +1 -1
- data/ext/node.cc +6 -6
- data/test/tc_fftw3.rb +2 -2
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8cde9eff10d9d0fa9dfca3d24ee8aaf0dbdf205c
|
4
|
+
data.tar.gz: 044aabf26cac45b539dba2dff234300dec448f94
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b198592dbe8ad48fc28765e1244cd6fa8bda03a365caad370fae327868c33f78330d22507bc8f91f67501431015bd8ca75787fa07ee094710442dc2cad566584
|
7
|
+
data.tar.gz: 523cc9270c6d43e4a144ee7484a567a6456bb13ae3904da107f0092a5b325d57343f15cde0fc9fa9164a1fc8d707d568203c4407202b8b0223ee74d272fe6329
|
data/config.rb
CHANGED
data/ext/node.cc
CHANGED
@@ -49,7 +49,7 @@ VALUE Node::wrapFFT( VALUE rbSelf, VALUE rbForward )
|
|
49
49
|
int rank = RARRAY_LEN( rbShape );
|
50
50
|
shared_array< int > n( new int[ rank ] );
|
51
51
|
for ( int i=0; i<rank; i++ )
|
52
|
-
n[ rank - 1 - i ] = NUM2INT(
|
52
|
+
n[ rank - 1 - i ] = NUM2INT( rb_ary_entry( rbShape , i) );
|
53
53
|
VALUE rbDest = Qnil;
|
54
54
|
if ( rb_funcall( rbTypecode, rb_intern( "==" ), 1,
|
55
55
|
rb_const_get( mModule, rb_intern( "SCOMPLEX" ) ) ) == Qtrue ) {
|
@@ -88,7 +88,7 @@ VALUE Node::wrapFFT( VALUE rbSelf, VALUE rbForward )
|
|
88
88
|
rbRetVal = rb_funcall2( rb_funcall( rb_const_get( mModule, rb_intern( "Sequence" ) ),
|
89
89
|
rb_intern( "import" ), 3,
|
90
90
|
rbTypecode, rbDest, rbSize ),
|
91
|
-
rb_intern( "reshape" ), rank,
|
91
|
+
rb_intern( "reshape" ), rank, RARRAY_CONST_PTR(rbShape) );
|
92
92
|
} catch ( std::exception &e ) {
|
93
93
|
rb_raise( rb_eRuntimeError, "%s", e.what() );
|
94
94
|
};
|
@@ -108,7 +108,7 @@ VALUE Node::wrapRFFT( VALUE rbSelf, VALUE rbForward )
|
|
108
108
|
int rank = RARRAY_LEN( rbShape );
|
109
109
|
shared_array< int > n( new int[ rank ] );
|
110
110
|
for ( int i=0; i<rank; i++ )
|
111
|
-
n[ rank - 1 - i ] = NUM2INT(
|
111
|
+
n[ rank - 1 - i ] = NUM2INT( rb_ary_entry( rbShape , i) );
|
112
112
|
VALUE rbDest = Qnil;
|
113
113
|
VALUE rbRetType = Qnil;
|
114
114
|
int size = 0;
|
@@ -119,11 +119,11 @@ VALUE Node::wrapRFFT( VALUE rbSelf, VALUE rbForward )
|
|
119
119
|
"fourier transform of real data" );
|
120
120
|
int half = n[ rank - 1 ] / 2 + 1;
|
121
121
|
size = inSize / n[ rank - 1 ] * half;
|
122
|
-
|
122
|
+
rb_ary_store(rbShape, 0, INT2NUM(half));
|
123
123
|
} else {
|
124
124
|
int twice = ( n[ rank - 1 ] - 1 ) * 2;
|
125
125
|
size = inSize / n[ rank - 1 ] * twice;
|
126
|
-
|
126
|
+
rb_ary_store(rbShape, 0, INT2NUM(twice));
|
127
127
|
n[ rank - 1 ] = twice;
|
128
128
|
};
|
129
129
|
};
|
@@ -214,7 +214,7 @@ VALUE Node::wrapRFFT( VALUE rbSelf, VALUE rbForward )
|
|
214
214
|
rbRetVal = rb_funcall2( rb_funcall( rb_const_get( mModule, rb_intern( "Sequence" ) ),
|
215
215
|
rb_intern( "import" ), 3,
|
216
216
|
rbRetType, rbDest, INT2NUM( size ) ),
|
217
|
-
rb_intern( "reshape" ), rank,
|
217
|
+
rb_intern( "reshape" ), rank, RARRAY_CONST_PTR(rbShape) );
|
218
218
|
} catch ( std::exception &e ) {
|
219
219
|
rb_raise( rb_eRuntimeError, "%s", e.what() );
|
220
220
|
};
|
data/test/tc_fftw3.rb
CHANGED
@@ -35,7 +35,7 @@ class TC_FFTW3 < Test::Unit::TestCase
|
|
35
35
|
|
36
36
|
def test_fft
|
37
37
|
[ SC, DC ].each do |t|
|
38
|
-
s = S( t
|
38
|
+
s = S( t )[ 1, I, 3 ]
|
39
39
|
u = s.fft.ifft
|
40
40
|
s.to_a.zip( u.to_a ).each do |a,b|
|
41
41
|
assert_in_delta a.real, b.real, 1.0e-5
|
@@ -46,7 +46,7 @@ class TC_FFTW3 < Test::Unit::TestCase
|
|
46
46
|
|
47
47
|
def test_rfft
|
48
48
|
[ F, D ].each do |t|
|
49
|
-
s = S( t
|
49
|
+
s = S( t )[ 2, 3, 5, 7 ]
|
50
50
|
u = s.rfft.irfft
|
51
51
|
s.to_a.zip( u.to_a ).each do |a,b|
|
52
52
|
assert_in_delta a, b, 1.0e-5
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hornetseye-fftw3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Wedekind
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: malloc
|
@@ -81,10 +81,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
81
81
|
version: '0'
|
82
82
|
requirements: []
|
83
83
|
rubyforge_project: hornetseye
|
84
|
-
rubygems_version: 2.
|
84
|
+
rubygems_version: 2.5.1
|
85
85
|
signing_key:
|
86
86
|
specification_version: 4
|
87
87
|
summary: Fourier transforms
|
88
88
|
test_files:
|
89
89
|
- test/tc_fftw3.rb
|
90
|
-
has_rdoc: yard
|