bugGNU Octave - Bugs: bug #47173, mtimes allows arguments with >=...


bug #47173: mtimes allows arguments with >= 3 dimensions

Submitted by:  Nicholas Jankowski <nrjank>
Submitted on:  Tue 16 Feb 2016 09:19:01 PM UTC  
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Regression
Status: Patch SubmittedAssigned to: Lachlan Andrew <lachlan>
Originator Name: Nicholas JankowskiOpen/Closed: Open
Release: devOperating System: Any

Add a New Comment(Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


(Jump to the original submission Jump to the original submission)

Tue 05 Sep 2017 05:02:22 PM UTC, comment #7:

Thanks for testing. I'm switching the Item Group to Regression since this used to produce an error (even if not exactly on topic).

Rik <rik5>
Project Administrator
Tue 05 Sep 2017 03:55:04 PM UTC, comment #6:

Appears to still be relevant.

Matlab 2017a:

Octave 4.2.1:

Nicholas Jankowski <nrjank>
Sun 03 Sep 2017 12:58:23 AM UTC, comment #5:

Since Matlab has added broadcasting in 2016B, is their behavior still the same as reported in the original submission which was for version 2015B?

I just want to make sure this bug is still relevant.

Rik <rik5>
Project Administrator
Thu 18 Feb 2016 01:51:45 AM UTC, comment #4:

I'm attaching a patch, and the shell+awk scripts I used to generate it.

The operators are created by a maze of nested macros to minimize repeated code. It may be able to be simplified using templates, but my guess is that it would still require quite a bit of special-case code. For example "A * B'" doesn't just transpose B and then multiply; it uses a particular library call that performs them together. Multiplication by a sparse, diagonal or permutation matrix clearly needs different code from multiplication by a full matrix etc.

This is right in the heart of Octave, and so it will probably take a lot of time and testing to get the patch approved. Any suggestions of how to test the hundreds of operators would be welcomed!

(file #36370, file #36371, file #36372)

Lachlan Andrew <lachlan>
Project MemberIn charge of this item.
Wed 17 Feb 2016 02:53:04 PM UTC, comment #3:

Yikes. repeated code? or not identical enough for it to be functionalized and addressed in one place?

Nicholas Jankowski <nrjank>
Wed 17 Feb 2016 02:01:35 AM UTC, comment #2:

Yes, the arguments are being flattened to 2D implicitly, through a maze of macros in libinterp/operators/op-??-??.cc

I'm preparing a patch, but there are lots of functions to fix (all combinations of single/double, real/complex, sparse, diagonal, ..., for half a dozen operators (AB, A/B, AB', A'*B, A\B, A'\B)).

Lachlan Andrew <lachlan>
Project MemberIn charge of this item.
Tue 16 Feb 2016 11:13:45 PM UTC, comment #1:

Confirmed. FTR, did produce an error in 3.8.x and earlier, although it was not a non-conformant argument error:

Mike Miller <mtmiller>
Project Administrator
Tue 16 Feb 2016 09:19:01 PM UTC, original submission:

This just came up on the help mailing list. I think the following example presents the issue concisely:

Each of those except the first should produce a non-conformant argument error. (Matlab 2015b errors out in these cases)

The email discussion thought maybe the issue had to do with broadcasting, but it now seems unrelated (and should be, since .* is uninvolved).

Is mtimes flattening the argument to 2D (from nxm * mxpxq to nxm * mx(p*q) ) and skipping any conformance checking?

(verified still exists in 4.0.1rc3)

Nicholas Jankowski <nrjank>


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

Attach File(s):

Attached Files
file #36370:  bug_47173_mtimes.cset added by lachlan (36KiB - application/octet-stream)
file #36371:  add_check.awk added by lachlan (704B - application/x-awk)
file #36372:  traverse_files.sh added by lachlan (2KiB - application/x-shellscript)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by lachlan (Posted a comment)
  • -unavailable- added by mtmiller (Posted a comment)
  • -unavailable- added by nrjank (Submitted the item)
  • -unavailable- added by nrjank
  • -unavailable- added by nrjank
  • -unavailable- added by nrjank

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 14 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 05 Sep 2017 05:02:22 PM UTCrik5Item GroupIncorrect Result=>Regression
    Thu 18 Feb 2016 01:51:45 AM UTClachlanAttached File-=>Added bug_47173_mtimes.cset, #36370
      Attached File-=>Added add_check.awk, #36371
      Attached File-=>Added traverse_files.sh, #36372
      StatusIn Progress=>Patch Submitted
    Wed 17 Feb 2016 02:01:35 AM UTClachlanStatusConfirmed=>In Progress
      Assigned toNone=>lachlan
      Summarymtimes allows non-conformant arguments, looks similar to unexpected broadcasting=>mtimes allows arguments with >= 3 dimensions
    Tue 16 Feb 2016 11:13:45 PM UTCmtmillerStatusNone=>Confirmed
      Operating SystemMicrosoft Windows=>Any
    Tue 16 Feb 2016 09:19:01 PM UTCnrjankCarbon-Copy-=>Added juanpi
      Carbon-Copy-=>Added -unavailable-
      Carbon-Copy-=>Added caliari

    Back to the top

    Powered by Savane 3.1-cleanup1