[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #60364] New option "unique" for perms
From: |
Michael Leitner |
Subject: |
[Octave-bug-tracker] [bug #60364] New option "unique" for perms |
Date: |
Mon, 20 Jun 2022 03:10:46 -0400 (EDT) |
Follow-up Comment #8, bug #60364 (project octave):
With a one-line change (a sortrows() on the index array) the tests pass. It
does take a bit of efficiency, but it is still much faster than Arun's
implementation, also much faster than unique(perms(v),"rows"), and it has the
advantage that the restriction of reverse lexicographic ordering holding only
when "unique" is not given is not needed any more. Also, when the input vector
has no repetitions, specifying "unique" or not gives the same result (only
takes longer). For efficiency, I reintroduced the old code for the non-unique
case.
(file #53323)
_______________________________________________________
Additional Item Attachment:
File name: perms_m.m Size:7 KB
<https://file.savannah.gnu.org/file/perms_m.m?file_id=53323>
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?60364>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #60364] New option "unique" for perms,
Michael Leitner <=