[Pkg-octave-commit] r2453 - octave-forge-pkgs/octave-ann/trunk/debian/patches

Rafael Laboissiere rafael at alioth.debian.org
Mon Nov 17 10:11:18 UTC 2008


Author: rafael
Date: 2008-11-17 10:11:18 +0000 (Mon, 17 Nov 2008)
New Revision: 2453

Added:
   octave-forge-pkgs/octave-ann/trunk/debian/patches/cope-with-null-args.diff
   octave-forge-pkgs/octave-ann/trunk/debian/patches/remove-own-pts.diff
Modified:
   octave-forge-pkgs/octave-ann/trunk/debian/patches/series
Log:
Add patches


Added: octave-forge-pkgs/octave-ann/trunk/debian/patches/cope-with-null-args.diff
===================================================================
--- octave-forge-pkgs/octave-ann/trunk/debian/patches/cope-with-null-args.diff	                        (rev 0)
+++ octave-forge-pkgs/octave-ann/trunk/debian/patches/cope-with-null-args.diff	2008-11-17 10:11:18 UTC (rev 2453)
@@ -0,0 +1,24 @@
+--- a/src/ann/bindings/ann.i
++++ b/src/ann/bindings/ann.i
+@@ -73,6 +73,21 @@
+   delete [] $3;
+ }
+ 
++// can't process k without nn_idx,dd
++%define annkFRSearch_fix(name)
++%extend name {
++  int annkFRSearch(ANNpoint q,ANNdist sqRad) {
++    return $self->annkFRSearch(q,sqRad);
++  }
++  int annkFRSearch(ANNpoint q,ANNdist sqRad,int k,ANNidxArray nn_idx,ANNdistArray dd,double eps=0.0) {
++    return $self->annkFRSearch(q,sqRad,k,nn_idx,dd,eps);
++  }
++  %ignore annkFRSearch;
++};
++%enddef
++annkFRSearch_fix(ANNbruteForce);
++annkFRSearch_fix(ANNkd_tree);
++
+ // replace (std::ostream& out) with std::cout
+ %typemap(in,numinputs=0) std::ostream& out {
+   $1=&std::cout;

Added: octave-forge-pkgs/octave-ann/trunk/debian/patches/remove-own-pts.diff
===================================================================
--- octave-forge-pkgs/octave-ann/trunk/debian/patches/remove-own-pts.diff	                        (rev 0)
+++ octave-forge-pkgs/octave-ann/trunk/debian/patches/remove-own-pts.diff	2008-11-17 10:11:18 UTC (rev 2453)
@@ -0,0 +1,46 @@
+--- a/src/ann/bindings/ann.i
++++ b/src/ann/bindings/ann.i
+@@ -15,10 +15,10 @@
+ %}
+ 
+ // take matrix in place of (ANNpointArray pa,int n,int dd)
+-%typemap(typecheck,precedence=SWIG_TYPECHECK_INTEGER) (ANNpointArray pa,int n,int dd,bool own_pts) {
++%typemap(typecheck,precedence=SWIG_TYPECHECK_INTEGER) (ANNpointArray pa,int n,int dd) {
+    $1 = (*$input).is_matrix_type() ? 1 : 0;
+ }
+-%typemap(in,numinputs=1) (ANNpointArray pa,int n,int dd,bool own_pts) {
++%typemap(in,numinputs=1) (ANNpointArray pa,int n,int dd) {
+   if (!$input.is_matrix_type()) {
+     error("points must be given by matrix (n x dd)"); SWIG_fail;
+   }
+@@ -29,7 +29,6 @@
+   for (int j=0;j<m.rows();++j)
+     for (int k=0;k<m.cols();++k)
+       $1[j][k]=m(j,k);
+-  $4=true;
+ }
+ 
+ // take vector in place of ANNpoint
+@@ -88,6 +87,22 @@
+ annkFRSearch_fix(ANNbruteForce);
+ annkFRSearch_fix(ANNkd_tree);
+ 
++// free points storage allocated above
++%define delete_pts(name)
++%extend name {
++  ~name() {
++    ANNpointArray pa = $self->thePoints();
++    if (pa)
++      annDeallocPts(pa);
++    delete $self;
++  }
++  %ignore ~name;
++};
++%enddef
++delete_pts(ANNbruteForce);
++delete_pts(ANNkd_tree);
++delete_pts(ANNbd_tree);
++
+ // replace (std::ostream& out) with std::cout
+ %typemap(in,numinputs=0) std::ostream& out {
+   $1=&std::cout;

Modified: octave-forge-pkgs/octave-ann/trunk/debian/patches/series
===================================================================
--- octave-forge-pkgs/octave-ann/trunk/debian/patches/series	2008-11-17 10:10:47 UTC (rev 2452)
+++ octave-forge-pkgs/octave-ann/trunk/debian/patches/series	2008-11-17 10:11:18 UTC (rev 2453)
@@ -1 +1,3 @@
 use-libann-package.diff
+cope-with-null-args.diff
+remove-own-pts.diff




More information about the Pkg-octave-commit mailing list