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

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

[Octave-bug-tracker] [bug #45957] Error "A(I) = X: X must have the same


From: Lachlan Andrew
Subject: [Octave-bug-tracker] [bug #45957] Error "A(I) = X: X must have the same size as I" not very informative
Date: Mon, 14 Sep 2015 10:48:47 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36

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

                 Summary: Error "A(I) = X: X must have the same size as I" not
very informative
                 Project: GNU Octave
            Submitted by: lachlan
            Submitted on: Mon 14 Sep 2015 10:48:46 AM GMT
                Category: Libraries
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Feature Request
                  Status: None
             Assigned to: None
         Originator Name: Lachlan
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 4.0.0
        Operating System: GNU/Linux

    _______________________________________________________

Details:

The following errors omit much of the information known to Octave that would
be useful to the programmer:
   "A(I) = X: X must have the same size as I"
   "A(I,J,...) = X: dimensions mismatch"
   "subscript indices must be either positive integers less than 2^63 or
logicals"

The attached patch produces more informative messages.  For the first two, it
specifies the actual dimensions of the LHS and RHS.  For the third, it
specifies the offending index.

For the third, it would be much more useful to say which variable is being
accessed.  That would help in code like

  A(B(C(j), D(k)), E(F(m), G(n)))

where many variables are accessed in the same line of code.  It would also be
of some use to specify which dimension is in error.  

However, it seems that information would have to be passed through many layers
of function calls, which would have a (slight?) performance hit.  Is it worth
passing that info, or perhaps providing a compile-time option?  In the latter
case, there wouldn't need to be too many #defines; it could produce a CONTEXT
macro that gets passed to the functions, which is either empty or a pointer to
the desired context.

Any suggestions?

Also, I realise that this patch affects things right at the heart of Octave,
and so the maintainers will be reluctant to apply it.  Is there something I
can do to improve its chances?



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Mon 14 Sep 2015 10:48:46 AM GMT  Name: index_errors.patch  Size: 11kB  
By: lachlan

<http://savannah.gnu.org/bugs/download.php?file_id=34874>

    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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