Digraphs icon indicating copy to clipboard operation
Digraphs copied to clipboard

Allow using random sources in Random* constructors?

Open fingolfin opened this issue 6 years ago • 5 comments

It would be nice if the various Random* constructors allowed passing in an optional IsRandomSource object (and used it appropriately). One could use InstallMethodWithRandomSource to help with the work.

fingolfin avatar Aug 27 '19 23:08 fingolfin

Good suggestion! We will try to incorporate this suggestion in a future version of Digraphs. PR's always welcome :)

james-d-mitchell avatar Sep 16 '19 08:09 james-d-mitchell

One thing that needs to be settled is conventions: Normally, the optional random source goes first; but also normally, the constructor filter goes first. Of course, for the constructor methods, this is fixed by GAP (the filter must be first); so I guess the natural thing is to copy that.

So I guess my suggestion would be that the "internal" constructors like RandomDigraphCons just get the random source added as a required argument. And then the "convenience" constructors, like RandomDigraph, have the random source optional. But if it not the first argument, then one can't use InstallMethodWithRandomSource.

A simple fix for that would be to turn RandomDigraph from an operation into a global function (or do you have reason to expect the need for people to install additional methods there?). Then it becomes rather simple to handle all the possible variants in one function. The alternative is to double the number of methods, I guess. While that also work, personally, I think this is one of these cases where one is better of without using method dispatch.

fingolfin avatar Sep 16 '19 08:09 fingolfin

Stale issue message

github-actions[bot] avatar Jan 07 '22 01:01 github-actions[bot]

I still think this useful. Not sure how useful it is to close it automatically as stale just because it's been around for a long time? Anyway, of course this is your call to make :-)

fingolfin avatar Jan 10 '22 17:01 fingolfin

Thanks @fingolfin, this is useful to know. I don't intend to close the issues because they are "stale" just to label them, I admit I have to figure out how to configure things so that the issues and PRs aren't closed!

james-d-mitchell avatar Jan 11 '22 10:01 james-d-mitchell

OK great!

And thank you for your efforts, it is indeed in general a "thankless job" (saw that label, like it :-) ) to deal with the load of unresolved issues and PRs on GitHub (saw

fingolfin avatar Jan 11 '22 10:01 fingolfin

Stale issue message

github-actions[bot] avatar Mar 13 '22 01:03 github-actions[bot]