| |
|
|
p.specht
| The Datenstruktur DEQue (double Ended billiardcue, Warteschlange with two terminate) becomes for some Algorithms used, about The Melkman-Hüllensuche. for over 400 items in the queue becomes The here implementierte Variante though slow. But at least can so too reale Warteschlangensysteme, about on Supermarktkassen, on Effektivität investigating.
' DEQ.inc
Proc DEQHelp
font 2:Cls:Print:"\n\n============================================================"
Print " D E Q H e l p"
Print "============================================================"
Print "\n CLEAR q&[] ' native XProfan ":Print " sz& = SizeOf(q&[]) ' sz=5 means: 0,1,2,3,4 "
Print " SetSize q&[],sizeof(q&[])+1 ' extended aray circa 1 place "
Print " MakeIndexDEQ(q&[],n&) ":Print " MakeRevertIndexDEQ(q&[],n&) "
Print " MakeConstDEQ(q&[],n&,wert&) ":Print "\n ShowDEQ q&[],nw& ' Temporary NumWidth "
Print "\n Wert&= PopBtm(q&[]) ' -999999999 = OutOfRange Error "
Print " Wert&= PopTop(q&[]) ' or -999999999 ":Print " PutTop Wert&,q&[] "
Print " PutBtm Wert&,q&[] ":Print "\n Wert&= CopyBtm(q&[]) "
Print " Wert&= CopyTop(q&[]) ' -999999999 ":Print " Wert&= CopyFromDEQ(q&[],n&) "
Print "\n LogVgl&=CmpInDEQ(q&[],n&,m&)' n=Pos1,m=Pos2: <1,'=0',>-1 "
Print "\n NisM&= SwapInDEQ(q&[],n&,m&)' (N=M)=1, -999999999 "
Print " Wert&= DelFromDEQ(q&[],n&) ":Print " DEQHelp ' this Text ausgeben":waitinput :endproc
:proc MakeIndexDEQ :parameters q&[],n&:SetSize q&[],n&:q&[]=&index+1:endproc
:proc MakeRevertIndexDEQ :parameters q&[],n&:SetSize q&[],n&:q&[]=n&-&index:endproc
:proc MakeConstDEQ :parameters q&[],n&,wert&:SetSize q&[],n&:q&[]=Wert&:endproc
:Proc PopBtm :parameters q&[]:var sz&=sizeof(q&[]):if sz&>0:var wert&=q&[0]
q&[]=q&[&index+(&index<(sz&-1))]:setsize q&[],sizeof(q&[])-(sz&>0):return wert&
else :return int(-999999999):endif :endproc
:proc PopTop :parameters q&[]:declare wert&:var sz&=sizeof(q&[]):if sz&>0:wert&=q&[sz&-1]
else :wert&=int(-999999999):endif :setsize q&[],sz&-(sz&>0):return wert&:endproc
:Proc PutTop :parameters Wert&,q&[]:var sz&=sizeof(q&[]):inc sz&:setsize q&[],sz&:q&[sz&-1]=Wert&:endproc
:Proc PutBtm :parameters Wert&,q&[]:declare tmp&[]:var sz&=sizeof(q&[]):inc sz&
setsize q&[],sz&:tmp&[]=q&[]:q&[]=tmp&[&index-(&index>0)]:clear tmp&[]:q&[0]=Wert&:endproc
:Proc CopyBtm :parameters q&[]:var sz&=sizeof(q&[]):if sz&>0:return q&[0]
else :return int(-999999999):endif :endproc
:proc CopyTop :parameters q&[]:declare wert&:var sz&=sizeof(q&[])
if sz&>0:wert&=q&[sz&-1]:else :wert&=int(-999999999):endif :return wert&:endproc
:proc ShowDEQ :parameters q&[],nw&:var tmp&=get("numwidth"):set("numwidth",nw&)
var sz&=sizeof(q&[]):print tab(2);"n=";sz&;": ";:whileloop 0,sz&-1:print q&[&Loop],
endwhile :print:set("numwidth",tmp&):endproc
:proc CopyFromDEQ :parameters q&[],n&:declare wert&:var sz&=sizeof(q&[])
if (sz&>0) and (n&>=0) and (n&<sz&):wert&=q&[n&]:else :wert&=int(-999999999):endif :return wert&:endproc
:Proc CmpInDEQ :parameters q&[],n&,m&
var sz&=sizeof(q&[]):if (sz&>0) and (n&>=0) and (n&<sz&) and (m&>=0) and (m&<sz&)
return int((q&[n&]<q&[m&])-(q&[n&]>q&[m&])):else :return int(-999999999):endif :Endproc
:Proc SwapInDEQ :parameters q&[],n&,m&'Swaps two elements in billiardcue
var sz&=sizeof(q&[]):if (sz&>0) and (n&>=0) and (n&<sz&) and (m&>=0) and (m&<sz&):var tmp&=q&[n&]
q&[n&]=q&[m&]:q&[m&]=tmp&:return int(n&<>m&):else :return int(-999999999):endif :endproc
:proc DelFromDEQ :parameters q&[],n&:var sz&=sizeof(q&[]) :declare wert&
if (sz&>0) and (n&>0) and (n&<sz&):wert&=q&[n&]:q&[]=q&[&index+(&index>=n&)*(&index<(sz&-1))]
dec sz&:setsize q&[],sz&:else :wert&=int(-999999999):endif :return wert&
endproc
|
|
|
| Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'... | 08/13/14 ▲ |
|
|
|
|
p.specht
| and How power to the there supra now to a Codeabschnitt without Smilies? |
|
|
| XProfan 11Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'... | 08/14/14 ▲ |
|
|
|
|
Paul Glatz |
|
|
| |
|
|
|
p.specht
| |
|
| XProfan 11Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'... | 08/14/14 ▲ |
|
|
|
|
| Huhu,
is the Topic rather here [...] aufgehoben?
|
|
|
| |
|
|
|
p.specht
| under welchem cue would the someone there search, if it of Deque as concept never heard has? and wieso käme it then on The idea, screen 17 or so anzuklicken? but in copy speaks naturally nothing against it. greeting |
|
|
| XProfan 11Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'... | 08/19/14 ▲ |
|
|
|
|
| the could You of my opinion to but too quite different see.
If it under Source lying and someone with the Suchfunktion to ever one this words seek:
Include DeQue double-ended billiardcue doppelseitige Warteschlange
then becomes there stand, that it one Topic under "Quelltexte" moreover gives and the seeking becomes so discern, that for it one View source-Fundstück bereitliegt.
against under "XPSE" is it thereafter less meaningfully einsortiert too because it not circa a View source Specifically for XPSE deals.
and additionally: your Profil [...] becomes so too correctly ausgefüllt because there there The Rubrik "Quelltexte/ Codesnippets" and there standing now Yes with you a 0 (zero) what Yes so then not is correct. |
|
|
| |
|
|
|
p.specht
| means bitteschön... where You right have have You naturally right... give but To deliberating: The thing is for practice not yet efficient enough: because of the versuchsweise chosen 'physischen Speicherverschiebung' is it (z.B. for Melkman-Algorithmus) unfortunately plenty too slow with more billiardcue-Lengths! I had Yes really hoped, that Microsoft the ohnehin irdenwie already as API realized has, though found I yet only what in Dot.Net and Visual C#, and there know I now really 'Nada' from. will be it soon time with Link-lists try... greeting |
|
|
| Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'... | 08/21/14 ▲ |
|
|
|
|
| Habs time moved the Topic...
time about... [...] the bring I my Saugroboter with so it in the program-X not complete verstumpft? |
|
|
| |
|
|
|
p.specht
| thanks. goes well sooner circa Vorarbeiten to a Verschnittoptimierung, or circa Oberfächenspannungsberechnung (How behaviour itself geschäumte materials) or circa Voraussetzungen for Voronoi- or Delauney-Algorithms (Funkzellen-optimization) or circa Erzeugung of new not-standard-Elementen for Finite-items-modes (FEM). |
|
|
| Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'... | 08/21/14 ▲ |
|
|
|
|
| I faith of course it To understand but my feeling says me too that I me there quite brill must. |
|
|
| |
|
|
|
p.specht
| You darst ! P.s.: Andrew's Monotone Chain Algorithm comes with a einfachen Stack from. Sozusagen the half-way Melkman, and therefore leichter To understand... |
|
|
| Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'... | 08/21/14 ▲ |
|
|
|