in reply to Re^5: [OT] Swapping buffers in place.
in thread [OT] Swapping buffers in place.

That is a fascinating algorithm! Here's my attempt to grok what's going on (swapped the Xn and Yn for alphas and numbers as X1 & Y1 look far too similar):

C:\test>1118256 0 1 2 3 4 5 6 7 8 9 0 1 2 3 tmp a b c d e f g h 1 2 3 4 5 6 ist her frm a [1]b c d e f g h 2 3 4 5 6 0 8 8 a 1 b d e f g h[c]2 3 4 5 6 0 2 2 a 1 b[3]d e f g h c 2 4 5 6 0 10 10 a 1 b 3 d f g h c 2[e]4 5 6 0 4 4 a 1 b 3 d[5]f g h c 2 e 4 6 0 12 12 a 1 b 3 d 5 f h c 2 e 4[g]6 0 6 6 b 1 3 d 5 f[a]h c 2 e 4 g 6 1 1 0 b 1[2]3 d 5 f a h c e 4 g 6 1 9 9 b 1 2 3 5 f a h c[d]e 4 g 6 1 3 3 b 1 2 3[4]5 f a h c d e g 6 1 11 11 b 1 2 3 4 5 a h c d e[f]g 6 1 5 5 b 1 2 3 4 5[6]a h c d e f g 1 13 13 b 1 2 3 4 5 6 a c d e f g[h] 1 7 7 3 1 2 4 5 6 a[b]c d e f g h 2 2 1 1 2[3]4 5 6 a b c d e f g h

But, it still needs a little work, I Ican't see how to fix it. Here's one of my basket case tests:

C:\test>1118256 0 1 2 3 4 5 6 7 8 tmp a b c d e f 1 2 3 ist her frm a [3]b c d e f 1 2 0 8 8 a 3 b c d e f 1 [2] 0 7 7 a 3 b c d e f [1]2 0 6 6 a 3 b c d e [f]1 2 0 5 5 a 3 b c d [e]f 1 2 0 4 4 a 3 b c [d]e f 1 2 0 3 3 a 3 b [c]d e f 1 2 0 2 2 a 3 [b]c d e f 1 2 0 1 1 a 3[a]b c d e f 1 2 1 1 0 3 a b c d e f 1 2

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". I'm with torvalds on this
In the absence of evidence, opinion is indistinguishable from prejudice. Agile (and TDD) debunked

Replies are listed 'Best First'.
Re^7: [OT] Swapping buffers in place.
by hdb (Monsignor) on Mar 01, 2015 at 18:09 UTC

    Your latter example a b c d e f 1 2 3 works for me calling swapbuffers 6, \@buffer. Your example looks as if you called swapbuffers 8, \@buffer. It also seems to be very similar to graff's proposal 1118234 that I do not quite understand still.

      Your example looks as if you called swapbuffers 8, \@buffer.

      You're exactly right! I changed the array, but not the number. I apologise. And thank you.

      It also seems to be very similar to graff's proposal 1118234 that I do not quite understand still.

      I "understand" his logic; but coding it defeated me before I needed sleep.

      And I now appear to have two working solutions, so I may never go back to it...


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority". I'm with torvalds on this
      In the absence of evidence, opinion is indistinguishable from prejudice. Agile (and TDD) debunked