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

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

[Octave-bug-tracker] [bug #29646] sparse indexed assignment broken


From: Jaroslav Hajek
Subject: [Octave-bug-tracker] [bug #29646] sparse indexed assignment broken
Date: Fri, 23 Apr 2010 07:46:46 +0000
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100317 SUSE/3.5.9-0.1.1 Firefox/3.5.9

URL:
  <http://savannah.gnu.org/bugs/?29646>

                 Summary: sparse indexed assignment broken
                 Project: GNU Octave
            Submitted by: highegg
            Submitted on: Fri 23 Apr 2010 07:46:46 AM GMT
                Category: Interpreter
                Severity: 3 - Normal
              Item Group: Incorrect Result
                  Status: Confirmed
             Assigned to: highegg
         Originator Name: Jarno Rajahalme
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: dev
        Operating System: Mac OS

    _______________________________________________________

Details:

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 <address@hidden>
# 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,




    _______________________________________________________

Reply to this item at:

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

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





reply via email to

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