bugGNU Octave - Bugs: bug #42061, dot() fails to diagnose...

 
 

bug #42061: dot() fails to diagnose non-conformable arguments

Submitter:  Glenn Golden <grepfor>
Submitted:  Sun 06 Apr 2014 09:25:22 PM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Glenn Golden Open/Closed:  * Closed
Release:  * 3.8.0 Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 07 Apr 2014 01:37:52 AM UTC, comment #2: 


> How in the world could a bug like this have escaped testing?


Because it was never tested. Can you write more tests for Octave? We
can always use more help.

Jordi GutiƩrrez Hermoso <jordigh>
Group Member
Sun 06 Apr 2014 09:59:37 PM UTC, comment #1: 

I fixed this on the stable branch in this changeset (http://hg.savannah.gnu.org/hgweb/octave/rev/60562e5c8bfb).  It will be a part of bug fix release 3.8.2.

This managed to exist for so long because the Octave code base is huge and we do not have 100% line coverage for testing.  I added more tests for the input validation of the dot function in with the same changeset.

Closing report.

Rik <rik5>
Group administrator
Sun 06 Apr 2014 09:25:22 PM UTC, original submission:  

The dot() function fails to complain if the operands are non-conformable(!).



    x = [1 2 3];
    y = [4 5];

    dot(x,y)
    ans =  14


This seems pretty gross, and one must ask (without meaning any disrespect): How in the world could a bug like this have escaped testing?  Can it actually be considered correct operation in some sense?

The doc claims that dot(x,y) is supposed to be equivalent to


    sum(conj(x).*y, DIM)


which makes sense, but clearly this cannot be the case when x and y are non-conformable. Based on the results obtained, the behavior seems like the shorter operand is being extended with zeros to the length of the longer one.

Can this actually be intended in some sense?

Glenn Golden <grepfor>

 

(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 jordigh (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by grepfor (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 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-04-06 rik5 StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code