vdsp 1.2.0 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/ext/vdsp/vdsp.c +14 -1
  3. data/lib/vdsp/version.rb +1 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3025c810d13e2fe874cdba89cecf0a4fb8dd1c9415ddd3c45fd5871ef5d42843
4
- data.tar.gz: 8db6933119c952074264f242c734d5b61b9573bd82625c42bab2b4f4af275eb9
3
+ metadata.gz: f3f7d6b02cc02ee6307b867050c4ce0ecd687b5202816b54c7ca996648c2da33
4
+ data.tar.gz: 75c154622f19d6491e770a7fe24e793de274706c6b0e8aa0a3278e2346d8a784
5
5
  SHA512:
6
- metadata.gz: 8f0e386529e000782c005582ce7829cb5ca6ac57856a5c7053e3cac18b3dc87c2258c36f935a16d11de2c1539597ca5d2a6eab7b633f6079b43340fc46bb1b3d
7
- data.tar.gz: b3ab73efc0f4f4df4c090c656f826f9bbfb693bcb04c0ecdbb548ef8307ecee111107cc4246d4230a26accaa5bb697bca460bdcbeeeadfd0022f138b1d4ab041
6
+ metadata.gz: 1929ae32bde77dde073ea2e606234702a0566ff26fe1d48d206f0d9bed5ce4832287f1b014ed1f5431fde7189cd903c64998b59d96342c038c8c3af74d232f1e
7
+ data.tar.gz: 17a0090b4cae480fd3cf4a32cd0d63fc800abc1882ca7508ed8723e0286963c4da2582dd2cf38224b9920ce95fe27e9786fd4b61d88b28f40af241c9c1d5cfc4
data/ext/vdsp/vdsp.c CHANGED
@@ -154,6 +154,18 @@ VALUE rb_double_array_initialize(VALUE self, VALUE length)
154
154
  return self;
155
155
  }
156
156
 
157
+ VALUE rb_double_array_initialize_copy(VALUE self, VALUE orig)
158
+ {
159
+ VALUE length = rb_vdsp_array_length(orig);
160
+ rb_double_array_initialize(self, length);
161
+
162
+ VdspArrayNativeResource *dst = get_vdsp_array_native_resource(self);
163
+ VdspArrayNativeResource *src = get_vdsp_array_native_resource(orig);
164
+ memcpy(dst->v.ptr, src->v.ptr, sizeof(double) * src->length);
165
+
166
+ return self;
167
+ }
168
+
157
169
  VALUE rb_double_array_set_values(VALUE self, VALUE ary)
158
170
  {
159
171
  if (!RB_TYPE_P(ary, T_ARRAY)) {
@@ -1262,7 +1274,7 @@ VALUE rb_double_vsbsbm(int argc, VALUE *argv, VALUE cls)
1262
1274
  return e;
1263
1275
  }
1264
1276
 
1265
- // e[i] = (a[i] + b[i]) * (c[i] + d[i])
1277
+ // e[i] = (a[i] + b[i]) * (c[i] - d[i])
1266
1278
  VALUE rb_double_vasbm(int argc, VALUE *argv, VALUE cls)
1267
1279
  {
1268
1280
  if (argc!=16) {
@@ -1927,6 +1939,7 @@ void Init_vdsp()
1927
1939
  rb_cDoubleArray = rb_define_class_under(rb_mVdsp, "DoubleArray", rb_cObject);
1928
1940
  rb_include_module(rb_cDoubleArray, rb_mVdspArray);
1929
1941
  rb_define_method(rb_cDoubleArray, "initialize", rb_double_array_initialize, 1);
1942
+ rb_define_private_method(rb_cDoubleArray, "initialize_copy", rb_double_array_initialize_copy, 1);
1930
1943
  rb_define_singleton_method(rb_cDoubleArray, "create", rb_double_array_create, 1);
1931
1944
  rb_define_method(rb_cDoubleArray, "to_da", rb_double_array_to_da, 0);
1932
1945
  rb_define_method(rb_cDoubleArray, "+", rb_double_array_plus, 1);
data/lib/vdsp/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Vdsp
2
- VERSION = "1.2.0"
2
+ VERSION = "1.3.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vdsp
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - yoshida
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-09-15 00:00:00.000000000 Z
11
+ date: 2019-09-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler