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

[Pkg-octave-devel] Bug#295395: [OctDev] [dnj@x.dtu.dk: octave-forge: Replacing a submatrix of a sparse matrix results in a full matrix]



Rafael Laboissiere wrote:

package octave-forge
tags 295395 upstream
forwarded 295395 octave-dev@lists.sourceforge.net
thanks

----- Forwarded message from Dennis Jørgensen <dnj@x.dtu.dk> -----

From: Dennis Jørgensen <dnj@x.dtu.dk>
Subject: octave-forge: Replacing a submatrix of a sparse matrix results in a full
matrix
Date: Tue, 15 Feb 2005 16:28:50 +0100
To: Debian Bug Tracking System <submit@bugs.debian.org>

Package: octave-forge
Version: 2004.11.16-3
Severity: normal


With the following commands, I would have expected matrix A to
stay sparse:

octave:1> A = sparse(4,4);
octave:2> A([1 2 4],[1 2 4]) = sprand(3,3,0.2);
octave:3> issparse(A)
ans = 0


Same commands in Matlab:


A = sparse(4,4); A([1 2 4],[1 2 4]) = sprand(3,3,0.2);
issparse(A)

ans =

    1


Replacing sprand() with something returning a full matrix yields
the same results: sparse 'A' in Matlab, full in Octave.



Regards,


 Dennis J??rgensen

Yes, I know. This is what made me start writing the sparse matrix patch that is currently in the unstable CVS of octave. I started to write a patch to the assign functions for the sparse matrix code and quickly found myself with 2,000 lines of code, and felt if I was going to do that, that I might as well replace the whole thing. The good news is as this was the problem that made me start writing this code, the assign behaviour of the sparse matrices in the unstable octave CVS work as you would expect.... Downside, is that I don't expect a patch for the octave-forge version of the sparse matrix code, as it is completely superseded by the version in octave itself..

D.





Reply to: