[Pkg-octave-devel] Re: Debian packages for Octave 2.9.10 available in experimental

David Bateman David.Bateman at motorola.com
Thu Mar 29 15:52:30 CET 2007


Rafael Laboissiere wrote:
>   ***** test
>  % Test fixed state
>  randp("seed",1);
>  assert(randp(1e9,1,6),[1000006208 1000012224 999981120 999963520 999963072 999981440])
> !!!!! test failed
> error: assert (randp (1e9, 1, 6),[1000006208, 1000012224, 999981120, 999963520, 999963072, 999981440]) expected
>    1.0000e+09   1.0000e+09   9.9998e+08   9.9996e+08   9.9996e+08   9.9998e+08
> but got
>    1.0000e+09   1.0000e+09   9.9998e+08   9.9996e+08   9.9996e+08   9.9998e+08
> values do not match
> shared variables {
>   __random_statistical_tests__ = 0
> }
>   
There are lots of issues of tolerance associated with the values output
from the sparse generators on various platforms, and there really isn't
all that much to do about it as the sequences for the generators on one
machine can't be guaranteed to be the same on another platform. As randp
returns integer values I didn't think there would be an issue here. The
attached patch added a tolerance here and should address the issue.

>   ***** assert(as./bs,sparse(af./bf,true),100*eps);
> !!!!! test failed
> error: assert (as ./ bs,sparse (af ./ bf, true),100 * eps) expected
>    Inf + Infi     2 -   1i   NaN - NaNi   NaN - NaNi
>      0 +   0i   NaN - NaNi   NaN - NaNi   Inf + Infi
>      0 +   0i     0 +   0i   NaN - NaNi   Inf - NaNi
> but got
>    NaN - NaNi     2 -   1i   NaN - NaNi   NaN - NaNi
>      0 +   0i   NaN - NaNi   NaN - NaNi   NaN - NaNi
>      0 +   0i     0 +   0i   NaN - NaNi   NaN - NaNi
> NaNs don't match
> shared variables {
>   as =
>
> Compressed Column Sparse (rows = 3, cols = 4, nnz = 4)
>
>   (1, 1) ->  1 + 1i
>   (1, 2) ->  2 - 1i
>   (2, 4) ->  3 + 2i
>   (3, 4) ->  4 + 0i
>
>   af =
>
>      1 + 1i   2 - 1i   0 + 0i   0 + 0i
>      0 + 0i   0 + 0i   0 + 0i   3 + 2i
>      0 + 0i   0 + 0i   0 + 0i   4 + 0i
>
>   bs =
>
> Compressed Column Sparse (rows = 3, cols = 4, nnz = 4)
>
>   (2, 1) ->  2
>   (3, 1) ->  3
>   (1, 2) ->  1
>   (3, 2) ->  2
>
>   bf =
>
>      0   1   0   0
>      2   0   0   0
>      3   2   0   0
>
> }
>
> [snip]
>   
Now this is very strange, though I can't see from this if the problem is
coming from the sparse constructor or the element by element division.
Can you check and see what output the below gives?

af = [1+1i, 2- 1i, 0+0i, 0+0i; 0+0i, 0+0i, 0+0i, 3+2i; 0+0i, 0+0i, 0+0i,
4+0i];
bf = [ 0 1 0 0; 2 0 0 0; 3 2 0 0];
af ./ bf
sparse(af./bf, true)
(1+1i)/0
(1+1i)./0

In any case I can't generate this same issue on my machine..

D.

-- 
David Bateman                                David.Bateman at motorola.com
Motorola Labs - Paris                        +33 1 69 35 48 04 (Ph) 
Parc Les Algorithmes, Commune de St Aubin    +33 6 72 01 06 33 (Mob) 
91193 Gif-Sur-Yvette FRANCE                  +33 1 69 35 77 01 (Fax) 

The information contained in this communication has been classified as: 

[x] General Business Information 
[ ] Motorola Internal Use Only 
[ ] Motorola Confidential Proprietary

-------------- next part --------------
*** src/DLD-FUNCTIONS/rand.cc.~1.35.~	2007-03-24 12:12:18.000000000 +0100
--- src/DLD-FUNCTIONS/rand.cc	2007-03-29 16:51:16.550227374 +0200
***************
*** 932,938 ****
  %!test
  %! % Test fixed state
  %! randp("state",1);
! %! assert(randp(1e9,1,6),[999915677 999976657 1000047684 1000019035 999985749 999977692])
  %!test
  %! % Test fixed state
  %! randp("seed",1);
--- 932,938 ----
  %!test
  %! % Test fixed state
  %! randp("state",1);
! %! assert(randp(1e9,1,6),[999915677 999976657 1000047684 1000019035 999985749 999977692],1e-6)
  %!test
  %! % Test fixed state
  %! randp("seed",1);


More information about the Pkg-octave-devel mailing list