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

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

[Octave-bug-tracker] [bug #63992] nchoosek has suboptimal performance


From: anonymous
Subject: [Octave-bug-tracker] [bug #63992] nchoosek has suboptimal performance
Date: Tue, 4 Apr 2023 04:44:18 -0400 (EDT)

Follow-up Comment #4, bug #63992 (project octave):

As I mentioned in the original submission, I concur that in general, native
octave language code for octave functions should  not be replaced as a general
rule only when it brings material benefits.

The benefits are also mentioned
- More straightforward algorithm to determine n over k numerically than in
octave code which uses a reasonably complex partial vectorization logic

- Usage of an elegant and fast algorithm to create n over k combinations of
elements relying on the standard std library function std:permutation
(permutations of a set of position logical values allows deriving the
combinations).

The achieved performance gains are material:
- calculating n over k is about five times faster
- creating all combinations of a set of items is about twice as fast.  

Whether this is enough can be discussed. I think yes (if not I had not put in
the effort) and no there are no other bugs in current nchoosek. 


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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