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

 
 

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

Submitted by:  Mike Miller <mtmiller>
Submitted on:  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

Add a New Comment (Rich Markup)
   

You are not logged in

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

 

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>
Project Administrator

 

(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

 

CC list is empty

 

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
2021-05-27 mtmiller Carbon-CopyRemoved 80942 => -

Back to the top


Powered by Savane 3.6