[Pkg-octave-commit] r952 - octave-epstk/trunk/debian/patches

Rafael Laboissiere rafael at alioth.debian.org
Wed May 30 14:21:13 UTC 2007


Author: rafael
Date: 2007-05-30 14:21:13 +0000 (Wed, 30 May 2007)
New Revision: 952

Added:
   octave-epstk/trunk/debian/patches/01_add-plotdecimate.patch
   octave-epstk/trunk/debian/patches/02_axis-value-labels.patch
   octave-epstk/trunk/debian/patches/03_psd-path.patch
   octave-epstk/trunk/debian/patches/04_source-etc-epstk-conf.patch
Removed:
   octave-epstk/trunk/debian/patches/50_add_plotdecimate.patch
   octave-epstk/trunk/debian/patches/50_axis-value-labels.patch
   octave-epstk/trunk/debian/patches/50_psd-path.patch
   octave-epstk/trunk/debian/patches/60_source-etc-epstk-conf.patch
Modified:
   octave-epstk/trunk/debian/patches/README
Log:
Renumbered patches, such that they are in natural order (01, 02, 03,
...).  I do no see why the previous scheme (50, 60, ...) could be more
advantageous.


Copied: octave-epstk/trunk/debian/patches/01_add-plotdecimate.patch (from rev 928, octave-epstk/trunk/debian/patches/50_add_plotdecimate.patch)
===================================================================
--- octave-epstk/trunk/debian/patches/01_add-plotdecimate.patch	                        (rev 0)
+++ octave-epstk/trunk/debian/patches/01_add-plotdecimate.patch	2007-05-30 14:21:13 UTC (rev 952)
@@ -0,0 +1,138 @@
+diff -Nur epstk21/m/plotdecimate.m epstk21.new/m/plotdecimate.m
+--- epstk21/m/plotdecimate.m	1970-01-01 01:00:00.000000000 +0100
++++ epstk21.new/m/plotdecimate.m	2006-08-12 20:10:18.330740520 +0200
+@@ -0,0 +1,134 @@
++## Copyright © 2006  Francesco Potortì
++##
++## This program is free software; you can redistribute it and/or modify
++## it under the terms of the GNU General Public License as published by
++## the Free Software Foundation; either version 2 of the License, or
++## (at your option) any later version.
++##
++## This program is distributed in the hope that it will be useful,
++## but WITHOUT ANY WARRANTY; without even the implied warranty of
++## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++## GNU General Public License for more details.
++##
++## You should have received a copy of the GNU General Public License
++## along with this program; if not, write to the Free Software Foundation,
++## Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA.
++
++## -*- texinfo -*-
++## @deftypefn {Function File} {} plotdecimate (@var{P})
++## @deftypefnx {Function File} {} plotdecimate (@var{P}, @var{so})
++## @deftypefnx {Function File} {} plotdecimate (@var{P}, @var{so}, @var{res})
++##
++## Optimise plot data by removing redundant points and segments
++##
++## The first parameter @var{P} is a two-column matrix to be plotted as X and
++## Y coordinates.   The second optional argument @var{so} disables segment
++## optimisation when set to @var{false} (default is @var{true}). The third
++## optional argument @var{res} is the size of the largest error on the plot:
++## if it is a scalar, it is meant relative to the range of X and Y values
++## (default 1e-3); if it is a 2x1 array, it contains the absolute errors for
++## X and Y.  Returns a two-column matrix containing a subset of the rows of
++## @var{P}. A line plot of @var{P} has the same appearance as a line plot of
++## the output, with errors smaller than @var{res}.  When creating point
++## plots, set @var{so} to @var{false}.
++## @end deftypefn
++
++## Author: Francesco Potortì <Potorti at isti.cnr.it>
++## $Revision: 2.7 $
++## Usage: plotdecimate(P[, so[, res]])
++## Description: Optimise plot data by removing redundant points and segments
++
++function C = plotdecimate (P, so, res)
++
++  if (!ismatrix(P) || columns(P) != 2)
++    error("P must be a matrix with two columns");
++  endif
++  if (nargin < 2)
++    so = true;			# do segment optimisation
++  endif
++  if (nargin < 3)
++    res = 1e-3;			# default resolution is 1000 dots/axis
++  endif
++
++  ## Slack: admissible error on coordinates on the output plot
++  if (isscalar(res))
++    if (res <= 0)
++      error("res must be positive");
++    endif
++    E = range(P)' * res;	# build error vector using range of data
++  elseif (ismatrix(res))
++    if (!all(size(res) == [2 1]) || any(res <= 0))
++      error("res must be a 2x1 matrix with positive values");
++    endif
++    E = res;			# take error vector as it is
++  else
++    error("res should be a scalar or matrix");
++  endif
++
++  if (rows(P) < 3)
++    C = P;
++    return;			# nothing to do
++  endif
++  P ./= repmat(E',rows(P),1);	# normalize P
++  rot = [0,-1;1,0];		# rotate a vector pi/4 anticlockwise
++
++  ## Iteratively remove points too near to the previous point
++  while (1)
++    V = [true; sumsq(diff(P),2) > 1]; # points far from the previous ones
++    if (all(V)) break; endif
++    V = [true; diff(V) >= 0];	# identify the sequence leaders
++    P = P(V,:);			# remove them
++  endwhile
++
++  ## Remove points laying near to a segment: for each segment R->S, build a
++  ## unitary-lenght projection vector D perpendicular to R->S, and project
++  ## R->T over D to compute the distance ot T from R->S.
++  if (so)			# segment optimisation
++    ## For each segment, r and s are its extremes
++    r = 1; R = P(1,:)';		# start of segment
++    s = 2; S = P(2,:)';		# end of the segment
++    rebuild = true;		# build first projection vector
++
++    for t = 3:rows(P)
++      if (rebuild)		# build projection vector
++	D = rot*(S-R)/sqrt(sumsq(S-R)); # projection vector for distance
++	rebuild = false;	# keep current projection vector
++      endif
++
++      T = P(t,:)';		# next point
++
++      if (abs(sum((T-R).*D)) < 1 # T is aligned
++	  && sum((T-R).*(S-R)) > 0) # going forward
++	V(s) = false;		# do not plot s
++      else			# set a new segment
++	r = s; R = S;		# new start of segment
++	rebuild = true;		# rebuild projection vector
++      endif
++      s = t; S = T;		# new end of segment
++    endfor
++  endif
++
++  C = P(V,:) .* repmat(E',sum(V),1); # denormalize P
++endfunction
++
++%!test
++%! x = [ 0 1 2 3 4 8 8 8 8 8 9 ]';
++%! y = [ 0 1 1 1 1 1 1 2 3 4 5 ]';
++%!
++%! x1 = [0 1 8 8 9]';
++%! y1 = [0 1 1 4 5]';
++%!   # optimised for segment plot
++%!
++%! x2 = [ 0 1 2 3 4 8 8 8 8 9 ]';
++%! y2 = [ 0 1 1 1 1 1 2 3 4 5 ]';
++%!   # double points removed
++%!
++%! P = [x,y];
++%!   # Original
++%! P1 = [x1, y1];
++%!   # optimised segments
++%! P2 = [x2, y2];
++%!   # double points removed
++%!
++%! assert(plotdecimate(P), P1);
++%! assert(plotdecimate(P, false), P2);

Copied: octave-epstk/trunk/debian/patches/02_axis-value-labels.patch (from rev 928, octave-epstk/trunk/debian/patches/50_axis-value-labels.patch)
===================================================================
--- octave-epstk/trunk/debian/patches/02_axis-value-labels.patch	                        (rev 0)
+++ octave-epstk/trunk/debian/patches/02_axis-value-labels.patch	2007-05-30 14:21:13 UTC (rev 952)
@@ -0,0 +1,26 @@
+--- octave-epstk-2.0.2.orig/m/escalexy.m
++++ octave-epstk-2.0.2/m/escalexy.m
+@@ -62,7 +62,7 @@
+   if isstr(vForm)
+     valueForm=vForm;
+   else
+-    if vForm==0  
++    if isscalar (vForm) && vForm==0  
+       expo=-log10(valueStep*signOfDelta);
+       if rem(expo,1)>0
+         expo=expo+1;
+@@ -128,6 +128,14 @@
+           valueCurrent=0;
+         end
+         fprintf(epsFile,moveValueForm);
++	 if iscell (vForm)
++	   valueForm = '%s';
++	   if size (vForm, 1) >= currentLabel
++	     valueCurrent = vForm {currentLabel++};
++	   else
++	     currentValue = ' ';
++	   end
++        end
+         valueStr=sprintf(valueForm,valueCurrent);
+         fprintf(epsFile,showForm,valueStr);
+       end

Copied: octave-epstk/trunk/debian/patches/03_psd-path.patch (from rev 928, octave-epstk/trunk/debian/patches/50_psd-path.patch)
===================================================================
--- octave-epstk/trunk/debian/patches/03_psd-path.patch	                        (rev 0)
+++ octave-epstk/trunk/debian/patches/03_psd-path.patch	2007-05-30 14:21:13 UTC (rev 952)
@@ -0,0 +1,33 @@
+--- octave-epstk-2.0.2.orig/m/ftria-center.psd
++++ octave-epstk-2.0.2/m/ftria-center.psd
+@@ -0,0 +1,13 @@
++% -*- postscript -*-
++/mm {2.83 mul} def
++/height {8.6603 mm} def
++/width {10 mm} def
++%draw filled triangle
++newpath
++width 2 div neg height 3 div neg 2 copy moveto
++0 height 3 div 2 mul lineto
++width 2 div height 3 div neg lineto lineto
++closepath
++fill
++stroke
++
+--- octave-epstk-2.0.2.orig/m/tria-center.psd
++++ octave-epstk-2.0.2/m/tria-center.psd
+@@ -0,0 +1,13 @@
++% -*- postscript -*-
++/mm {2.83 mul} def
++/height {8.6603 mm} def
++/width {10 mm} def
++/lineWidth {0.2 mm} def
++%draw triangle
++newpath
++30 mm 30 mm moveto
++%width 2 div neg height 3 div neg 2 copy moveto
++0 height 3 div 2 mul lineto
++width 2 div height 3 div neg lineto lineto
++closepath
++stroke
++
\ No newline at end of file

Copied: octave-epstk/trunk/debian/patches/04_source-etc-epstk-conf.patch (from rev 950, octave-epstk/trunk/debian/patches/60_source-etc-epstk-conf.patch)
===================================================================
--- octave-epstk/trunk/debian/patches/04_source-etc-epstk-conf.patch	                        (rev 0)
+++ octave-epstk/trunk/debian/patches/04_source-etc-epstk-conf.patch	2007-05-30 14:21:13 UTC (rev 952)
@@ -0,0 +1,24 @@
+--- octave-epstk-2.1.orig/m/eglobpar.m  2006-08-16 15:10:23.662736944 +0200
++++ octave-epstk-2.1/m/eglobpar.m      2006-08-16 15:11:11.049533056 +0200
+@@ -1,4 +1,5 @@
+ global ...
++eConfigFile...
+ ePath...
+ ePsdPath...
+ eDocUrl...
+diff -Nur epstk22/m/einit.m epstk22.new/m/einit.m
+--- epstk22/m/einit.m	2007-05-21 11:48:37.000000000 +0200
++++ epstk22.new/m/einit.m	2007-05-23 12:12:59.000000000 +0200
+@@ -345,10 +345,10 @@
+ 
+ % read config-file on octave/linux systems
+ if exist('matlabpath')~=5
+-  if exist('eConfigFile')~=2
++  if exist('eConfigFile')~=1 || isempty(eConfigFile)
+     eConfigFile='/etc/epstk.conf';
+   end
+-  if exist('eConfigFile')~=2
++  if exist(eConfigFile)==2
+     source(eConfigFile); 
+   end
+ end

Deleted: octave-epstk/trunk/debian/patches/50_add_plotdecimate.patch
===================================================================
--- octave-epstk/trunk/debian/patches/50_add_plotdecimate.patch	2007-05-30 13:08:17 UTC (rev 951)
+++ octave-epstk/trunk/debian/patches/50_add_plotdecimate.patch	2007-05-30 14:21:13 UTC (rev 952)
@@ -1,138 +0,0 @@
-diff -Nur epstk21/m/plotdecimate.m epstk21.new/m/plotdecimate.m
---- epstk21/m/plotdecimate.m	1970-01-01 01:00:00.000000000 +0100
-+++ epstk21.new/m/plotdecimate.m	2006-08-12 20:10:18.330740520 +0200
-@@ -0,0 +1,134 @@
-+## Copyright © 2006  Francesco Potortì
-+##
-+## This program is free software; you can redistribute it and/or modify
-+## it under the terms of the GNU General Public License as published by
-+## the Free Software Foundation; either version 2 of the License, or
-+## (at your option) any later version.
-+##
-+## This program is distributed in the hope that it will be useful,
-+## but WITHOUT ANY WARRANTY; without even the implied warranty of
-+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+## GNU General Public License for more details.
-+##
-+## You should have received a copy of the GNU General Public License
-+## along with this program; if not, write to the Free Software Foundation,
-+## Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301, USA.
-+
-+## -*- texinfo -*-
-+## @deftypefn {Function File} {} plotdecimate (@var{P})
-+## @deftypefnx {Function File} {} plotdecimate (@var{P}, @var{so})
-+## @deftypefnx {Function File} {} plotdecimate (@var{P}, @var{so}, @var{res})
-+##
-+## Optimise plot data by removing redundant points and segments
-+##
-+## The first parameter @var{P} is a two-column matrix to be plotted as X and
-+## Y coordinates.   The second optional argument @var{so} disables segment
-+## optimisation when set to @var{false} (default is @var{true}). The third
-+## optional argument @var{res} is the size of the largest error on the plot:
-+## if it is a scalar, it is meant relative to the range of X and Y values
-+## (default 1e-3); if it is a 2x1 array, it contains the absolute errors for
-+## X and Y.  Returns a two-column matrix containing a subset of the rows of
-+## @var{P}. A line plot of @var{P} has the same appearance as a line plot of
-+## the output, with errors smaller than @var{res}.  When creating point
-+## plots, set @var{so} to @var{false}.
-+## @end deftypefn
-+
-+## Author: Francesco Potortì <Potorti at isti.cnr.it>
-+## $Revision: 2.7 $
-+## Usage: plotdecimate(P[, so[, res]])
-+## Description: Optimise plot data by removing redundant points and segments
-+
-+function C = plotdecimate (P, so, res)
-+
-+  if (!ismatrix(P) || columns(P) != 2)
-+    error("P must be a matrix with two columns");
-+  endif
-+  if (nargin < 2)
-+    so = true;			# do segment optimisation
-+  endif
-+  if (nargin < 3)
-+    res = 1e-3;			# default resolution is 1000 dots/axis
-+  endif
-+
-+  ## Slack: admissible error on coordinates on the output plot
-+  if (isscalar(res))
-+    if (res <= 0)
-+      error("res must be positive");
-+    endif
-+    E = range(P)' * res;	# build error vector using range of data
-+  elseif (ismatrix(res))
-+    if (!all(size(res) == [2 1]) || any(res <= 0))
-+      error("res must be a 2x1 matrix with positive values");
-+    endif
-+    E = res;			# take error vector as it is
-+  else
-+    error("res should be a scalar or matrix");
-+  endif
-+
-+  if (rows(P) < 3)
-+    C = P;
-+    return;			# nothing to do
-+  endif
-+  P ./= repmat(E',rows(P),1);	# normalize P
-+  rot = [0,-1;1,0];		# rotate a vector pi/4 anticlockwise
-+
-+  ## Iteratively remove points too near to the previous point
-+  while (1)
-+    V = [true; sumsq(diff(P),2) > 1]; # points far from the previous ones
-+    if (all(V)) break; endif
-+    V = [true; diff(V) >= 0];	# identify the sequence leaders
-+    P = P(V,:);			# remove them
-+  endwhile
-+
-+  ## Remove points laying near to a segment: for each segment R->S, build a
-+  ## unitary-lenght projection vector D perpendicular to R->S, and project
-+  ## R->T over D to compute the distance ot T from R->S.
-+  if (so)			# segment optimisation
-+    ## For each segment, r and s are its extremes
-+    r = 1; R = P(1,:)';		# start of segment
-+    s = 2; S = P(2,:)';		# end of the segment
-+    rebuild = true;		# build first projection vector
-+
-+    for t = 3:rows(P)
-+      if (rebuild)		# build projection vector
-+	D = rot*(S-R)/sqrt(sumsq(S-R)); # projection vector for distance
-+	rebuild = false;	# keep current projection vector
-+      endif
-+
-+      T = P(t,:)';		# next point
-+
-+      if (abs(sum((T-R).*D)) < 1 # T is aligned
-+	  && sum((T-R).*(S-R)) > 0) # going forward
-+	V(s) = false;		# do not plot s
-+      else			# set a new segment
-+	r = s; R = S;		# new start of segment
-+	rebuild = true;		# rebuild projection vector
-+      endif
-+      s = t; S = T;		# new end of segment
-+    endfor
-+  endif
-+
-+  C = P(V,:) .* repmat(E',sum(V),1); # denormalize P
-+endfunction
-+
-+%!test
-+%! x = [ 0 1 2 3 4 8 8 8 8 8 9 ]';
-+%! y = [ 0 1 1 1 1 1 1 2 3 4 5 ]';
-+%!
-+%! x1 = [0 1 8 8 9]';
-+%! y1 = [0 1 1 4 5]';
-+%!   # optimised for segment plot
-+%!
-+%! x2 = [ 0 1 2 3 4 8 8 8 8 9 ]';
-+%! y2 = [ 0 1 1 1 1 1 2 3 4 5 ]';
-+%!   # double points removed
-+%!
-+%! P = [x,y];
-+%!   # Original
-+%! P1 = [x1, y1];
-+%!   # optimised segments
-+%! P2 = [x2, y2];
-+%!   # double points removed
-+%!
-+%! assert(plotdecimate(P), P1);
-+%! assert(plotdecimate(P, false), P2);

Deleted: octave-epstk/trunk/debian/patches/50_axis-value-labels.patch
===================================================================
--- octave-epstk/trunk/debian/patches/50_axis-value-labels.patch	2007-05-30 13:08:17 UTC (rev 951)
+++ octave-epstk/trunk/debian/patches/50_axis-value-labels.patch	2007-05-30 14:21:13 UTC (rev 952)
@@ -1,26 +0,0 @@
---- octave-epstk-2.0.2.orig/m/escalexy.m
-+++ octave-epstk-2.0.2/m/escalexy.m
-@@ -62,7 +62,7 @@
-   if isstr(vForm)
-     valueForm=vForm;
-   else
--    if vForm==0  
-+    if isscalar (vForm) && vForm==0  
-       expo=-log10(valueStep*signOfDelta);
-       if rem(expo,1)>0
-         expo=expo+1;
-@@ -128,6 +128,14 @@
-           valueCurrent=0;
-         end
-         fprintf(epsFile,moveValueForm);
-+	 if iscell (vForm)
-+	   valueForm = '%s';
-+	   if size (vForm, 1) >= currentLabel
-+	     valueCurrent = vForm {currentLabel++};
-+	   else
-+	     currentValue = ' ';
-+	   end
-+        end
-         valueStr=sprintf(valueForm,valueCurrent);
-         fprintf(epsFile,showForm,valueStr);
-       end

Deleted: octave-epstk/trunk/debian/patches/50_psd-path.patch
===================================================================
--- octave-epstk/trunk/debian/patches/50_psd-path.patch	2007-05-30 13:08:17 UTC (rev 951)
+++ octave-epstk/trunk/debian/patches/50_psd-path.patch	2007-05-30 14:21:13 UTC (rev 952)
@@ -1,33 +0,0 @@
---- octave-epstk-2.0.2.orig/m/ftria-center.psd
-+++ octave-epstk-2.0.2/m/ftria-center.psd
-@@ -0,0 +1,13 @@
-+% -*- postscript -*-
-+/mm {2.83 mul} def
-+/height {8.6603 mm} def
-+/width {10 mm} def
-+%draw filled triangle
-+newpath
-+width 2 div neg height 3 div neg 2 copy moveto
-+0 height 3 div 2 mul lineto
-+width 2 div height 3 div neg lineto lineto
-+closepath
-+fill
-+stroke
-+
---- octave-epstk-2.0.2.orig/m/tria-center.psd
-+++ octave-epstk-2.0.2/m/tria-center.psd
-@@ -0,0 +1,13 @@
-+% -*- postscript -*-
-+/mm {2.83 mul} def
-+/height {8.6603 mm} def
-+/width {10 mm} def
-+/lineWidth {0.2 mm} def
-+%draw triangle
-+newpath
-+30 mm 30 mm moveto
-+%width 2 div neg height 3 div neg 2 copy moveto
-+0 height 3 div 2 mul lineto
-+width 2 div height 3 div neg lineto lineto
-+closepath
-+stroke
-+
\ No newline at end of file

Deleted: octave-epstk/trunk/debian/patches/60_source-etc-epstk-conf.patch
===================================================================
--- octave-epstk/trunk/debian/patches/60_source-etc-epstk-conf.patch	2007-05-30 13:08:17 UTC (rev 951)
+++ octave-epstk/trunk/debian/patches/60_source-etc-epstk-conf.patch	2007-05-30 14:21:13 UTC (rev 952)
@@ -1,24 +0,0 @@
---- octave-epstk-2.1.orig/m/eglobpar.m  2006-08-16 15:10:23.662736944 +0200
-+++ octave-epstk-2.1/m/eglobpar.m      2006-08-16 15:11:11.049533056 +0200
-@@ -1,4 +1,5 @@
- global ...
-+eConfigFile...
- ePath...
- ePsdPath...
- eDocUrl...
-diff -Nur epstk22/m/einit.m epstk22.new/m/einit.m
---- epstk22/m/einit.m	2007-05-21 11:48:37.000000000 +0200
-+++ epstk22.new/m/einit.m	2007-05-23 12:12:59.000000000 +0200
-@@ -345,10 +345,10 @@
- 
- % read config-file on octave/linux systems
- if exist('matlabpath')~=5
--  if exist('eConfigFile')~=2
-+  if exist('eConfigFile')~=1 || isempty(eConfigFile)
-     eConfigFile='/etc/epstk.conf';
-   end
--  if exist('eConfigFile')~=2
-+  if exist(eConfigFile)==2
-     source(eConfigFile); 
-   end
- end

Modified: octave-epstk/trunk/debian/patches/README
===================================================================
--- octave-epstk/trunk/debian/patches/README	2007-05-30 13:08:17 UTC (rev 951)
+++ octave-epstk/trunk/debian/patches/README	2007-05-30 14:21:13 UTC (rev 952)
@@ -1,15 +1,18 @@
-50_axis-value-labels
+01_add-plotdecimate
   author: Rafael Laboissiere <rafael at debian.org>
+  description: Add Francesco Potortì's plotdecimate function, useful for
+               data containing NaN
+
+02_axis-value-labels
+  author: Rafael Laboissiere <rafael at debian.org>
   description: Allow arbitrary labels to be plotted at axis tics
 
-50_psd-path
+03_psd-path
   author: Rafael Laboissiere <rafael at debian.org>
   description: Allow PSD files to be found in the path defined by ePsdPath;
                also, defines two new centered symbols ftria-center and
                tria-center
 
-50_source-etc-epstk-conf
+04_source-etc-epstk-conf
   author: Rafael Laboissiere <rafael at debian.org>
   description: Source /etc/epstk.conf in einit.m
-
-




More information about the Pkg-octave-commit mailing list