[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [Pkg-octave-devel] [RFU] octave-fixed 0.7.10-4



* Jordi Gutiérrez Hermoso <jordigh@octave.org> [2012-04-01 14:34]:

> On 1 April 2012 13:35, Rafael Laboissiere <rafael@laboissiere.net> wrote:
> > * Thomas Weber <tweber@debian.org> [2012-04-01 18:15]:
> >
> > [snip]
> > Although the package seems to work, the code in fixedpoint.m that
> > implements the test suite needs to be ported to Octave 3.6.
> 
> I think when Bateman created this package, Octave didn't really have
> the test suite infrastructure yet.
> 
> If I don't get around within a couple of weeks to try to fix the
> package again, do remove it.

Thanks for that.  Attached below are two patches that fix some of the
problems (the easier ones :-)

Rafael
Description: Cope with the change in the behavior of ismatrix()
 ismatrix([]) sued to return 0 in OCtave 3.2, but now returns returns 1
 in 3.6.
Author: Rafael Laboissiere <rafael@laboissiere.net>
Last-Update: 2012-04-01

--- octave-fixed-0.7.10.orig/inst/fixedpoint.m
+++ octave-fixed-0.7.10/inst/fixedpoint.m
@@ -180,7 +180,7 @@ function retval = fixedpoint(typ, tests)
 	error ("FAILED");
       endif
       empty = fixed(is,ds,[]);
-      if (isscalar(empty) || ismatrix(empty) || !isfixed(empty) ||
+      if (isscalar(empty) || !isfixed(empty) ||
 	  isvector(empty) || !isempty(empty) || isempty(zero))
 	error ("FAILED");
       endif
@@ -278,7 +278,7 @@ function retval = fixedpoint(typ, tests)
 	error ("FAILED");
       endif
       empty = fixed(is*(1+1i),ds*(1+1i),[]);
-      if (isscalar(empty) || ismatrix(empty) || !isfixed(empty) ||
+      if (isscalar(empty) || !isfixed(empty) ||
 	  isvector(empty) || !isempty(empty) || isempty(onei) ||
 	  iscomplex(empty))
 	## Not complex, since its type is narrowed!!
Description: Fixes for error "invalid assignment to cs-list outside multiple assignment"
Author: Rafael Laboissiere <rafael@laboissiere.net>
Last-Update: 2012-04-01

--- octave-fixed-0.7.10.orig/inst/fixedpoint.m
+++ octave-fixed-0.7.10/inst/fixedpoint.m
@@ -209,10 +209,10 @@ function retval = fixedpoint(typ, tests)
       if (size(zero) != [n,n])
 	error ("FAILED");
       endif
-      zero.int = zero.int+1;
-      zero.dec = zero.dec+1;
-      if (any(any(zero.x)) || any(any(zero.int != is+1)) || 
-	  any(any(zero.dec != ds+1)))
+      zero_int_plus_one = zero.int+1;
+      zero_dec_plus_one = zero.dec+1;
+      if (any(any(zero.x)) || any(any(zero_int_plus_one != is+1)) || 
+	  any(any(zero_dec_plus_one != ds+1)))
 	error ("FAILED");
       endif
       for i=1:100
@@ -312,10 +312,10 @@ function retval = fixedpoint(typ, tests)
       if (size(onei) != [n,n])
 	error ("FAILED");
       endif
-      onei.int = onei.int+1;
-      onei.dec = onei.dec+1;
-      if (any(any(onei.x != 1+1i)) || any(any(onei.int != is*(1+1i)+1)) || 
-	  any(any(onei.dec != ds*(1+1i)+1)))
+      onei_int_plus_one = onei.int+1;
+      onei_dec_plus_one = onei.dec+1;
+      if (any(any(onei.x != 1+1i)) || any(any(onei_int_plus_one != is*(1+1i)+1)) || 
+	  any(any(onei_dec_plus_one != ds*(1+1i)+1)))
 	error ("FAILED");
       endif
       for i=1:100
@@ -392,8 +392,7 @@ function retval = fixedpoint(typ, tests)
       if (any(any(abs(a(1,:).x - x(1,:)) > feps)) || !isfixed(a))
 	error ("FAILED");
       endif
-      a(1,:).dec = a(1,:).dec + 1;
-      if (a(1,:).dec != ds+1)
+      if (a(1,:).dec + 1 != ds+1)
         error("FAILED");
       endif
       if (a(2,:).dec != ds)
@@ -411,8 +410,7 @@ function retval = fixedpoint(typ, tests)
 	  !isfixed(a)) 
 	error ("FAILED");
       endif
-      a(1,:).dec = a(1,:).dec + 1;
-      if (a(1,:).dec != ds*(1+1i)+1)
+      if (a(1,:).dec + 1 != ds*(1+1i)+1)
         error("FAILED");
       endif
       if (a(2,:).dec != ds*(1+1i))

Reply to: