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

Add a New Comment Rich Markup
   

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

 

(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 tutissanalio
  •  

    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.

     

    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.13-4b48.
    Corresponding source code