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

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

[Octave-bug-tracker] [bug #50776] Octave inconsistent with Matlab for co


From: John W. Eaton
Subject: [Octave-bug-tracker] [bug #50776] Octave inconsistent with Matlab for corner indexing case
Date: Tue, 11 Apr 2017 18:39:48 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0

Update of bug #50776 (project octave):

                  Status:               Confirmed => Patch Submitted        

    _______________________________________________________

Follow-up Comment #2:

I think there are some differences between logical and numeric indexing when
only one index supplied.

I came up with the following rules:

// Colon:
//
//   object   | index    | result orientation
//   ---------+----------+-------------------
//   anything | colon    | column vector
//
// Logical (mask):
//
//   object   | index    | result orientation
//   ---------+----------+-------------------
//   vector   | anything | indexed object
//   ---------+----------+-------------------
//   array    | vector   | index
//            | other    | column vector
//
// Numeric:
//
//   object   | index    | result orientation
//   ---------+----------+-------------------
//   vector   | vector   | indexed object
//            | other    | same size as index
//   ---------+----------+-------------------
//   array    | anything | same size as index


I'm attaching a test script and associated function that can be used to verify
these assumptions.  If correct it should produce no output.  Could someone
test this in a recent Matlab and verify that it is correct?  It fails a number
of cases in Octave currently.

I'm also attaching a proposed patch for Octave to fix these problems.

Note that I had to add data members to idx_vector to keep track of the real
original index dimensions and whether it is a logical index.  In spite of the
fact that there is an orig_dims data member there, it seems like it can be
something other than the original dimensions of the index.  Also, there's a
lot of complication there with transforming one type of index to another
(logical to vector, for example) so I'm not sure whether my change is actually
sufficient since the notion of "logical index" is not transferred if the
internal index representation changes.  It would be great to simplify and
clean up this mess but I can't work on it more at the moment.


(file #40367, file #40368, file #40369)
    _______________________________________________________

Additional Item Attachment:

File name: idxtest.m                      Size:0 KB
File name: vecidxtest2.m                  Size:6 KB
File name: idx-diffs.txt                  Size:7 KB


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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