octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #63962] perms - Performance - Usage of native


From: John W. Eaton
Subject: [Octave-bug-tracker] [bug #63962] perms - Performance - Usage of native C++ algorithm helpful
Date: Tue, 28 Mar 2023 12:36:39 -0400 (EDT)

Follow-up Comment #20, bug #63962 (project octave):

Instead of using a series of if/else if statements or switch on data types,
I'd prefer to see a perms function added to the octave_value class, and then
dispatch using a virtual function in the octave_base_value class hierarchy. 
If I understand correctly, most of those would just forward to the template
function (currently GetPerms) but it looks like that could be moved to
liboctave as part of the Array class or as a separate template function
defined outside of class itself.

This arrangement would have the advantage of allowing perms to work for
octave_value objects without having to call a DEFUN function, and to also be
available for Array<T> objects directly, not just for octave_value objects.

As much as possible, I'd like to see DEFUN functions to do as little as
possible.  Usually that means argument processing and and then calling
octave_value methods.  Or, in some cases when the function only works on a
limited number of types, processing the values and calling liboctave or
standard library functions to do the real work.

It's not absolutely necessary that we make these changes before committing
this patch, but it is something that I'd like to make happen, not just for
this function, but for all the DEFUN functions in Octave.


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?63962>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]