in reply to Re: Odometer pattern iterator (in C). (Updated.)
in thread Odometer pattern iterator (in C). (Updated.)

I know you won't like me saying this,

I have no problem with you saying it; though I somewhat fear what the consequence might be given previous examples.

this comment: “give me all 3-tuples in the domain 0..5 such that none of the values in the tuple are duplicated.” ... is actually interesting

So, the question is, where did he steal it from?

and the idea of using a recursive function also makes some sense (although, to tell the truth, I fail to see the relevance of ... the eight-queens problem

Exactly. None.

directly searching for all unique N-tuples in a set of M unique elements, I came up with this

You came up with a solution.

His posts are like those "Your Stars" astrology pieces in newspapers; so vague that you can read just about anything into them.

But your solution bears no resemblance to the "pseudo-code" he posted; and that bears no resemblance to any language I know; nor anything vaguely workable.

Computing almost 1.7m solutions in just over half a second is not too bad, it seems to me, but I have no idea on the dimensions of the actual problem you are trying to solve. This solution can easily be ported to C, I think, if performance needs to be higher.

Three thoughts:


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
  • Comment on Re^2: Odometer pattern iterator (in C). (Updated.)

Replies are listed 'Best First'.
Re^3: Odometer pattern iterator (in C). (Updated.)
by Laurent_R (Canon) on Jun 01, 2015 at 08:59 UTC
    How does it do on 32/16?

    Does it find all 601 million solutions? Does it come close to doing so in 5s?

    Yes, it finds 601 million solutions, but very very far from 5 sec.
    $ time perl N_among_M.pl 601080390 real 35m14.046s user 35m11.691s sys 0m0.108s