[libalgorithm-svm-perl] 06/08: Patch to update for libsvm3 because the bundled version used was libsvm2.

Carnë Draug carandraug+dev at gmail.com
Wed Apr 19 20:22:25 UTC 2017


This is an automated email from the git hooks/post-receive script.

carandraug-guest pushed a commit to branch master
in repository libalgorithm-svm-perl.

commit b7058d8ad0a76568caa197857e406252453a6626
Author: Carnë Draug <carandraug+dev at gmail.com>
Date:   Wed Apr 19 20:23:41 2017 +0100

    Patch to update for libsvm3 because the bundled version used was libsvm2.
---
 debian/patches/series               |  1 +
 debian/patches/update-libsvm3.patch | 62 +++++++++++++++++++++++++++++++++++++
 2 files changed, 63 insertions(+)

diff --git a/debian/patches/series b/debian/patches/series
index 4c641fa..311e246 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 remove-3rd-party-libsvm.patch
+update-libsvm3.patch
diff --git a/debian/patches/update-libsvm3.patch b/debian/patches/update-libsvm3.patch
new file mode 100644
index 0000000..27d0f46
--- /dev/null
+++ b/debian/patches/update-libsvm3.patch
@@ -0,0 +1,62 @@
+Description: Update bindings for libsvm3.
+ Upstream makes use of bundled libsvm2 which has been removed on a
+ separate patch.  This patch updates the bindings for libsvm3 which
+ is packaged in Debian.
+ .
+ The libsvm README file states the following:
+ - Function: void svm_free_and_destroy_model(struct svm_model **model_ptr_ptr);
+ .
+    This function frees the memory used by a model and destroys the model
+    structure. It is equivalent to svm_destroy_model, which
+    is deprecated after version 3.0.
+Origin: vendor
+Forwarded: https://rt.cpan.org/Public/Bug/Display.html?id=79106
+Author: Mathieu Bridon <bochecha at fedoraproject.org>
+Last-Update: Tue, 21 Aug 2012 12:14:18 +0800
+
+--- a/bindings.cpp
++++ b/bindings.cpp
+@@ -166,7 +166,7 @@
+ 
+   // Free any old model we have.
+   if(model != NULL) {
+-    svm_destroy_model(model);
++    svm_free_and_destroy_model(&model);
+     model = NULL;
+   }
+ 
+@@ -282,7 +282,7 @@
+   }
+ 
+   if(model != NULL) {
+-    svm_destroy_model(model);
++    svm_free_and_destroy_model(&model);
+     model = NULL;
+   }
+ 
+@@ -357,7 +357,7 @@
+ 	sumyy += y*y;
+ 	sumvy += v*y;
+       }
+-      svm_destroy_model(submodel);
++      svm_free_and_destroy_model(&submodel);
+       // cout << "Mean squared error = %g\n", error/(end-begin));
+       total_error += error;			
+     } else {
+@@ -368,7 +368,7 @@
+ 	double v = svm_predict(submodel,prob->x[j]);
+ 	if(v == prob->y[j]) ++correct;
+       }
+-      svm_destroy_model(submodel);
++      svm_free_and_destroy_model(&submodel);
+       //cout << "Accuracy = " << 100.0*correct/(end-begin) << " (" <<
+       //correct << "/" << (end-begin) << endl;
+       total_correct += correct;
+@@ -423,6 +423,6 @@
+ 
+ SVM::~SVM() {
+ 	if(x_space!=NULL) { free_x_space(); }
+-  if(model != NULL) { svm_destroy_model(model); model=NULL; }
++  if(model != NULL) { svm_free_and_destroy_model(&model); model=NULL; }
+   if(prob != NULL) { free(prob); prob=NULL; }
+ }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libalgorithm-svm-perl.git



More information about the Pkg-perl-cvs-commits mailing list