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: Hendrik K
Subject: [Octave-bug-tracker] [bug #63962] perms - Performance - Usage of native C++ algorithm helpful
Date: Mon, 27 Mar 2023 10:01:17 -0400 (EDT)

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

Another thing: Currently we change the permutation sort order when using
"unique" for numerical values. Having the same sort order with or without
"unique" seems more intuitive. 

Any special reason for this ? Can we change this ?



perms ([1, 2, 3])
          ans =

             3   2   1
             3   1   2
             2   3   1
             2   1   3
             1   3   2
             1   2   3

perms ([1, 2, 3],"unique")
          ans =

             1   2   3
             1   3   2
             2   1   3
             2   3   1
             3   1   2
             3   2   1

Note: I already implemented the same existing reversing logic for cell
arrays.
perms ({0.1, "foo", "foo"})
          ans =
          {
            [1,1] = foo
            [2,1] = foo
            [3,1] = foo
            [4,1] = foo
            [5,1] = 0.1000
            [6,1] = 0.1000
            [1,2] = foo
            [2,2] = 0.1000
            [3,2] = foo
            [4,2] = 0.1000
            [5,2] = foo
            [6,2] = foo
            [1,3] = 0.1000
            [2,3] = foo
            [3,3] = 0.1000
            [4,3] = foo
            [5,3] = foo
            [6,3] = foo
          }

perms ({0.1, "foo", "foo"},"unique")
          ans =
          {
            [1,1] = 0.1000
            [2,1] = foo
            [3,1] = foo
            [1,2] = foo
            [2,2] = 0.1000
            [3,2] = foo
            [1,3] = foo
            [2,3] = foo
            [3,3] = 0.1000
          }


    _______________________________________________________

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]