Opened 12 years ago

Last modified 12 years ago

#5714 closed defect

Mod-2 matrix output does not show subdivisions — at Version 2

Reported by: justin Owned by: tbd
Priority: major Milestone:
Component: algebra Keywords:
Cc: Merged in:
Authors: Reviewers:
Report Upstream: Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description (last modified by was)

This was reported on sage-support. The following shows what's going on:

sage: MS7=MatrixSpace(Integers(7),4,4)
sage: M=MS7.random_element()
sage: M.subdivide([2],[2])
sage: M

[6 1|3 4]
[4 4|0 5]
[4 2|2 6]
[5 6|3 3]
sage: MS2=MatrixSpace(Integers(2),4,4)
sage: N=MS2.random_element()
sage: N.subdivide([2],[2])
sage: N

[1 0 1 0]
[1 1 0 0]
[1 1 1 0]
[0 0 0 1]

See also #5176 for another issue and #5717 for another example.

Change History (2)

comment:1 Changed 12 years ago by justin

As I mentioned on the list, the Matrix_mod2_dense class has its own str() method that just returns a string representation of the matrix without taking subdivisions into account.

Removing that method seems to be benign, and lets the common print method for matrices take over, printing with subdivisions.

I have doctested the matrix directory without a problem. Someone involved in the initial implementations might want to comment.

I'll attach a patch when the testing is complete (or try again if testing fails).

comment:2 Changed 12 years ago by was

  • Description modified (diff)
Note: See TracTickets for help on using tickets.