You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mahout.apache.org by Benson Margulies <bi...@gmail.com> on 2009/12/31 03:10:33 UTC

[math] MAHOUT-235/GenericSorting, looking for a clue

Folks,

GenericSorting contains quick and merge sorts where the sort procedure
has no direct access to the data. It takes a swapper and a comparator,
and the idea is that the comparator takes the indices and uses them to
look in some mysterious place.

I am not understanding the implementation of quicksort, which is doing
things with the indices which I would expect to require access to the
values. Something tells me that this is old news.

--benson

Re: [math] MAHOUT-235/GenericSorting, looking for a clue

Posted by Benson Margulies <bi...@gmail.com>.
It is needed, but on the drive in this morning I thought of a
perfectly straightforward way to extend the code in Sorting to do what
it does.

It's got something that nothing else has:

sort (startIndex, endIndex, Comparator, Swapper)

but I can see how to add that without understanding the code we got
from CERN which is covered with comments indicating JDK derivation.

On Thu, Dec 31, 2009 at 7:01 AM, Grant Ingersoll <gs...@gmail.com> wrote:
> +1.  The JVM provides a mergeSort, right?  Lucene has a quickSort implementation that I believe is pretty fast.
>
> On Dec 31, 2009, at 1:09 AM, Ted Dunning wrote:
>
>> Nuke it if there isn't an obvious need for the code.
>>
>> (my opinion anyway)
>>
>> On Wed, Dec 30, 2009 at 6:10 PM, Benson Margulies <bi...@gmail.com>wrote:
>>
>>> Folks,
>>>
>>> GenericSorting contains quick and merge sorts where the sort procedure
>>> has no direct access to the data. It takes a swapper and a comparator,
>>> and the idea is that the comparator takes the indices and uses them to
>>> look in some mysterious place.
>>>
>>> I am not understanding the implementation of quicksort, which is doing
>>> things with the indices which I would expect to require access to the
>>> values. Something tells me that this is old news.
>>>
>>> --benson
>>>
>>
>>
>>
>> --
>> Ted Dunning, CTO
>> DeepDyve
>
>

Re: [math] MAHOUT-235/GenericSorting, looking for a clue

Posted by Grant Ingersoll <gs...@gmail.com>.
+1.  The JVM provides a mergeSort, right?  Lucene has a quickSort implementation that I believe is pretty fast.

On Dec 31, 2009, at 1:09 AM, Ted Dunning wrote:

> Nuke it if there isn't an obvious need for the code.
> 
> (my opinion anyway)
> 
> On Wed, Dec 30, 2009 at 6:10 PM, Benson Margulies <bi...@gmail.com>wrote:
> 
>> Folks,
>> 
>> GenericSorting contains quick and merge sorts where the sort procedure
>> has no direct access to the data. It takes a swapper and a comparator,
>> and the idea is that the comparator takes the indices and uses them to
>> look in some mysterious place.
>> 
>> I am not understanding the implementation of quicksort, which is doing
>> things with the indices which I would expect to require access to the
>> values. Something tells me that this is old news.
>> 
>> --benson
>> 
> 
> 
> 
> -- 
> Ted Dunning, CTO
> DeepDyve


Re: [math] MAHOUT-235/GenericSorting, looking for a clue

Posted by Ted Dunning <te...@gmail.com>.
Nuke it if there isn't an obvious need for the code.

(my opinion anyway)

On Wed, Dec 30, 2009 at 6:10 PM, Benson Margulies <bi...@gmail.com>wrote:

> Folks,
>
> GenericSorting contains quick and merge sorts where the sort procedure
> has no direct access to the data. It takes a swapper and a comparator,
> and the idea is that the comparator takes the indices and uses them to
> look in some mysterious place.
>
> I am not understanding the implementation of quicksort, which is doing
> things with the indices which I would expect to require access to the
> values. Something tells me that this is old news.
>
> --benson
>



-- 
Ted Dunning, CTO
DeepDyve