-
Notifications
You must be signed in to change notification settings - Fork 27
Randomseed #257
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
base: master
Are you sure you want to change the base?
Randomseed #257
Conversation
|
Thanks for the enhancements! Suggestions:
|
|
I updated the initial comment: msolve now accepts long options such as --verbose, --linear-algebra. The tentative -a for giving the random-seed has been removed and is now called --random-seed. I think it is now ready for review. |
vneiger
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here are a few minor changes (the only real change is the suggestion of unsigned for seed).
src/msolve/main.c
Outdated
| switch(opt) { | ||
| case 0: /* no short option equivalent */ | ||
| if (random_seed_flag == 1) { | ||
| *seed = strtol(optarg, NULL, 10); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| *seed = strtol(optarg, NULL, 10); | |
| *seed = strtoul(optarg, NULL, 10); |
src/msolve/main.c
Outdated
| int32_t precision = 64; | ||
| int32_t refine = 0; /* not used at the moment */ | ||
| int32_t isolate = 0; /* not used at the moment */ | ||
| int32_t seed = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| int32_t seed = 0; | |
| uint32_t seed = 0; |
src/msolve/msolve.c
Outdated
| real_pts_ptr, | ||
| gens, | ||
| initial_hts, unstable_staircase, nr_threads, max_pairs, | ||
| initial_hts, unstable_staircase, nr_threads, max_pairs, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is a mix of tabs and spaces here
src/msolve/msolve.c
Outdated
| if (info_level > 0) { | ||
| printf ("\nRestarting with a non-random linear form"); | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| } | |
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(keep the previous: spaces and not tabs)
| if (info_level > 0) { | ||
| printf ("\nRestarting with another random linear form"); | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| } | |
| } |
(keep existing: no tab)
|
I think it is now ready for review. |
…tic is introduced
Co-authored-by: Vincent Neiger <vneiger@users.noreply.github.com>
…options as long option only
…argument -1, any nonnegative 32-bit integer can be a seed now
Co-authored-by: Vincent Neiger <vneiger@users.noreply.github.com>
|
Rebased after merging of #256. |
This PR introduces the possibility to use long options of type --long-options in msolve. Some short options now have a long option equivalent (-v --verbose, -V --version, -l --linear-algebra, etc.). The help page has been reworked to display these alternative long options.
It also introduces the possibility for the user to give the seed to initialize the pseudo-random number generator with option --random-seed (no equivalent short option is provided). If -1 is given, then time(0) is used as before. Otherwise, the input 32-bit nonnegative number N is used.
Observe that the latter should only be used for debug purpose only.
It also cleans the code as only one call to srand is performed now.
A bug was introduced in positive characteristic with No more random linear form over Q #249 where the introduction of a random linear form would make msolve quit at some point without outputting the result. This PR fixes this behaviour.