Slicing in sparse

John W. Eaton jwe at bevo.che.wisc.edu
Mon Dec 3 13:47:35 CST 2007


On  3-Dec-2007, David Bateman wrote:

| Kim Hansen wrote:
| > Slicing in sparse matrices do not do the same as full matrices in some
| > corner cases:
| >
| > octave:2> m=[true false];
| > octave:3> f=zeros(0,2);
| > octave:4> s=sparse(f);
| > octave:7> f(:,m)=0
| > f = [](0x2)
| > octave:8> s(:,m)=0
| > s =
| > Compressed Column Sparse (rows = 1, cols = 2, nnz = 0)
| > octave:9>
| >
| > I have attached a new test that compares the behaviour of sparse and
| > full, the test works but it contains 12 known errors marked with
| > xtest.
| >
| > Regards,
| >   
| > ------------------------------------------------------------------------
| >
| > _______________________________________________
| > Bug-octave mailing list
| > Bug-octave at octave.org
| > https://www.cae.wisc.edu/mailman/listinfo/bug-octave
| >   
| Please try the following patch

| 2007-12-02  David Bateman  <dbateman at free.fr>
| 
| 	* Sparse.cc (template <class LT, class RT> int assign
| 	(Sparse<LT>&,  const Sparse<RT>&)): Only set return matrix size to
| 	rhs values if both no. rows and columns are zero.

Please check it in.

Thanks,

jwe


More information about the Bug-octave mailing list