-
Notifications
You must be signed in to change notification settings - Fork 162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Permutations from Random Sources #573
Conversation
Most of the time in We could get another 20% of speedup be skipping method selection completely:
Should we maybe document |
Nice that it speeds it up. We should do this more widely for many reasons. The problem with skipping method selection entirely is that it would mean the function only worked for Mersenne Twister random sources and not other kinds (I presume). Do we care? One possible solution would be have an Operation for IsRandomSource that returned a function that did RandomList or RandomInteger from the source. So something like
this lifts the method selection outside the loop. It's an approach we could adopt in (some) other situations where method selection overhead is a concern. |
I have made a few experiments. I'm a bit puzzled why the variants
and
give no speedup at all compared to the version of Independent of this (and more generally not only for |
@frankluebeck I can see good uses for |
This has gone quiet. The discussion about |
Or instead don't let those tests output any values that depend on randomness! In any case, I agree that this should just be merged. Sure, we can perhaps do "even better", but that should not be a reason to block an improvement. |
@stevelinton I can certainly fix the tests in pperm.tst and trans.tst, their output should not depend on randomness, I agree this is bad. I'll try to do it today, or tomorrow. |
What I've done to test the random permutation generation is to use a new random source in the test, with a set seed, so it does depend on randomness in a sense, but isn't vulnerable to unexpected changes elsewhere. I agree though, that not using randomness unless it's actually needed is probably better. |
8bfb358
to
e529b19
Compare
@james-d-mitchell did you have any chance to do this yet? |
@markuspf not yet, I don't have time at present. Maybe next week. |
What's the status of this? At the very least it should rebased; might also wait for #810 to be merged and then make use of it to simpliify this PR a bit. And What is the status of those tests? @james-d-mitchell ? Also, it seems @stevelinton is currently absent from discussions here, so somebody else may have to do the rebase etc. in a new PR? |
I see I'm mentioned here, but I can't locate this comment on github. Should
I do something? I don't recall being involved in this...
…On Fri, 13 Jan 2017 at 19:21 Max Horn ***@***.***> wrote:
What's the status of this? At the very least it should rebased; might also
wait for #810 <#810> to be merged
and then make use of it to simpliify this PR a bit. And What is the status
of those tests? @james-d-mitchell </~https://github.com/james-d-mitchell> ?
Also, it seems @stevelinton </~https://github.com/stevelinton> is currently
absent from discussions here, so somebody else may have to do the rebase
etc. in a new PR?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#573 (comment)>, or mute
the thread
</~https://github.com/notifications/unsubscribe-auth/AGYFd1kksuVtVpCggGPITVMDoiA9VzOuks5rR85pgaJpZM4HRYw9>
.[image: Web Bug from
/~https://github.com/notifications/beacon/AGYFdwBkaGKrGHqTnpQXizj4HAYj8ccAks5rR85pgaJpZM4HRYw9.gif]
{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/gap-system/gap","title":"gap-system/gap","subtitle":"GitHub
repository","main_image_url":"
https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png
","avatar_image_url":"
https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open
in ***@***.***
in #573: What's the status of this? At the very least it should rebased;
might also wait for #810 to be merged and then make use of it to simpliify
this PR a bit. And What is the status of those tests? @james-d-mitchell
?\r\n\r\nAlso, it seems @stevelinton is currently absent from discussions
here, so somebody else may have to do the rebase etc. in a new
PR?"}],"action":{"name":"View Pull Request","url":"
#573 (comment)"}}}
|
@fingolfin I can do rebase and the like. @james-d-mitchell The tests in pperm.tst used to be broken in this PR, let me try to rebase this PR and look whether this is still the case. |
Ok, I see get it, I'll try to fix it this week. |
of making Random permutations for testing.
e529b19
to
de47e45
Compare
Rebased. There are still a couple of errors in pperm.tst |
@stevelinton I fixed the pperm test, if you rebase this once more, we should hopefully see the tests passing |
@fingolfin thanks for fixing the tests and sorry I didn't find time to do it myself |
@james-d-mitchell no worries :) @stevelinton @ChrisJefferson Since PR #810 has been merged now, I suppose this PR should also be adapted to use |
@stevelinton Any chance for a rebase? @markuspf alternativly, perhaps you could revive PR #1080 ? This is now over a year old and still not merged. |
This has been superseded by PR #1165 |
Allows
Random( <random-source>, SymmetricGroup(<n>))
and the like.Breaks pperm and trans tests due to changes to number of calls to the global random source, or something. The best solution would be RandomPartialPerm and similar to accept a Random Source and then use one in testing.