octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #52934] (interval) linspace and mince handling


From: Joel Dahne
Subject: [Octave-bug-tracker] [bug #52934] (interval) linspace and mince handling of empty and non-vector input
Date: Fri, 19 Jan 2018 14:45:51 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0

URL:
  <http://savannah.gnu.org/bugs/?52934>

                 Summary: (interval) linspace and mince handling of empty and
non-vector input
                 Project: GNU Octave
            Submitted by: urathai
            Submitted on: Fri 19 Jan 2018 07:45:50 PM UTC
                Category: Octave Forge Package
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Unexpected Error
                  Status: None
             Assigned to: None
         Originator Name: Joel
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 4.2.1
        Operating System: Any

    _______________________________________________________

Details:

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.




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?52934>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]