incorrect use of RNG in igraph_fisher_yates_shuffle.c

Bug #782619 reported by Minh Van Nguyen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
igraph
In Progress
Undecided
Gábor Csárdi

Bug Description

The test suite in the file

examples/simple/igraph_fisher_yates_shuffle.c

uses random number generators to generate random integers and random real numbers. But it doesn't first set the RNG seed. The result is that when trying to generate random integers with igraph_rng_get_integer(a,b), this function will consistently return the lower bound a. This can be fixed by first setting the RNG seed prior to invoking igraph_rng_get_integer(a,b). See the attachment for this fix.

Revision history for this message
Minh Van Nguyen (mvngu) wrote :
Revision history for this message
Gábor Csárdi (gabor.csardi) wrote :

Indeed, thanks. Added in #2465 (0.6-main).

Changed in igraph:
assignee: nobody → Gábor Csárdi (gabor.csardi)
status: New → In Progress
Revision history for this message
Gábor Csárdi (gabor.csardi) wrote : Continue on github

The development of igraph has moved to github, so please do not comment on this bug here. You are of course welcome to comment on github, here:
https://github.com/igraph/igraph/issues/437

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.