bugGNU Octave - Bugs: bug #52131, lscov fails to run unless all...

 
 

bug #52131: lscov fails to run unless all returned variables are used

Submitter:  Cody Rude <extremeadin>
Submitted:  Thu 28 Sep 2017 01:36:01 AM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
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
   

Jump to the original submission

Thu 28 Sep 2017 10:50:57 PM UTC, comment #6: 

You're welcome!

I'm sure there are a number of other bugs like this which are easy to fix, but no one has stumbled over them or filed a report about them.

Rik <rik5>
Group administrator
Thu 28 Sep 2017 10:46:24 PM UTC, comment #5: 

Thanks for fixing this so fast!

Cody Rude <extremeadin>
Thu 28 Sep 2017 09:11:36 PM UTC, comment #4: 

Thanks Pantxo.  I changed the patch ever so slightly.  I renamed the variable msetmp to just mse.  It is okay to create variables, even when they are outputs, if they are truly needed.  I pushed the patch here (http://hg.savannah.gnu.org/hgweb/octave/rev/392afc740749).  Marking as fixed and closing report.

Rik <rik5>
Group administrator
Thu 28 Sep 2017 11:31:17 AM UTC, comment #3: 

I attached a patch which corrects the behavior so that when no output is requested:

  • "x" is returned anyway and thus assigned to "ans". This is pretty much how all functions work in Octave if they have no effect except returning a value.
  • defines intermediate variables.


(file #41946)

Pantxo Diribarne <pantxo>
Group Member
Thu 28 Sep 2017 01:54:53 AM UTC, comment #2: 

I expected the solution, X. That's what the documentation states it will return if only 1 variable is returned.

Cody Rude <extremeadin>
Thu 28 Sep 2017 01:49:45 AM UTC, comment #1: 

What answer did you expect from
lscov(A,B)
?

Doug Stewart <dastew>
Thu 28 Sep 2017 01:36:01 AM UTC, original submission:  

The function lscov can return 4 results. If all four aren't assigned to a variable, the function will fail to run.

For example,


A = [1.15, 0; 0.0, -0.95];
B = [5.1,0; 0,4.9];
lscov(A,B)



will fail to run, while the following works


A = [1.15, 0; 0.0, -0.95];
B = [5.1,0; 0,4.9];
[q,w,e,r] = lscov(A,B)



It looks like function only computes some statistics if they will be returned, but one of those statistics is required further down in the function.

I ran this on Ubuntu 16.04, Octave 4.2.1

Cody Rude <extremeadin>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #41946:  lscov_output.patch added by pantxo (1KiB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by pantxo (Updated the item)
  • -email is unavailable- added by dastew (Posted a comment)
  • -email is unavailable- added by extremeadin (Submitted the item)
  • -email is unavailable- added by extremeadin
  •  

    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 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-09-28 rik5 StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2017-09-28 pantxo Attached File- Added lscov_output.patch, #41946
        StatusNone Confirmed
    2017-09-28 extremeadin Carbon-Copy- Added extremeadin

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code