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

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

[Octave-bug-tracker] [bug #50426] perms() sort order different than Matl


From: anonymous
Subject: [Octave-bug-tracker] [bug #50426] perms() sort order different than Matlab
Date: Thu, 2 Mar 2017 05:56:18 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:40.0) Gecko/20100101 Firefox/40.0

Follow-up Comment #7, bug #50426 (project octave):

See the attached reworked perms.m. In my 3.8.0 it is slightly slower than the
original algorithm for large V (that is, length(V)==10), but about equally
efficient for length(V)==5. In the used algorithm, the indices are permuted n
times, while in the original one the values themselves are permuted. It seems
that in Octave this index permutation is most efficient when done in data type
double. In principle, here one would need to use only uint8, which would
correspond first to much less bits being moved around, and second all casts
from double to integer would become unnecessary. Perhaps in later Octave
versions integer addressing will become more efficient, then this could be
used here.

The new ordering should be correct, I hope.

(file #39878)
    _______________________________________________________

Additional Item Attachment:

File name: perms_new.m                    Size:2 KB


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?50426>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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