numo-libsvm 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/ext/numo/libsvm/libsvmext.c +4 -0
- data/ext/numo/libsvm/svm_parameter.c +2 -2
- data/lib/numo/libsvm/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d72a8a48f52a71000c0ff4b1202684a8929a8e34b3004f5f142cccbd9af1e034
|
4
|
+
data.tar.gz: 7c8f38da980376b9ca84191235e10cf98bd9ff44ab546ee3b52d105b57cb4ec7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 795830bf885ba8164bb95619eb713cd3b893c61c0c3b1f43de66afb7d3632383054e1ca6870d48ca8a69f0b1fc2007e42b5e37ab67ef14848dd7a471c4d195d2
|
7
|
+
data.tar.gz: 41388d1b428d3e4e7a181149cc53a7b1654af3b61961dce67948b86ef54fb96eb24e626d1ffe2645fc59886e37d44ec3ba20333c2e17cab5446513d65f205e8c
|
data/CHANGELOG.md
CHANGED
data/ext/numo/libsvm/libsvmext.c
CHANGED
@@ -505,6 +505,8 @@ VALUE load_svm_model(VALUE self, VALUE filename)
|
|
505
505
|
rb_ary_store(res, 0, param_hash);
|
506
506
|
rb_ary_store(res, 1, model_hash);
|
507
507
|
|
508
|
+
RB_GC_GUARD(filename);
|
509
|
+
|
508
510
|
return res;
|
509
511
|
}
|
510
512
|
|
@@ -539,6 +541,8 @@ VALUE save_svm_model(VALUE self, VALUE filename, VALUE param_hash, VALUE model_h
|
|
539
541
|
return Qfalse;
|
540
542
|
}
|
541
543
|
|
544
|
+
RB_GC_GUARD(filename);
|
545
|
+
|
542
546
|
return Qtrue;
|
543
547
|
}
|
544
548
|
|
@@ -35,13 +35,13 @@ struct svm_parameter* rb_hash_to_svm_parameter(VALUE param_hash)
|
|
35
35
|
param->weight_label = NULL;
|
36
36
|
if (!NIL_P(el)) {
|
37
37
|
param->weight_label = ALLOC_N(int, param->nr_weight);
|
38
|
-
memcpy(param->weight_label, (int32_t*)na_get_pointer_for_read(el), param->nr_weight);
|
38
|
+
memcpy(param->weight_label, (int32_t*)na_get_pointer_for_read(el), param->nr_weight * sizeof(int32_t));
|
39
39
|
}
|
40
40
|
el = rb_hash_aref(param_hash, ID2SYM(rb_intern("weight")));
|
41
41
|
param->weight = NULL;
|
42
42
|
if (!NIL_P(el)) {
|
43
43
|
param->weight = ALLOC_N(double, param->nr_weight);
|
44
|
-
memcpy(param->weight, (double*)na_get_pointer_for_read(el), param->nr_weight);
|
44
|
+
memcpy(param->weight, (double*)na_get_pointer_for_read(el), param->nr_weight * sizeof(double));
|
45
45
|
}
|
46
46
|
return param;
|
47
47
|
}
|
data/lib/numo/libsvm/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: numo-libsvm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- yoshoku
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-01-
|
11
|
+
date: 2021-01-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: numo-narray
|
@@ -144,7 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
144
144
|
- !ruby/object:Gem::Version
|
145
145
|
version: '0'
|
146
146
|
requirements: []
|
147
|
-
rubygems_version: 3.
|
147
|
+
rubygems_version: 3.2.3
|
148
148
|
signing_key:
|
149
149
|
specification_version: 4
|
150
150
|
summary: Numo::Libsvm is a Ruby gem binding to the LIBSVM library. Numo::Libsvm makes
|