[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #51880] sparse() ignores value of scalar colum
From: |
David Bateman |
Subject: |
[Octave-bug-tracker] [bug #51880] sparse() ignores value of scalar column index input arg |
Date: |
Tue, 29 Aug 2017 09:02:48 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0 |
Follow-up Comment #1, bug #51880 (project octave):
I haven't done much with Octave for a long while, but as I wrote this code I
had a quick look at it.
The specialisation for sparse column vectors was added to my code by Jaroslav,
and he didn't take into account the possibility that the sparse column vector
could in fact be a matrix. The fix is relatively easy. Looking at lines
362-363 of
http://hg.savannah.gnu.org/hgweb/octave/annotate/df49ac93f50c/liboctave/array/Sparse.cc
These implicitly assume that everything is in the first column. These should
be replaced with
for (octave_idx_type i = 0; i < c (0) - 1; i++)
xcidx (i) = 0;
xcidx (c(0) - 1) = new_nz;
I don't even have a octave source tree on my machine to test this so someone
else will have to work this up as a hg chageset
D.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?51880>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/