bugGNU Octave - Bugs: bug #47510, arrayfun errors on indexing...

 
 

bug #47510: arrayfun errors on indexing diagonal matrix

Submitted by:  Carnë Draug <carandraug>
Submitted on:  Wed 23 Mar 2016 05:23:03 PM UTC  
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Confirmed Assigned to:  None
Originator Name:  Open/Closed:  Open
Release:  dev Operating System:  GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Thu 24 Mar 2016 04:33:10 AM UTC, comment #4:

Actually, I see your point. I must have been mistaken in my test script.

Rik <rik5>
Project Administrator
Thu 24 Mar 2016 04:05:26 AM UTC, comment #3:

I think my original suggestion is correct, at least it works for me without sub2ind.

From the specification, only one column in each row has a 1 in it. Therefore I created indices (i,j) where i runs over the rows (1:N) and the j index is provided by the vector Y.

Rik <rik5>
Project Administrator
Thu 24 Mar 2016 02:50:24 AM UTC, comment #2:

@Rik: I think you meant:

not that it matters here :)

Amro <amro_octave>
Wed 23 Mar 2016 08:34:25 PM UTC, comment #1:

Confirmed, although the code is really poorly written to do the job stated by the author on StackOverflow. I think the code below is clearer.

To help narrow it down, it is possible to index diagonal arrays either on the command line or in a function (m-file). A little use of grep shows that the message "can't perform indexing operations" is only in libinterp/octave-value/ov-base.cc for either subsref or do_index_op.

I set some breakpoints and tried the code and I got the following backtrace.

Rik <rik5>
Project Administrator
Wed 23 Mar 2016 05:23:03 PM UTC, original submission:

Reported on stackoverflow https://stackoverflow.com/questions/36182328/why-this-octave-code-wont-work

Carnë Draug <carandraug>
Project Member

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by amro_octave (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by carandraug (Submitted the item)
  •  

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

    Only project members can vote.

     

     

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-03-23 rik5 StatusNone => Confirmed

    Back to the top


    Powered by Savane 3.3