libmf 0.2.3 → 0.2.4
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/libmf/ffi.rb +11 -4
- data/lib/libmf/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: ca5a2bbda585f7e2f57630d20dfb6cf6091ab33e90227edd277c457af7f8dac7
|
4
|
+
data.tar.gz: 3f8a1612c831223e552cf5af4172f31080d297f2e3f059624d66790613333890
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d8cf1bf142c4e365c2b01a10c5e407d331d24d8410f8ee2b262c6ca6c94dfe129c5ac0a3dc6ae97e0739884aaeec9483c39546714975a8e9929c8a63799f15c
|
7
|
+
data.tar.gz: 80356261c846d506160df89424b9f67d070908e1cc1f9c583e83cbbec5b7ebce272acb5146e447dd1394bb7c5d3268bf00837dc0814eb5ccb23d8c23c53efae3
|
data/CHANGELOG.md
CHANGED
data/lib/libmf/ffi.rb
CHANGED
@@ -43,15 +43,22 @@ module Libmf
|
|
43
43
|
:b, :float,
|
44
44
|
:p, :pointer,
|
45
45
|
:q, :pointer
|
46
|
+
|
47
|
+
def self.release(pointer)
|
48
|
+
unless pointer.null?
|
49
|
+
ref = ::FFI::MemoryPointer.new(:pointer).write_pointer(pointer)
|
50
|
+
FFI.mf_destroy_model(ref)
|
51
|
+
end
|
52
|
+
end
|
46
53
|
end
|
47
54
|
|
48
55
|
attach_function :mf_get_default_param, [], Parameter.by_value
|
49
56
|
attach_function :mf_read_problem, [:string], Problem.by_value
|
50
57
|
attach_function :mf_save_model, [Model.by_ref, :string], :int
|
51
|
-
attach_function :mf_load_model, [:string], Model.
|
52
|
-
attach_function :mf_destroy_model, [
|
53
|
-
attach_function :mf_train, [Problem.by_ref, Parameter.by_value], Model.
|
54
|
-
attach_function :mf_train_with_validation, [Problem.by_ref, Problem.by_ref, Parameter.by_value], Model.
|
58
|
+
attach_function :mf_load_model, [:string], Model.auto_ptr
|
59
|
+
attach_function :mf_destroy_model, [:pointer], :void
|
60
|
+
attach_function :mf_train, [Problem.by_ref, Parameter.by_value], Model.auto_ptr
|
61
|
+
attach_function :mf_train_with_validation, [Problem.by_ref, Problem.by_ref, Parameter.by_value], Model.auto_ptr
|
55
62
|
attach_function :mf_predict, [Model.by_ref, :int, :int], :float
|
56
63
|
attach_function :mf_cross_validation, [Problem.by_ref, :int, Parameter.by_value], :double
|
57
64
|
end
|
data/lib/libmf/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: libmf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kane
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-08-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi
|
@@ -64,7 +64,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
64
64
|
- !ruby/object:Gem::Version
|
65
65
|
version: '0'
|
66
66
|
requirements: []
|
67
|
-
rubygems_version: 3.2.
|
67
|
+
rubygems_version: 3.2.22
|
68
68
|
signing_key:
|
69
69
|
specification_version: 4
|
70
70
|
summary: Large-scale sparse matrix factorization for Ruby
|