any(x,2) on sparse gives bad result

Kim Hansen kimhanse at gmail.com
Mon Jan 7 04:17:07 CST 2008


I have attached a data file that shows a strange bug in any(). I have
tried to create a more simple example, but I didn't have any luck.

The bug exists in the Debian octave 3.0 package and in the current cvs version.

==============
octave:1> load x
octave:2> any(x,2)(10104,:)
ans = Compressed Column Sparse (rows = 1, cols = 1, nnz = 0)

octave:3> any(full(x),2)(10104,:)
ans =  1
octave:4> x(10104,:)
ans =

Compressed Column Sparse (rows = 1, cols = 71, nnz = 1)

  (1, 42) ->  1

octave:5> whos x
Variables in the current scope:

  Attr Name        Size                     Bytes  Class
  ==== ====        ====                     =====  =====
       x       10226x71                      8316  double

Total is 669 elements using 8316 bytes

octave:6>
==============

-- 
Kim Hansen
Vadgårdsvej 3, 2.tv
2860 Søborg
Fastnet: 3956 2437  --  Mobil: 3091 2437
-------------- next part --------------
A non-text attachment was scrubbed...
Name: x.gz
Type: application/x-gzip
Size: 1782 bytes
Desc: not available
Url : https://www.cae.wisc.edu/pipermail/bug-octave/attachments/20080107/3f0b5768/attachment-0001.bin 


More information about the Bug-octave mailing list