bugGNU Octave - Bugs: bug #36932, linear indexing assignment removes...


bug #36932: linear indexing assignment removes Diagonal property from matrix

Submitted by:  Rik <rik5>
Submitted on:  Mon 23 Jul 2012 08:35:13 PM UTC  
Category: InterpreterSeverity: 3 - Normal
Priority: 5 - NormalItem Group: None
Status: FixedAssigned to: Jordi GutiĆ©rrez Hermoso <jordigh>
Originator Name: Open/Closed: Closed
Release: devOperating System: GNU/Linux

Add a New Comment(Rich Markup)

You are not logged in

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


Tue 17 Nov 2015 05:29:15 AM UTC, comment #2:

This is 3.5 years old, but I just fixed it with this changeset (http://hg.savannah.gnu.org/hgweb/octave/rev/cd1bd06974d8). Closing report.

Rik <rik5>
Project Administrator
Mon 23 Jul 2012 10:09:25 PM UTC, comment #1:

The complex->real thing seems to be a red herring. The problem is the linear indexing:

The offending code is here:


As you can see, it's checking for indexing of type a(i,i) to preserve diagonality, but it's not checking any other possible indexing types that could make sense (e.g. a(i,i,1) or a(i) where i = n^2).

I think I can handle this problem myself.

Jordi GutiƩrrez Hermoso <jordigh>
Project AdministratorIn charge of this item.
Mon 23 Jul 2012 08:35:13 PM UTC, original submission:

As a result of narrowing, the Diagonal property of a matrix is lost and the result is cast to a full matrix which unnecessarily increases storage requirements.

Example code:

Rik <rik5>
Project Administrator


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

Attach File(s):

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


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

    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 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 17 Nov 2015 05:29:15 AM UTCrik5StatusConfirmed=>Fixed
    Mon 23 Jul 2012 10:10:12 PM UTCjordighSummarylinear indexing assignment Diagonal property from matrix=>linear indexing assignment removes Diagonal property from matrix
    Mon 23 Jul 2012 10:09:59 PM UTCjordighStatusNone=>Confirmed
      Assigned toNone=>jordigh
      SummaryAutomatic complex->real narrowing removes Diagonal property from matrix=>linear indexing assignment Diagonal property from matrix

    Back to the top

    Powered by Savane 3.1-cleanup1