octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #37774] Slicing sparse matrix gives wrong resu


From: David Bateman
Subject: [Octave-bug-tracker] [bug #37774] Slicing sparse matrix gives wrong result
Date: Sat, 22 Jun 2013 10:11:54 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:21.0) Gecko/20100101 Firefox/21.0

Update of bug #37774 (project octave):

                  Status:               Confirmed => Fixed                  
             Assigned to:                    None => dbateman               
             Open/Closed:                    Open => Closed                 

    _______________________________________________________

Follow-up Comment #1:

The two index version of the Sparse<T>:index for column vectors calls the
single index method. In the case of a scalar stored as a sparse matrix the
single index version of Sparse<T>::index specialised the method, and some
information on the form of the desired return matrix was lost when handing the
two index version happen the problem off to the single index version.

This is not the first bug report for the special cases of scalars stored as
sparse matrices and I'm inclined to just treat this case the same way the
octave treats the indexing of scalars, that is it casts them to matrices and
then index them. In this manner the results will be automatically consistent
between sparse and full matrices

As a scalar stored as a sparse matrx takes significantly more memory than a
scalar stored in a matrix, we're probably better off just densifying the
matrix and calling the dense index function on it and resparsifying the
returned matrix in any case in terms of performance.

See the changeset

http://hg.savannah.gnu.org/hgweb/octave/rev/f4eef73b6e90

D.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?37774>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]