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

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

[Octave-bug-tracker] [bug #51880] sparse() ignores value of scalar colum


From: Ray Zimmerman
Subject: [Octave-bug-tracker] [bug #51880] sparse() ignores value of scalar column index input arg
Date: Mon, 28 Aug 2017 15:39:58 -0400 (EDT)
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/603.3.8 (KHTML, like Gecko) Version/10.1.2 Safari/603.3.8

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

                 Summary: sparse() ignores value of scalar column index input
arg
                 Project: GNU Octave
            Submitted by: rdzman
            Submitted on: Mon 28 Aug 2017 07:39:57 PM UTC
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: Ray Zimmerman
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 4.2.1
        Operating System: Any

    _______________________________________________________

Details:

The following should produce a sparse matrix with non-zeros in the 2nd
column.

sparse(1:2, 2, 1:2, 2, 2)


But it puts them in the first column.

> full(sparse(1:2, 2, 1:2, 2, 2))
ans =

   1   0
   2   0


In fact, the following will put the non-zeros in column 1 for any scalar value
of j between 1 and 5.


sparse(1:5, j, 1:5, 5, 5)


So it appears that it is ignoring any scalar value passed in as a column index
and just using 1 instead. A scalar row index, on the other hand, is handled
correctly.

And Matlab also handles the scalar column index as expected.




    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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