bugGNU Octave - Bugs: bug #60680, arrayfun should support...

 
 

bug #60680: arrayfun should support user-defined class arrays that support linear indexing

Submitter:  Mike Miller <mtmiller>
Submitted:  Thu 27 May 2021 10:17:53 PM UTC
   
 
Category:  Octave Function Severity:  1 - Wish
Priority:  5 - Normal Item Group:  Feature Request
Status:  None Assigned to:  None
Originator Name:  Open/Closed:  * Open
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Post a Comment

Add a New Comment Rich Markup
   

Discussion

Thu 27 May 2021 10:17:53 PM UTC, original submission:  

The built-in arrayfun function should support user-defined classes that can implement arrays of objects.

An example is the @sym class in the symbolic package:


>> A = sym([1, 2, 3]);
>> numel (A)
ans = 3
>> size (A)
ans =

   1   3

>> A(1)
ans = (sym) 1
>> A(end)
ans = (sym) 3
>> arrayfun (@(x) pi, A)
ans = 3.1416


The last shows that arrayfun only returns 1 value, so it treats the @sym object as a single scalar. It should return a 1×3 vector:


>> arrayfun (@(x) pi, double (A))
ans =

   3.1416   3.1416   3.1416


Mike Miller <mtmiller>
Group Member

 

Attached Files

This item currently has no attached files.

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

Attach Files:
   
   
Comment:
   

 

Dependencies

This item does not depend on any other items.

No items depend on this one.

 

Mail Notification Carbon-Copy List

Carbon-Copy List
  • -email is unavailable- added by tutissanalio
  •  

    Votes

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    History

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-12-27 tutissanalio Carbon-Copy- Added tutissanalio
    2021-05-27 mtmiller Carbon-CopyRemoved 80942 -

    Back to the top

    Powered by Savane 3.16-ed84.
    Corresponding source code