bugGNU Octave - Bugs: bug #58116, Feature Request: missing option...


bug #58116: Feature Request: missing option "all" for several functions - sum, mean, and others

Submitter:  Nicholas Jankowski <nrjank>
Submitted:  Sat 04 Apr 2020 10:58:00 PM UTC
Category:  Octave Function Severity:  2 - Minor
Priority:  5 - Normal Item Group:  Feature Request
Status:  Confirmed Assigned to:  None
Originator Name:  Nicholas Jankowski Open/Closed:  * Open
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup

Jump to the original submission

Wed 01 Mar 2023 06:37:21 PM UTC, comment #6: 

update: patch #10314 was pushed to core which adds matlab compatible dim handling, including the "all" option, for mean, median, var, and std. no change to other mfiles yet nor any compiled functions in comment #3 list.

Nicholas Jankowski <nrjank>
Group Member
Wed 03 Nov 2021 04:01:04 AM UTC, comment #5: 

note that the latest patch submitted to patch # 10103 adds vector and "all" dim options to std and var

Nicholas Jankowski <nrjank>
Group Member
Tue 15 Dec 2020 01:13:31 AM UTC, comment #4: 

so what is the equivalent in the compiled functions?

Nicholas Jankowski <nrjank>
Group Member
Sat 04 Apr 2020 11:56:09 PM UTC, comment #3: 

Yep. no idea what the fast C++ equivalent is, since I only play in m-space.

from that list:

m-files are:
bounds, mean, median, mode, std, var

cc files are:
all, any, max, min, prod

Nicholas Jankowski <nrjank>
Group Member
Sat 04 Apr 2020 11:28:28 PM UTC, comment #2: 

Changed the severity to "Minor" since there is an easy workaround that is supported by both Matlab and Octave.

Rik <rik5>
Group administrator
Sat 04 Apr 2020 11:27:15 PM UTC, comment #1: 

Changed the release to "dev" since this is new development that will need to take place on that branch.

Agree, this seems like a fairly easy feature to implement.

1) Check dim argument to see if it is text (ischar())
2) Check that argument == "all" (strcmp ())
3) Call all(A(:)), or the equivalent in C++

Rik <rik5>
Group administrator
Sat 04 Apr 2020 10:58:00 PM UTC, original submission:  

in v2018b, Matlab added the 'all' option for a number of functions. 

This was mentioned related to another missing option in: https://savannah.gnu.org/bugs/?func=detailitem&item_id=58089#comment1

which states it applies to "all, any, bounds, max, min, mean, median, mode, prod, std, and var".

This was noticed on the mailing list regarding the sum function when a new user tried to port over some code.

while bug #58089 was about a the option where the functions take a vector dimensions for multiple summation, the "all" function should be fairly trivial to implement as:

if "all" --> A = A(:), continue sum operation

At first glance at the function list it looks like this approach should apply to them all.

Nicholas Jankowski <nrjank>
Group Member


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

Attach Files:

No files currently attached


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

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

    Date Changed by Updated Field Previous Value => Replaced by
    2023-01-24 nrjank Dependencies- bugs #63698 is dependent
    2022-09-26 nrjank Dependencies- bugs #63107 is dependent
    2020-04-04 rik5 Severity3 - Normal 2 - Minor
    2020-04-04 rik5 Item GroupMatlab Compatibility Feature Request
        StatusNone Confirmed
        Release5.2.0 dev
        SummaryMatlab Compatibility: missing option &quot;all&quot; for several functions - sum, mean, and others Feature Request: missing option "all" for several functions - sum, mean, and others

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code