hornetseye-fftw3 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/config.rb +1 -1
  3. data/ext/node.cc +6 -6
  4. data/test/tc_fftw3.rb +2 -2
  5. metadata +3 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2734533300b22e1c07320e53fe6a55ddffc91f73
4
- data.tar.gz: 5b9968f35143bea83bbe79500a7bf20c7d9dbe99
3
+ metadata.gz: 8cde9eff10d9d0fa9dfca3d24ee8aaf0dbdf205c
4
+ data.tar.gz: 044aabf26cac45b539dba2dff234300dec448f94
5
5
  SHA512:
6
- metadata.gz: 7d4b288283ff1a40325f7bb37aa3bc72716ffb45c8a464e5c5406d06fdc6d65003a56b2376ac5697c97a39ebc69bcf7b30d143594e62900166702387e5ab584b
7
- data.tar.gz: 1eace15a379f4e669e870663da2700240bf6fd83a4ff4c74465c2481018802f395eeb3d33a6561d469fd36fccc66697ad878acf79a1013bfd4cae4d3fe63bcf7
6
+ metadata.gz: b198592dbe8ad48fc28765e1244cd6fa8bda03a365caad370fae327868c33f78330d22507bc8f91f67501431015bd8ca75787fa07ee094710442dc2cad566584
7
+ data.tar.gz: 523cc9270c6d43e4a144ee7484a567a6456bb13ae3904da107f0092a5b325d57343f15cde0fc9fa9164a1fc8d707d568203c4407202b8b0223ee74d272fe6329
data/config.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  require 'rake'
2
2
 
3
3
  PKG_NAME = 'hornetseye-fftw3'
4
- PKG_VERSION = '1.0.2'
4
+ PKG_VERSION = '1.0.3'
5
5
  CFG = RbConfig::CONFIG
6
6
  CXX = ENV[ 'CXX' ] || 'g++'
7
7
  RB_FILES = ['config.rb'] + FileList[ 'lib/**/*.rb' ]
@@ -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( RARRAY_PTR( rbShape )[i] );
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, RARRAY_PTR(rbShape) );
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( RARRAY_PTR( rbShape )[i] );
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
- RARRAY_PTR(rbShape)[0] = INT2NUM(half);
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
- RARRAY_PTR(rbShape)[0] = INT2NUM(twice);
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, RARRAY_PTR(rbShape) );
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
  };
@@ -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, 3 )[ 1, I, 3 ]
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, 4 )[ 2, 3, 5, 7 ]
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.2
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: 2015-05-15 00:00:00.000000000 Z
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.4.6
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