[Pkg-octave-commit] [SCM] Debian packaging for octave-symbolic branch, master, updated. debian/1.1.0-1-8-g97d1a89

Rafael Laboissiere rafael at laboissiere.net
Tue Jul 2 14:48:19 UTC 2013


The following commit has been merged in the master branch:
commit 97d1a89224f59ef12171d3c78ec341e33c19b085
Author: Rafael Laboissiere <rafael at laboissiere.net>
Date:   Fri Jun 28 09:54:29 2013 +0200

    Add patches taken from upstream:
    
    + proper-cell-array-reversal.patch
    + store-symbolic-expressions.patch
    + fix-tests-blocks.patch
    + sumterms-return-cell-vector.patch
    + avoid-ex-type-in-assert.patch
    
    Git-Dch: full

diff --git a/debian/patches/avoid-ex-type-in-assert.patch b/debian/patches/avoid-ex-type-in-assert.patch
new file mode 100644
index 0000000..480fe44
--- /dev/null
+++ b/debian/patches/avoid-ex-type-in-assert.patch
@@ -0,0 +1,17 @@
+Description: Avoid the use of ex type in arguments of assert
+ One of the tests in sym2poly.m try to compare cell arrays containing
+ variables of type "ex", but this is not supported in the assert()
+ function.  Use the string representation of the arguments instead,
+ obtained throuhg the disp() function.
+Author: Rafael Laboissiere <rafael at laboissiere.net>
+Forwarded: https://savannah.gnu.org/bugs/?39345
+Last-Update: 2013-07-02
+
+--- a/inst/sym2poly.m
++++ b/inst/sym2poly.m
+@@ -152,4 +152,4 @@
+ %! symbols
+ %! x = sym ("x"); y = sym ("y");
+ %!assert (sym2poly (x^2+3*x-4), [1, 3, -4]);
+-%!assert (sym2poly (x^2+y*x, x), {sym("1"), y, sym("0.0")})
++%!assert (disp (sym2poly (x^2+y*x, x)), disp ({sym("1"), y, sym("0.0")}))
diff --git a/debian/patches/fix-tests-blocks.patch b/debian/patches/fix-tests-blocks.patch
new file mode 100644
index 0000000..853dfcf
--- /dev/null
+++ b/debian/patches/fix-tests-blocks.patch
@@ -0,0 +1,69 @@
+Description: Fix tests blocks in sym2poly and symfsolve
+ symfsolve.m: fix syntax of "%!" test block
+ sym2poly.m: fix syntax of "%!" test block. Also fix test result when
+ using 2 input arguments since it is returning a cell array of symbolic
+ variables.
+Origin: http://sourceforge.net/p/octave/symbolic/ci/46a454014dfac4ad6bf1c0ce3634aa31f54c0a43/
+Bug: https://savannah.gnu.org/bugs/?39284
+Last-Update: 2013-06-25
+
+diff -r fcb181ca587f -r 46a454014dfa inst/sym2poly.m
+--- a/inst/sym2poly.m	Tue Jun 18 22:44:18 2013 +0200
++++ b/inst/sym2poly.m	Tue Jun 18 22:51:30 2013 +0200
+@@ -30,7 +30,7 @@
+ ## x = sym("x");
+ ## y = sym("y");
+ ## c = sym2poly (x^2+3*x-4);    # c = [1,3,-4]
+-## c = sym2poly (x^2+y*x,x);    # c = @{2,y,0@}
++## c = sym2poly (x^2+y*x,x);    # c = @{sym("1"),y,sym("0.0")@}
+ ## @end example
+ ##
+ ## If @var{p} is not a polynomial the result has no warranty.
+@@ -148,10 +148,8 @@
+ 
+ endfunction
+ 
+-%!shared
+-% symbols
+-% x=sym("x"); y=sym("y");
+-%!test
+-% assert(sym2poly (x^2+3*x-4), [1,3,-4]);
+-%!test
+-% assert (sym2poly (x^2+y*x,x), {2,y,0})
++%!shared x, y
++%! symbols
++%! x = sym ("x"); y = sym ("y");
++%!assert (sym2poly (x^2+3*x-4), [1, 3, -4]);
++%!assert (sym2poly (x^2+y*x, x), {sym("1"), y, sym("0.0")})
+diff -r fcb181ca587f -r 46a454014dfa inst/symfsolve.m
+--- a/inst/symfsolve.m	Tue Jun 18 22:44:18 2013 +0200
++++ b/inst/symfsolve.m	Tue Jun 18 22:51:30 2013 +0200
+@@ -154,18 +154,13 @@
+ 
+ endfunction
+ 
+-%!shared
+-% x = sym ("x");
+-% y = sym ("y");
+-% f = x ^ 2 + 3 * x - 1;
+-% g = x * y - y ^ 2 + 3;
+-%!test
+-% assert (symfsolve (f, g), [0.30278; -1.58727]', 1e-5);
+-%!test
+-% assert (symfsolve (f, g, x, 1, y, 5), [0.30278; 1.89004]', 1e-5);
+-%!test
+-% assert (symfsolve (f, g, {x==1,y==5}), [0.30278; 1.89004]', 1e-5);
+-%!test
+-% assert (symfsolve (f, g, [1 5]), [0.30278; 1.89004]', 1e-5);
+-%!test
+-% assert (symfsolve ({f, g}, {y==1,x==2}), [1.89004; 0.30278]', 1e-5);
++%!shared x,y,f,g
++%! x = sym ("x");
++%! y = sym ("y");
++%! f = x ^ 2 + 3 * x - 1;
++%! g = x * y - y ^ 2 + 3;
++%!assert (symfsolve (f, g), [0.30278; -1.58727], 1e-5);
++%!assert (symfsolve (f, g, x, 1, y, 5), [0.30278; 1.89004]', 1e-5);
++%!assert (symfsolve (f, g, {x==1,y==5}), [0.30278; 1.89004]', 1e-5);
++%!assert (symfsolve (f, g, [1 5]), [0.30278; 1.89004]', 1e-5);
++%!assert (symfsolve ({f, g}, {y==1,x==2}), [1.89004; 0.30278]', 1e-5);
diff --git a/debian/patches/proper-cell-array-reversal.patch b/debian/patches/proper-cell-array-reversal.patch
new file mode 100644
index 0000000..062f7ba
--- /dev/null
+++ b/debian/patches/proper-cell-array-reversal.patch
@@ -0,0 +1,20 @@
+Description: Proper reversal of a cell array
+ sym2poly.m: the "reverse" function is called in order to reverse the
+ cell array c_ex but this function does not exist. Using indexing with
+ parenthesis, instead.
+Origin: http://sourceforge.net/p/octave/symbolic/ci/4a231250ff78fd4c1ea89ffd35978d3a53440b88/
+Bug: https://savannah.gnu.org/bugs/?39282
+Last-Update: 2013-06-25
+
+diff -r d924a90d547f -r 4a231250ff78 inst/sym2poly.m
+--- a/inst/sym2poly.m	Mon Jun 17 23:44:43 2013 +0200
++++ b/inst/sym2poly.m	Tue Jun 18 02:40:51 2013 +0200
+@@ -136,7 +136,7 @@
+     endif
+   endfor
+ 
+-  c_ex = reverse(c_ex);
++  c_ex = c_ex(end:-1: 1);
+ 
+   if all_numeric
+     for i=1:(order+1)
diff --git a/debian/patches/series b/debian/patches/series
index 1f10084..9c620b2 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,6 @@
 cell-as-retval-in-findsymbols.patch
+proper-cell-array-reversal.patch
+store-symbolic-expressions.patch
+fix-tests-blocks.patch
+sumterms-return-cell-vector.patch
+avoid-ex-type-in-assert.patch
diff --git a/debian/patches/store-symbolic-expressions.patch b/debian/patches/store-symbolic-expressions.patch
new file mode 100644
index 0000000..f6f55d2
--- /dev/null
+++ b/debian/patches/store-symbolic-expressions.patch
@@ -0,0 +1,20 @@
+Description: Store elements as symbolic expressions, not cell arrays (bug #39283)
+ symfsolve.m: the elements of the cell array "vars" should be stored
+ as symbolic expressions. This was also causing one of the test blocks
+ to fail.
+Origin: http://sourceforge.net/p/octave/symbolic/ci/fcb181ca587f10cf5b1aaec4fcf37794e53d4e0a/
+Bug: https://savannah.gnu.org/bugs/?39283
+Last-Update: 2013-06-25
+
+diff -r 4a231250ff78 -r fcb181ca587f inst/symfsolve.m
+--- a/inst/symfsolve.m	Tue Jun 18 02:40:51 2013 +0200
++++ b/inst/symfsolve.m	Tue Jun 18 22:44:18 2013 +0200
+@@ -128,7 +128,7 @@
+       ## cell-array of relations - this should work for a list of strings ("x==3") too.
+       for i=1:nvars
+         tmp = disp(varargin{arg_count+1}{i});
+-        vars{end+1} = {sym(strtok(tmp,"=="))};
++        vars{end+1} = sym (strtok (tmp, "=="));
+         X0(i) = str2num(tmp((findstr(tmp,"==")+2):length(tmp)));
+       endfor
+     else
diff --git a/debian/patches/sumterms-return-cell-vector.patch b/debian/patches/sumterms-return-cell-vector.patch
new file mode 100644
index 0000000..8218406
--- /dev/null
+++ b/debian/patches/sumterms-return-cell-vector.patch
@@ -0,0 +1,20 @@
+Description: Make sumterms return a cell vector (bug #39281)
+ sumterms.cc: function was returning an octave_list, which yields in
+ multiple output arguments. This makes inst/sym2poly.m fail, since a cell
+ array is expected as the returned value from sumterms.
+Origin: http://sourceforge.net/p/octave/symbolic/ci/395bfe918a42330e6e4488c855b4876d69468ab0/
+Bug: https://savannah.gnu.org/bugs/?39281
+Last-Update: 2013-06-25
+
+diff -r 46a454014dfa -r 395bfe918a42 src/sumterms.cc
+--- a/src/sumterms.cc	Tue Jun 18 22:51:30 2013 +0200
++++ b/src/sumterms.cc	Tue Jun 18 02:36:07 2013 +0200
+@@ -55,7 +55,7 @@
+       // no sum terms, return expression
+       termlist.append(octave_value(new octave_ex(expression)));
+     }
+-    retval = termlist;
++    retval = Cell (termlist);
+   } catch (std::exception &e) {
+     error (e.what ());
+     retval = octave_value ();

-- 
Debian packaging for octave-symbolic



More information about the Pkg-octave-commit mailing list