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

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

[Octave-bug-tracker] [bug #53185] nnz errors with range input


From: Luis Mendo
Subject: [Octave-bug-tracker] [bug #53185] nnz errors with range input
Date: Sun, 18 Feb 2018 13:41:41 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36

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

                 Summary: nnz errors with range input
                 Project: GNU Octave
            Submitted by: lmendo
            Submitted on: Sun 18 Feb 2018 06:41:39 PM UTC
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Unexpected Error
                  Status: None
             Assigned to: None
         Originator Name: Luis Mendo
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 4.2.1
        Operating System: Any

    _______________________________________________________

Details:

The nnz function gives an error whrn the input is a range. For example:


x = 1:5;
nnz(x)


This is probably related to Octave treating ranges specially to save memory,
as indicated here

https://www.gnu.org/software/octave/doc/v4.2.0/Ranges.html

The error disappears with


nnz(x(:))


or 


nnz(x.')


presumably because indexing or transposing forces the range to be transformed
into an actual vector.

Not sure if this affects other functions in addition to nnz.

Thanks to Stack Exchange user @Steadybox for finding this bug.




    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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