#15090: Make random matrices respect Sage's seed for random number generators
----------------------------------+--------------------------
Reporter: rbeezer | Owner:
Type: enhancement | Status: needs_work
Priority: major | Milestone: sage-6.2
Component: linear algebra | Resolution:
Keywords: | Merged in:
Authors: Rob Beezer | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
Dependencies: #11772 | Stopgaps:
----------------------------------+--------------------------
Description changed by jason:
Old description:
> GSL distributions are used in the creation of random matrices, so they
> need to be seeded with an integer from Sage's random number generators in
> order to make the results predictably random. Then the random matrices
> will be reproducible for doctests (#10122) and for WeBWorK homework
> exercises provided by !AskSage with a random seed from the WeBWorK
> system. Symptomatic of the current state is:
>
> {{{
> sage: from sage.matrix.constructor import random_rref_matrix
> sage: MS = MatrixSpace(QQ, 5, 8)
>
> sage: set_random_seed(666)
> sage: first = [random_rref_matrix(MS, 4) for _ in range(10)]
>
> sage: set_random_seed(666)
> sage: second = [random_rref_matrix(MS, 4) for _ in range(10)]
>
> sage: first == second
> False
> }}}
>
> Do not merge this ticket as-is. #15887 fixes the underlying issue with
> GSL. (Jason thinks the ticket should either be closed, or just the
> doctests should be put into the library, but not the code changes.)
>
> '''Apply:'''
>
> 1. [[attachment:trac_15090-random-matrix-seeds-v2.patch]]
New description:
GSL distributions are used in the creation of random matrices, so they
need to be seeded with an integer from Sage's random number generators in
order to make the results predictably random. Then the random matrices
will be reproducible for doctests (#10122) and for WeBWorK homework
exercises provided by !AskSage with a random seed from the WeBWorK system.
Symptomatic of the current state is:
{{{
sage: from sage.matrix.constructor import random_rref_matrix
sage: MS = MatrixSpace(QQ, 5, 8)
sage: set_random_seed(666)
sage: first = [random_rref_matrix(MS, 4) for _ in range(10)]
sage: set_random_seed(666)
sage: second = [random_rref_matrix(MS, 4) for _ in range(10)]
sage: first == second
False
}}}
Do not merge this ticket as-is. #15887 fixes the underlying issue with
GSL. (Jason thinks this ticket should either be closed, or just the
doctests should be put into the library, but not the code changes.)
'''Apply:'''
1. [[attachment:trac_15090-random-matrix-seeds-v2.patch]]
--
--
Ticket URL: <http://trac.sagemath.org/ticket/15090#comment:8>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/groups/opt_out.