bugGNU Octave - Bugs: bug #29646, sparse indexed assignment broken

 
 

bug #29646: sparse indexed assignment broken

Submitted by:  Jaroslav Hajek <highegg>
Submitted on:  Fri 23 Apr 2010 07:46:46 AM UTC  
 
Category: InterpreterSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: Jaroslav Hajek <highegg>
Originator Name: Jarno RajahalmeOpen/Closed: Closed
Release: devOperating System: Mac OS

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Fri 23 Apr 2010 07:51:39 AM UTC, comment #1:

Fixed in dev tree:
http://hg.savannah.gnu.org/hgweb/octave/rev/f41c6634d5af

thanks for reporting.

Jaroslav Hajek <highegg>In charge of this item.
Fri 23 Apr 2010 07:46:46 AM UTC, original submission:

Hi,

Trying out my earlier Octave code with the development branch I ran into messed up sparse matrices. I have isolated the problem to the following code:

clear spmx
spmx = sparse(4,1);
spmx(4,1) = 1
spmx(3,1) = 2
spmx(2,1) = 3

save test_spmx.oct spmx
load test_spmx.oct

When executed line by line, I get:

octave:1> clear spmx
octave:2> spmx = sparse(4,1);
octave:3> spmx(4,1) = 1
spmx =

Compressed Column Sparse (rows = 4, cols = 1, nnz = 1 [25%])

(4, 1) -> 1

octave:4> spmx(3,1) = 2
spmx =

Compressed Column Sparse (rows = 4, cols = 1, nnz = 2 [50%])

(3, 1) -> 2
(3, 1) -> 2

octave:5> spmx(2,1) = 3
spmx =

Compressed Column Sparse (rows = 4, cols = 1, nnz = 3 [75%])

(2, 1) -> 3
(2, 1) -> 3
(1, 1) -> 2.1539e-314

octave:6> save test_spmx.oct spmx
octave:7> load test_spmx.oct
error: load: invalid sparse matrix: row indices must appear in ascending order in each column
octave:7>

At this point, the saved file looks like this:

# Created by Octave 3.3.51+, Fri Apr 23 00:21:36 2010 PDT <rajahalm@...>
# name: spmx
# type: sparse matrix
# nnz: 3
# rows: 4
# columns: 1
2 1 3
2 1 3
1 1 2.154517066753669e-314

This is the same as printed after the last assignment above. But the contents has only the last assignment correctly, others have been replaced with incorrect indices and values.

I did hg pull; hg update to make sure I have the latest code. Running on OSX, 64-bit (but without --enable-64). I'll provide more details if need be.

Regards,

Jaroslav Hajek <highegg>In charge of this item.

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by highegg (Submitted the item)
  • -unavailable- added by highegg
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 23 Apr 2010 07:51:39 AM UTChigheggStatusConfirmed=>Fixed
      Open/ClosedOpen=>Closed
    Fri 23 Apr 2010 07:46:46 AM UTChigheggCarbon-Copy-=>Added -unavailable-

    Back to the top


    Powered by Savane 3.1-cleanup1