bugGNU Octave - Bugs: bug #55445, (minor) Boolean matrix sometimes...

 
 

bug #55445: (minor) Boolean matrix sometimes becomes double upon assigning zeros:

Submitter:  deego <deego>
Submitted:  Fri 11 Jan 2019 12:07:37 PM UTC
   
 
Category:  Interpreter Severity:  2 - Minor
Priority:  3 - Low Item Group:  Incorrect Result
Status:  Duplicate Assigned to:  None
Originator Name:  deego Open/Closed:  * Closed
Release:  * 4.2.2 Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 11 Jan 2019 01:57:13 PM UTC, comment #1: 

This problem has already been reported (bug #53007) and was fixed in Octave 4.4.0.  If possible you should upgrade to that version or wait for your Linux distributor to provide a more recent version of Octave.

Kai Torben Ohlhus <siko1056>
Group Member
Fri 11 Jan 2019 12:07:37 PM UTC, original submission:  


Normally, if I boolmatrix(indices)=0, octave infers that I really meant false when I said 0, and it keeps the matrix boolean.  You may now go on do things like bar(boolmatrix)=k,  and assume that octave will do a (faster version) of bar(find(boolmatrix))=k. 

But, this fails for some edge cases, leading to (hard-to-track!) bugs:

Example,

b = [false false]
b(indices)=0 ## where indices are [], [1], [2], [1 2], etc.
class (b)  ## => logical


b = [false]
b(indices)=0  ## for any choice of indices: [], [1]
class (b)  ## => double

Finally, if b were an empty bool matrix, it continues to stay bool matrix. The problem seems to be limited to the 1-element case.




A similar switch doesn't seem to happen if I assign a(1)=<double> where a is a uint8 matrix with only one element, and a stays uint8.




(I should learn to stop using 0/1 for false/true).


deego <deego>

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Digest:
   bug dependencies.

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by siko1056 (Posted a comment)
  • -email is unavailable- added by deego (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-01-11 siko1056 Dependencies- Depends on bugs #53007
    2019-01-11 siko1056 Severity3 - Normal 2 - Minor
        Priority5 - Normal 3 - Low
        Item GroupOther Incorrect Result
        StatusNone Duplicate
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code