bugGNU Octave - Bugs: bug #51092, mldivide returns wrong matrix size...

 
 

bug #51092: mldivide returns wrong matrix size if X contains NaN

Submitter:  Alois Schlögl <schloegl>
Submitted:  Tue 23 May 2017 07:55:51 AM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * 4.2.1 Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 29 Nov 2017 05:21:26 AM UTC, comment #3: 

There are 2 issues in this bug report, both were fixed:

1. The wrong size - see bug #52402
2. The crash - see bug #39000

These bugs have been corrected on the development branch of Octave. Marking as fixed and closing report.
To access these fixes you will need to build from development sources, or wait until the next major release 4.4.0.

Avinoam Kalma <avinoam>
Group Member
Sun 28 May 2017 07:12:16 PM UTC, comment #2: 

I have reopened bug #39000 which seems to be related.

Avinoam Kalma <avinoam>
Group Member
Sat 27 May 2017 05:45:49 PM UTC, comment #1: 

Confirmed.  This probably needs a full review because there are many places in the code where we call Fortran routines on matrices which are singular.  There should be a generic approach to handling this condition.

Rik <rik5>
Group administrator
Tue 23 May 2017 07:55:51 AM UTC, original submission:  

This is example is ok,


N=1000;D=randn(N,3);C=rand(N,1)>.9;[size(D);size(C);size(D\C);size(mldivide(D,C))]


but when D contains some NaN, the size of the results matrix is wrong.


N=1000;D=randn(N,3);C=rand(N,1)>.9;D(10,:)=NaN;[size(D);size(C);size(D\C);size(mldivide(D,C))]
warning: matrix singular to machine precision
warning: matrix singular to machine precision
ans =

   1000      3
   1000      1
      3   1000
      3   1000


Although the content might not be meaningful, I would expect that the matrix size would be the same. I checked also with matlab, and this behaviour is incompatible with it (matlab returns the correct size).



In octave, it also seems to make a difference whether the NaN is in the first column, or only some other column:


N=1000;D=randn(N,3);C=rand(N,1)>.9;D(10,1)=NaN;[size(D);size(C);size(D\C);size(mldivide(D,C))]
warning: matrix singular to machine precision
warning: matrix singular to machine precision
ans =

   1000      3
   1000      1
      3   1000
      3   1000

N=1000;D=randn(N,3);C=rand(N,1)>.9;D(10,2)=NaN;[size(D);size(C);size(D\C);size(mldivide(D,C))]
 ** On entry to DLASCL parameter number  4 had an illegal value
error: exception encountered in Fortran subroutine dgelsd_
N=1000;D=randn(N,3);C=rand(N,1)>.9;D(10,3)=NaN;[size(D);size(C);size(D\C);size(mldivide(D,C))]
 ** On entry to DLASCL parameter number  4 had an illegal value
error: exception encountered in Fortran subroutine dgelsd_



















Alois Schlögl <schloegl>

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by avinoam (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by schloegl (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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-11-29 avinoam StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2017-05-27 rik5 StatusNone Confirmed

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code