bugGNU Octave - Bugs: bug #52934, [octave forge] (interval) linspace...

 
 

bug #52934: [octave forge] (interval) linspace and mince handling of empty and non-vector input

Submitter:  Joel Dahne <urathai>
Submitted:  Fri 19 Jan 2018 07:45:50 PM UTC
   
 
Category:  Octave Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Unexpected Error or Warning
Status:  Fixed Assigned to:  None
Originator Name:  Joel Open/Closed:  * Closed
Release:  * 4.2.1 Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 07 Feb 2022 12:25:28 AM UTC, comment #4: 

Sorry, I meant: Thanks for the fix Joel and Oliver 🙂👍

Kai Torben Ohlhus <siko1056>
Group Member
Mon 07 Feb 2022 12:24:49 AM UTC, comment #3: 

Thanks for the fix Oliver 🙂👍

Kai Torben Ohlhus <siko1056>
Group Member
Sun 06 Feb 2022 11:21:44 PM UTC, comment #2: 

The patch has been imported upstream

https://sourceforge.net/p/octave/interval/ci/6b700f2b0ebacd1dcb77fae63a04ec88b2596c75/

Thank you very much. Unfortunately I didn't get notified about this bug earlier, so it has been a while...

Oliver Heimlich <oheim>
Fri 19 Jan 2018 07:59:25 PM UTC, comment #1: 

I believe that this commit should fix all the problems, https://sourceforge.net/u/urathai/octave/ci/fdc890b4f15795ee39f62d9759c45108dbd0da53/

Joel Dahne <urathai>
Fri 19 Jan 2018 07:45:50 PM UTC, original submission:  

First of all linspace and mince (which uses linspace internally) handle non-vector handle non-vector input different from the normal linspace. The normal linspace only allow for scalar or vector input and otherwise it gives an error. The interval version handles the input as a column vector


> linspace (infsup(zeros(2)), infsup(ones(2)), 3)
ans = 4×3 interval matrix

   [0]   [0.5]   [1]
   [0]   [0.5]   [1]
   [0]   [0.5]   [1]
   [0]   [0.5]   [1]


This is most likely not intentional but comes from the fact that the oct-file handling the computations treats every input as a column vector. If using decorated intervals it does not work at all since the decoration matrix is not converted to a vector.


> linspace (infsupdec(zeros(2)), infsupdec(ones(2)), 3)
error: min: nonconformant arguments (op1 is 4x3, op2 is 2x2)
error: called from
    linspace at line 67 column 14


mince does the same in both cases. I propose to only allow for vector or scalar input and also specify in the documentation that row vectors are converted to column vectors (same as for normal linspace). By explicitly converting the input to a column vector we also avoid the error for infsupdec.

A very similar problem occurs for infsupdec when the input is empty, the interval is converted to a vector but the decoration is not.


> mince(infsupdec(zeros(1, 0), ones(1, 0)), 2)
error: min: nonconformant arguments (op1 is 0x2, op2 is 1x0)
error: called from
    mince at line 61 column 14


This also solved by explicitly converting the input to a column vector.

Joel Dahne <urathai>

 

(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 siko1056 (Posted a comment)
  • -email is unavailable- added by oheim (Posted a comment)
  • -email is unavailable- added by urathai (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 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-02-08 mtmiller Carbon-CopyRemoved 80942 -
    2022-02-07 siko1056 StatusPatch Submitted Fixed
        Open/ClosedOpen Closed
    2018-02-01 mtmiller StatusNone Patch Submitted
        Summary(interval) linspace and mince handling of empty and non-vector input [octave forge] (interval) linspace and mince handling of empty and non-vector input

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code