Nп/п : 6 из 100
 От   : none) (albert                       2:5075/128        24 сен 23 11:57:19
 К    : L W                                                   24 сен 23 13:00:03
 Тема : Re: Order preserving Sort algorithm ?
----------------------------------------------------------------------------------
                                                                                 
@MSGID:
36d22509
@REPLY:
<8e107102-2533-4e85-a077-5ab8d50db695n@googlegroups.com> 8c19dcb2
@REPLYADDR none) (albert
@REPLYTO 2:5075/128 none) (albert
@CHRS: CP866 2
@RFC: 1 0
@RFC-References:
<b0ac03f1-f64f-4fef-aa9a-f48badb438c6n@googlegroups.com> <8e107102-2533-4e85-a077-5ab8d50db695n@googlegroups.com>
@RFC-Message-ID:

@TZUTC: 0200
@TID: FIDOGATE-5.12-ge4e8b94
In article <8e107102-2533-4e85-a077-5ab8d50db695n@googlegroups.com>,
L W  <logicweavers@gmail.com> wrote:
>On Saturday, September 2, 2023 at 2:51:16 PM UTC-5, Bob Armstrong wrote:
>> It`s been too long since I checked comp.lang.forth . comp.lang.apl has
>too little activity to bother with & I didn`t realize that is far from
>true here .
>>
>> Anybody got a good ` sort algorithm ?
>> I`ve been working on getting all my accounting " business ready " in
>CoSy . It`s only been in the last few years approaching the facilities I
>had in my legacy K ( Kx.com ) CoSy .
>> See my SV-FIG presentation :
>https://www.cosy.com/CoSy/y23/SV-FIG_20230826_commentary.html .
>> I am surprised to find I never implemented a variant of the sort
>algorithm I use , https://cosy.com/4thCoSy/Code/CoSy/sort.f , for floats
>.
>> The fundamental algorithm , while impressively elegant has a more
>pervasive problem that it is not order preserving on identical elements
>. That means if sorting a table using the permutations associated with a
>sort , the equal elements in sorting of a later column can disrupt the
>order of previously sorted columns .
>> APLs & K only return the sorting permutation , aka ` grade , rather
>than the sorted list itself . I`ve yet to figure out how to get the
>permutation ( to apply to all columns in a table ) w/o doing the sort
>itself .
>> In any case , if anyone has an order preserving sort which applies to
>floats as well as ints & strings , let us know .
>
>Seems to me the only time sorting meant anything was to prepare data to
>be saved to a GCR tape.  Even a tape-to-tape merge/purge from ancient
>times is essentially a source to destination sort only having to
>actually sort the introduced data.  So let`s modernize ... Loading the
>table elements, given a data standardization exists, into a b+tree index
>solves the issues.  1) Never have to sort in the first place.  2) Add or
>remove data any time.  3) Drill down ability.   4) On an Intel system
>the space is trivial.  5) Order added is preserved on duplicates.   6)
>Why are you sorting in the first place?  7) Is there a real need to
>sort? Well, besides a human data presentation?
>
>This comment comes on following an understanding of temperature
>measurement and dealing with the associated instrumentation, say an `S`
>type thermocouple.  The linearization process is to keep performing a
>7th order polynomial against the acquisition data or calc it once and
>have a lookup table based on said values.  Well, CM would say "Calc it",
>as memory was rather expensive and limited `in the day`, not so much
>now, "as there is likely enough processor to do so".  When you have 32
>bit processors that can run on a 3V lithium coin cell for a decade+
>while transmitting sub-GHz data every minute or so the entire while, the
>battery will die of old age before you deplete it, energy usage is now
>paramount.  Maybe you need to factor your concept on needing to sort ...
>
>Sorting seems from days past a way to benchmark a system ... And only thus.
>
>Just put the data into the index in the first place.  The index is the
>table.  Forward, backward, subsets, content, selective resolution,
>duplicate check, expansion and contraction, you decide the data
>selection.  Sorting ... LOL

You can`t give hard and fast rules with respect to sorting in
general.

One of my jobs was to sort (actually merge unsorted data unto) to the
most prestigious Dutch dictionary (de dikke van Dalen). 1]
1. It makes no sense to have an index into this kind of jobs.
A dictionary is a stream of characters, only during sorting it is
considered a heap of records.
2. The rules for comparison were so complicated that the program code
for comparison run over several pages. They went to great length to
prevent a situation that paragraphs sorted equal.
So "stable sorting" ... LOL

1] This was an overnight job on the PDP. My job was to create an VAX
program in c exactly equivalent to the previous assembler program.
It run in minutes, and was actually io-bound.

Groetjes Albert
-- 
Don`t praise the day before the evening. One swallow doesn`t make spring.
You must not say "hey" before you have crossed the bridge. Don`t sell the
hide of the bear until you shot it. Better one bird in the hand than ten in
the air. First gain is a cat spinning.            - the Wise from Antrim -
--- trn 4.0-test77 (Sep 1, 2010)
 * Origin: KPN B.V. (2:5075/128)
SEEN-BY: 5001/100 5005/49 5015/255 5019/40 5020/715
848 1042 4441 12000
SEEN-BY: 5030/49 1081 5058/104 5075/128
@PATH: 5075/128 5020/1042 4441



   GoldED+ VK   │                                                 │   09:55:30    
                                                                                
В этой области больше нет сообщений.

Остаться здесь
Перейти к списку сообщений
Перейти к списку эх