#7111: timeout when doctesting partition refinement code
-----------------------+----------------------------------------------------
Reporter: was | Owner: tbd
Type: defect | Status: needs_review
Priority: blocker | Milestone: sage-4.2.1
Component: doctest | Keywords:
Work_issues: | Author:
Reviewer: | Merged:
-----------------------+----------------------------------------------------
Changes (by rlm):
* status: new => needs_review
Comment:
This was due to a bad assumption I made while I was writing
`refinement_matrices`. This fixes that assumption, and the fact that this
fixes at least the example above is shown here:
{{{
sage: M = matrix([[0, 18, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 4],
....: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 6, 0, 0,
0, 0],
....: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 15, 0, 0,
13, 0],
....: [0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 22,
0, 0, 0],
....: [0, 0, 14, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0,
0, 0, 0],
....: [0, 0, 13, 0, 0, 0, 21, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0],
....: [0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0,
0, 0, 0],
....: [0, 0, 18, 0, 3, 0, 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0],
....: [0, 12, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0,
0, 0, 0],
....: [0, 0, 2, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 21],
....: [0, 0, 0, 21, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 9, 0, 0, 0, 0, 0, 0,
0, 0],
....: [0, 11, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
21, 0],
....: [19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 17, 0, 0, 0,
0, 0, 0],
....: [0, 1, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0,
0, 0, 0],
....: [0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 0, 0, 0,
0, 0],
....: [0, 0, 0, 0, 0, 11, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0],
....: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 12, 0, 0, 10, 0, 0,
0, 0, 0],
....: [0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17,
0, 0, 0],
....: [0, 0, 2, 11, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0],
....: [0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 10, 0, 0,
0, 0, 0]])
sage: perm = [15, 5, 17, 20, 10, 3, 21, 7, 11, 8, 4, 16, 19, 2, 9, 12, 6,
22, 14, 0, 13, 18, 1]
sage: from sage.groups.perm_gps.partn_ref.refinement_matrices import
MatrixStruct
sage: MS = MatrixStruct(M)
sage: MS.run()
sage: N = Matrix(M.base_ring(), M.nrows(), M.ncols())
sage: for j in range(M.ncols()):
....: N.set_column(perm[j], M.column(j))
....:
sage: NS = MatrixStruct(N)
sage: NS.run()
sage: M_relab = MS.canonical_relabeling()
sage: N_relab = NS.canonical_relabeling()
sage: M_C = matrix(M.base_ring(), M.nrows(), M.ncols())
sage: N_C = matrix(M.base_ring(), M.nrows(), M.ncols())
sage: for j in range(M.ncols()):
....: M_C.set_column(M_relab[j], M.column(j))
....: N_C.set_column(N_relab[j], N.column(j))
....:
sage: M_C = matrix(M.base_ring(), sorted(M_C.rows()))
sage: N_C = matrix(M.base_ring(), sorted(N_C.rows()))
sage: M_C==N_C
True
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/7111#comment:2>
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 post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---