tomz-libsvm-ruby-swig 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.
- data/README.txt +3 -0
- data/Rakefile +1 -1
- data/ext/extconf.rb +1 -1
- data/ext/svmc_wrap.cxx +2 -2
- data/lib/svm.rb +3 -3
- metadata +1 -1
data/README.txt
CHANGED
@@ -21,6 +21,9 @@ you should run make under the libsvm-2.88 and libsvm-2.88/ruby
|
|
21
21
|
directories to regenerate the executables for your environment.
|
22
22
|
|
23
23
|
== INSTALL:
|
24
|
+
Currently the gem is available on linux only(tested on Ubuntu 8 and Fedora 9/10,
|
25
|
+
and on OS X by danielsdeleo), and you will need g++ installed to compile the
|
26
|
+
native code.
|
24
27
|
|
25
28
|
sudo gem sources -a http://gems.github.com (you only have to do this once)
|
26
29
|
sudo gem install tomz-libsvm-ruby-swig
|
data/Rakefile
CHANGED
@@ -5,7 +5,7 @@ task :default => ["sync_files","make_gem"]
|
|
5
5
|
|
6
6
|
EXT = "ext/svm?.#{Hoe::DLEXT}"
|
7
7
|
|
8
|
-
Hoe.new('libsvm-ruby-swig', '0.2.
|
8
|
+
Hoe.new('libsvm-ruby-swig', '0.2.4') do |p|
|
9
9
|
p.author = 'Tom Zeng'
|
10
10
|
p.email = 'tom.z.zeng@gmail.com'
|
11
11
|
p.url = 'http://www.tomzconsulting.com'
|
data/ext/extconf.rb
CHANGED
data/ext/svmc_wrap.cxx
CHANGED
@@ -4435,11 +4435,11 @@ SWIG_PropagateClientData(void) {
|
|
4435
4435
|
#ifdef __cplusplus
|
4436
4436
|
extern "C"
|
4437
4437
|
#endif
|
4438
|
-
SWIGEXPORT void
|
4438
|
+
SWIGEXPORT void Init_libsvm(void) {
|
4439
4439
|
size_t i;
|
4440
4440
|
|
4441
4441
|
SWIG_InitRuntime();
|
4442
|
-
mSvmc = rb_define_module("
|
4442
|
+
mSvmc = rb_define_module("LibSVM");
|
4443
4443
|
|
4444
4444
|
SWIG_InitializeModule(0);
|
4445
4445
|
for (i = 0; i < swig_module.size; i++) {
|
data/lib/svm.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
require '
|
2
|
-
include
|
1
|
+
require 'libsvm-ruby-swig/libsvm'
|
2
|
+
include LibSVM
|
3
3
|
|
4
4
|
def _int_array(seq)
|
5
5
|
size = seq.size
|
@@ -196,7 +196,7 @@ class Model
|
|
196
196
|
param.gamma = 1.0/prob.maxlen
|
197
197
|
end
|
198
198
|
msg = svm_check_parameter(prob.prob,param.param)
|
199
|
-
raise
|
199
|
+
raise ::ArgumentError, msg if msg
|
200
200
|
@model = svm_train(prob.prob,param.param)
|
201
201
|
end
|
202
202
|
|