[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #36372] Improved ranks.m included:
From: |
Mike Miller |
Subject: |
[Octave-bug-tracker] [bug #36372] Improved ranks.m included: |
Date: |
Tue, 22 Oct 2013 02:48:21 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.57 Safari/537.36 |
Update of bug #36372 (project octave):
Status: Need Info => Patch Submitted
_______________________________________________________
Follow-up Comment #9:
Pasting email reply and attachment from Dave below. Dave, please try to reply
on the bug tracker web interface, it does not respond at all to emails sent to
it.
> Hi Mike
>
> Been a while since I submitted this, so I am a bit hazy.
>
> But, it looks like in the current version, the slowness comes out when
> sorting on dim 2, as below:
>
> octave:4> version
> ans = 3.6.2
> octave:5> a=round(10*rand(100123,100));
> octave:6> tic; ranksmy(a,2); toc
> Elapsed time is 1.8450469971 seconds.
>
> (attaching the latest ranksmy.m I have, which is an adaptation of
> KH's original ranks.m, and .
>
> (1) Jordigh: The comments about "ugliness" were not mine, but
> KH's. I have removed them, nonetheless.
>
> Note (2) Secondly, this ranksmy.m, while equivalent to the
> built-in ranks.m by default, also provides several ranking
> variants in case of collisions: competition, fractional, modified
> competition, ordinal, reverse ordinal, and dense ranking. Again,
> unlike the original case, each is efficient, and none uses for
> loops.
>
>
> Now, let's try, for comparison, the built-in function:
>
> octave:7> tic; ranks(a,2); toc
> Elapsed time is 48.160676956 seconds.
>
> That's a factor of 25.
>
> Plus, the difference increases greatly as you increase the size, because
> one vectorizes and the other loops.
Ok, confirmed, I also get about 50 seconds when dim = 2.
(file #29438)
_______________________________________________________
Additional Item Attachment:
File name: ranksmy.m Size:5 KB
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?36372>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/