1 |
bicatali 10/10/03 23:45:04 |
2 |
|
3 |
Added: octave-3.2.4-normal-marker-size.patch |
4 |
octave-3.2.4-filter-empty-vector.patch |
5 |
octave-3.2.4-addpath.patch |
6 |
octave-3.2.4-imshow.patch |
7 |
octave-3.2.4-no-helvetica.patch |
8 |
octave-3.2.4-interp2.patch |
9 |
Log: |
10 |
Added a few patches from upstream and debian. Should pass tests now. |
11 |
|
12 |
(Portage version: 2.2_rc88/cvs/Linux x86_64) |
13 |
|
14 |
Revision Changes Path |
15 |
1.1 sci-mathematics/octave/files/octave-3.2.4-normal-marker-size.patch |
16 |
|
17 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-mathematics/octave/files/octave-3.2.4-normal-marker-size.patch?rev=1.1&view=markup |
18 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-mathematics/octave/files/octave-3.2.4-normal-marker-size.patch?rev=1.1&content-type=text/plain |
19 |
|
20 |
Index: octave-3.2.4-normal-marker-size.patch |
21 |
=================================================================== |
22 |
Revert the symbol markers in plots to their normal size. Thanks to |
23 |
Francesco Potorti for the patch. |
24 |
|
25 |
-- Rafael Laboissiere <rafael@××××××.org> Tue, 24 Feb 2009 11:40:01 +0100 |
26 |
|
27 |
--- a/scripts/plot/__go_draw_axes__.m |
28 |
+++ b/scripts/plot/__go_draw_axes__.m |
29 |
@@ -689,7 +689,7 @@ |
30 |
usingclause{data_idx} = sprintf ("record=%d", numel (obj.xdata)); |
31 |
|
32 |
if (isfield (obj, "markersize")) |
33 |
- mdat = obj.markersize / 3; |
34 |
+ mdat = obj.markersize / 6; |
35 |
endif |
36 |
|
37 |
if (isfield (obj, "edgecolor")) |
38 |
@@ -1471,7 +1471,7 @@ |
39 |
endif |
40 |
|
41 |
if (isfield (obj, "markersize")) |
42 |
- fprintf (plot_stream, " pointsize %f", obj.markersize / 3); |
43 |
+ fprintf (plot_stream, " pointsize %f", obj.markersize / 6); |
44 |
found_style = true; |
45 |
endif |
46 |
else |
47 |
|
48 |
|
49 |
|
50 |
1.1 sci-mathematics/octave/files/octave-3.2.4-filter-empty-vector.patch |
51 |
|
52 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-mathematics/octave/files/octave-3.2.4-filter-empty-vector.patch?rev=1.1&view=markup |
53 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-mathematics/octave/files/octave-3.2.4-filter-empty-vector.patch?rev=1.1&content-type=text/plain |
54 |
|
55 |
Index: octave-3.2.4-filter-empty-vector.patch |
56 |
=================================================================== |
57 |
From: "John W. Eaton" <jwe@××××××.org> |
58 |
Subject: Don't crash on filtering an empty vector |
59 |
Origin: upstream, http://hg.savannah.gnu.org/hgweb/octave/rev/a277ba5da4dc |
60 |
Bug-Debian: http://bugs.debian.org/567975 |
61 |
|
62 |
--- a/src/DLD-FUNCTIONS/filter.cc |
63 |
+++ b/src/DLD-FUNCTIONS/filter.cc |
64 |
@@ -117,6 +117,9 @@ |
65 |
} |
66 |
} |
67 |
|
68 |
+ if (x_len == 0) |
69 |
+ return x; |
70 |
+ |
71 |
if (norm != static_cast<T>(1.0)) |
72 |
{ |
73 |
a = a / norm; |
74 |
|
75 |
|
76 |
|
77 |
1.1 sci-mathematics/octave/files/octave-3.2.4-addpath.patch |
78 |
|
79 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-mathematics/octave/files/octave-3.2.4-addpath.patch?rev=1.1&view=markup |
80 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-mathematics/octave/files/octave-3.2.4-addpath.patch?rev=1.1&content-type=text/plain |
81 |
|
82 |
Index: octave-3.2.4-addpath.patch |
83 |
=================================================================== |
84 |
From: "Thomas Weber" <tweber@××××××.org> |
85 |
Subject: Don't crash on calling addpath('./') |
86 |
Description: Octave 3.2 crashes when calling something like |
87 |
echo "addpath('./'); addpath('./')" | octave |
88 |
This patch originates from a larger patch from upstreams's development version. |
89 |
Origin: partly upstream, http://hg.savannah.gnu.org/hgweb/octave/rev/4acae5e46738 |
90 |
Bug-Debian: http://bugs.debian.org/592517 |
91 |
Applied-Upstream: http://hg.savannah.gnu.org/hgweb/octave/rev/4acae5e46738 |
92 |
|
93 |
--- a/src/load-path.cc |
94 |
+++ b/src/load-path.cc |
95 |
@@ -653,8 +653,6 @@ |
96 |
|
97 |
if (i != dir_info_list.end ()) |
98 |
move (i, false); |
99 |
- else |
100 |
- panic_impossible (); |
101 |
} |
102 |
|
103 |
void |
104 |
|
105 |
|
106 |
|
107 |
1.1 sci-mathematics/octave/files/octave-3.2.4-imshow.patch |
108 |
|
109 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-mathematics/octave/files/octave-3.2.4-imshow.patch?rev=1.1&view=markup |
110 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-mathematics/octave/files/octave-3.2.4-imshow.patch?rev=1.1&content-type=text/plain |
111 |
|
112 |
Index: octave-3.2.4-imshow.patch |
113 |
=================================================================== |
114 |
From: Rik <octave@××××××××××××.com> |
115 |
Subject: Scale image point color according to colormap. |
116 |
|
117 |
Origin: upstream, http://hg.savannah.gnu.org/hgweb/octave/rev/bc4eb29e0cb4 |
118 |
Bug: http://savannah.gnu.org/bugs/?29926 |
119 |
Bug-Debian: http://bugs.debian.org/581998 |
120 |
|
121 |
--- a/scripts/image/imshow.m |
122 |
+++ b/scripts/image/imshow.m |
123 |
@@ -64,7 +64,6 @@ |
124 |
|
125 |
## Get the image. |
126 |
if (ischar (im)) |
127 |
- ## Eventually, this should be imread. |
128 |
[im, map] = imread (im); |
129 |
indexed = true; |
130 |
colormap (map); |
131 |
@@ -163,7 +162,8 @@ |
132 |
if (true_color || indexed) |
133 |
tmp = image ([], [], im); |
134 |
else |
135 |
- tmp = image (round ((rows (colormap ()) - 1) * im)); |
136 |
+ tmp = image (im); |
137 |
+ set (tmp, "cdatamapping", "scaled"); |
138 |
endif |
139 |
set (gca (), "visible", "off"); |
140 |
axis ("image"); |
141 |
|
142 |
|
143 |
|
144 |
1.1 sci-mathematics/octave/files/octave-3.2.4-no-helvetica.patch |
145 |
|
146 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-mathematics/octave/files/octave-3.2.4-no-helvetica.patch?rev=1.1&view=markup |
147 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-mathematics/octave/files/octave-3.2.4-no-helvetica.patch?rev=1.1&content-type=text/plain |
148 |
|
149 |
Index: octave-3.2.4-no-helvetica.patch |
150 |
=================================================================== |
151 |
Don't set Helvetica as default font, it's not available as TrueType |
152 |
font. Fixes Bug#477688. |
153 |
|
154 |
-- Rafael Laboissiere <rafael@××××××.org> Sat, 19 Jul 2008 10:27:26 +0200 |
155 |
|
156 |
--- a/scripts/plot/__go_draw_axes__.m |
157 |
+++ b/scripts/plot/__go_draw_axes__.m |
158 |
@@ -1751,7 +1751,7 @@ |
159 |
|
160 |
function [f, s, fnt, it, bld] = get_fontname_and_size (t) |
161 |
if (isempty (t.fontname)) |
162 |
- fnt = "Helvetica"; |
163 |
+ fnt = "*"; |
164 |
else |
165 |
fnt = t.fontname; |
166 |
endif |
167 |
@@ -1789,7 +1789,7 @@ |
168 |
if (strcmp (fld, "string")) |
169 |
[f, s, fnt, it, bld] = get_fontname_and_size (obj); |
170 |
else |
171 |
- f = "Helvetica"; |
172 |
+ f = "*"; |
173 |
s = 10; |
174 |
fnt = f; |
175 |
it = false; |
176 |
|
177 |
|
178 |
|
179 |
1.1 sci-mathematics/octave/files/octave-3.2.4-interp2.patch |
180 |
|
181 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-mathematics/octave/files/octave-3.2.4-interp2.patch?rev=1.1&view=markup |
182 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-mathematics/octave/files/octave-3.2.4-interp2.patch?rev=1.1&content-type=text/plain |
183 |
|
184 |
Index: octave-3.2.4-interp2.patch |
185 |
=================================================================== |
186 |
From: various upstream authors authors |
187 |
Description: Implement bicubic interpolation correctly |
188 |
This patch fixes a bug triggered by octave-image's test suite. |
189 |
|
190 |
Origin: upstream, http://hg.savannah.gnu.org/hgweb/octave/file/62bb59f927b1/scripts/general/interp2.m |
191 |
Bug-Debian: http://bugs.debian.org/582276 |
192 |
|
193 |
--- a/scripts/general/interp2.m |
194 |
+++ b/scripts/general/interp2.m |
195 |
@@ -57,7 +57,7 @@ |
196 |
## @item 'linear' |
197 |
## Linear interpolation from nearest neighbors. |
198 |
## @item 'pchip' |
199 |
-## Piece-wise cubic hermite interpolating polynomial (not implemented yet). |
200 |
+## Piece-wise cubic hermite interpolating polynomial. |
201 |
## @item 'cubic' |
202 |
## Cubic interpolation from four nearest neighbors. |
203 |
## @item 'spline' |
204 |
@@ -218,18 +218,21 @@ |
205 |
c = Z(2:zr, 1:(zc - 1)) - a; |
206 |
d = Z(2:zr, 2:zc) - a - b - c; |
207 |
|
208 |
- idx = sub2ind (size (a), yidx, xidx); |
209 |
- |
210 |
## scale XI, YI values to a 1-spaced grid |
211 |
- Xsc = (XI - X(xidx)) ./ (X(xidx + 1) - X(xidx)); |
212 |
- Ysc = (YI - Y(yidx)) ./ (Y(yidx + 1) - Y(yidx)); |
213 |
+ Xsc = (XI - X(xidx)) ./ (diff (X)(xidx)); |
214 |
+ Ysc = (YI - Y(yidx)) ./ (diff (Y)(yidx)); |
215 |
+ |
216 |
+ ## Get 2D index. |
217 |
+ idx = sub2ind (size (a), yidx, xidx); |
218 |
+ ## We can dispose of the 1D indices at this point to save memory. |
219 |
+ clear xidx yidx |
220 |
|
221 |
## apply plane equation |
222 |
ZI = a(idx) + b(idx).*Xsc + c(idx).*Ysc + d(idx).*Xsc.*Ysc; |
223 |
|
224 |
elseif (strcmp (method, "nearest")) |
225 |
- ii = (XI - X(xidx) > X(xidx + 1) - XI); |
226 |
- jj = (YI - Y(yidx) > Y(yidx + 1) - YI); |
227 |
+ ii = (XI - X(xidx) >= X(xidx + 1) - XI); |
228 |
+ jj = (YI - Y(yidx) >= Y(yidx + 1) - YI); |
229 |
idx = sub2ind (size (Z), yidx+jj, xidx+ii); |
230 |
ZI = Z(idx); |
231 |
|
232 |
@@ -339,11 +342,64 @@ |
233 |
|
234 |
## FIXME bicubic/__splinen__ don't handle arbitrary XI, YI |
235 |
if (strcmp (method, "cubic")) |
236 |
- ZI = bicubic (X, Y, Z, XI(1,:), YI(:,1), extrapval); |
237 |
+ if (isgriddata (XI) && isgriddata (YI')) |
238 |
+ ZI = bicubic (X, Y, Z, XI (1, :), YI (:, 1), extrapval); |
239 |
+ elseif (isgriddata (X) && isgriddata (Y')) |
240 |
+ ## Allocate output |
241 |
+ ZI = zeros (size (X)); |
242 |
+ |
243 |
+ ## Find inliers |
244 |
+ inside = !(XI < X (1) | XI > X (end) | YI < Y (1) | YI > Y (end)); |
245 |
+ |
246 |
+ ## Scale XI and YI to match indices of Z |
247 |
+ XI = (columns (Z) - 1) * (XI - X (1)) / (X (end) - X (1)) + 1; |
248 |
+ YI = (rows (Z) - 1) * (YI - Y (1)) / (Y (end) - Y (1)) + 1; |
249 |
+ |
250 |
+ ## Start the real work |
251 |
+ K = floor (XI); |
252 |
+ L = floor (YI); |
253 |
+ |
254 |
+ ## Coefficients |
255 |
+ AY1 = bc ((YI - L + 1)); |
256 |
+ AX1 = bc ((XI - K + 1)); |
257 |
+ AY0 = bc ((YI - L + 0)); |
258 |
+ AX0 = bc ((XI - K + 0)); |
259 |
+ AY_1 = bc ((YI - L - 1)); |
260 |
+ AX_1 = bc ((XI - K - 1)); |
261 |
+ AY_2 = bc ((YI - L - 2)); |
262 |
+ AX_2 = bc ((XI - K - 2)); |
263 |
+ |
264 |
+ ## Perform interpolation |
265 |
+ sz = size(Z); |
266 |
+ ZI = AY_2 .* AX_2 .* Z (sym_sub2ind (sz, L+2, K+2)) ... |
267 |
+ + AY_2 .* AX_1 .* Z (sym_sub2ind (sz, L+2, K+1)) ... |
268 |
+ + AY_2 .* AX0 .* Z (sym_sub2ind (sz, L+2, K)) ... |
269 |
+ + AY_2 .* AX1 .* Z (sym_sub2ind (sz, L+2, K-1)) ... |
270 |
+ + AY_1 .* AX_2 .* Z (sym_sub2ind (sz, L+1, K+2)) ... |
271 |
+ + AY_1 .* AX_1 .* Z (sym_sub2ind (sz, L+1, K+1)) ... |
272 |
+ + AY_1 .* AX0 .* Z (sym_sub2ind (sz, L+1, K)) ... |
273 |
+ + AY_1 .* AX1 .* Z (sym_sub2ind (sz, L+1, K-1)) ... |
274 |
+ + AY0 .* AX_2 .* Z (sym_sub2ind (sz, L, K+2)) ... |
275 |
+ + AY0 .* AX_1 .* Z (sym_sub2ind (sz, L, K+1)) ... |
276 |
+ + AY0 .* AX0 .* Z (sym_sub2ind (sz, L, K)) ... |
277 |
+ + AY0 .* AX1 .* Z (sym_sub2ind (sz, L, K-1)) ... |
278 |
+ + AY1 .* AX_2 .* Z (sym_sub2ind (sz, L-1, K+2)) ... |
279 |
+ + AY1 .* AX_1 .* Z (sym_sub2ind (sz, L-1, K+1)) ... |
280 |
+ + AY1 .* AX0 .* Z (sym_sub2ind (sz, L-1, K)) ... |
281 |
+ + AY1 .* AX1 .* Z (sym_sub2ind (sz, L-1, K-1)); |
282 |
+ ZI (!inside) = extrapval; |
283 |
+ |
284 |
+ else |
285 |
+ error ("interp2: input data must have `meshgrid' format"); |
286 |
+ endif |
287 |
|
288 |
elseif (strcmp (method, "spline")) |
289 |
- ZI = __splinen__ ({Y(:,1).', X(1,:)}, Z, {YI(:,1), XI(1,:)}, extrapval, |
290 |
+ if (isgriddata (XI) && isgriddata (YI')) |
291 |
+ ZI = __splinen__ ({Y(:,1).', X(1,:)}, Z, {YI(:,1), XI(1,:)}, extrapval, |
292 |
"spline"); |
293 |
+ else |
294 |
+ error ("interp2: input data must have `meshgrid' format"); |
295 |
+ endif |
296 |
else |
297 |
error ("interpolation method not recognized"); |
298 |
endif |
299 |
@@ -351,6 +407,38 @@ |
300 |
endif |
301 |
endfunction |
302 |
|
303 |
+function b = isgriddata (X) |
304 |
+ d1 = diff (X, 1, 1); |
305 |
+ d2 = diff (X, 1, 2); |
306 |
+ b = all (d1 (:) == 0) & all (d2 (:) == d2 (1)); |
307 |
+endfunction |
308 |
+ |
309 |
+## Compute the bicubic interpolation coefficients |
310 |
+function o = bc(x) |
311 |
+ x = abs(x); |
312 |
+ o = zeros(size(x)); |
313 |
+ idx1 = (x < 1); |
314 |
+ idx2 = !idx1 & (x < 2); |
315 |
+ o(idx1) = 1 - 2.*x(idx1).^2 + x(idx1).^3; |
316 |
+ o(idx2) = 4 - 8.*x(idx2) + 5.*x(idx2).^2 - x(idx2).^3; |
317 |
+endfunction |
318 |
+ |
319 |
+## This version of sub2ind behaves as if the data was symmetrically padded |
320 |
+function ind = sym_sub2ind(sz, Y, X) |
321 |
+ Y (Y < 1) = 1 - Y (Y < 1); |
322 |
+ while (any (Y (:) > 2 * sz (1))) |
323 |
+ Y (Y > 2 * sz (1)) = round (Y (Y > 2 * sz (1)) / 2); |
324 |
+ endwhile |
325 |
+ Y (Y > sz (1)) = 1 + 2 * sz (1) - Y (Y > sz (1)); |
326 |
+ X (X < 1) = 1 - X (X < 1); |
327 |
+ while (any (X (:) > 2 * sz (2))) |
328 |
+ X (X > 2 * sz (2)) = round (X (X > 2 * sz (2)) / 2); |
329 |
+ endwhile |
330 |
+ X (X > sz (2)) = 1 + 2 * sz (2) - X (X > sz (2)); |
331 |
+ ind = sub2ind(sz, Y, X); |
332 |
+endfunction |
333 |
+ |
334 |
+ |
335 |
%!demo |
336 |
%! A=[13,-1,12;5,4,3;1,6,2]; |
337 |
%! x=[0,1,4]; y=[10,11,12]; |
338 |
@@ -493,3 +581,7 @@ |
339 |
%! assert(interp2(x,y,A,x,y,'linear'), A); |
340 |
%! assert(interp2(x,y,A,x,y,'nearest'), A); |
341 |
|
342 |
+%!test % for Matlab-compatible rounding for 'nearest' |
343 |
+%! X = meshgrid (1:4); |
344 |
+%! assert (interp2 (X, 2.5, 2.5, 'nearest'), 3); |
345 |
+ |