Base class for dense matrices

class sage.matrix.matrix_dense.Matrix_dense[source]

Bases: Matrix

antitranspose()[source]

Return the antitranspose of self, without changing self.

EXAMPLES:

sage: A = matrix(2,3,range(6)); A
[0 1 2]
[3 4 5]
sage: A.antitranspose()
[5 2]
[4 1]
[3 0]
>>> from sage.all import *
>>> A = matrix(Integer(2),Integer(3),range(Integer(6))); A
[0 1 2]
[3 4 5]
>>> A.antitranspose()
[5 2]
[4 1]
[3 0]
A = matrix(2,3,range(6)); A
A.antitranspose()
sage: A.subdivide(1,2); A
[0 1|2]
[---+-]
[3 4|5]
sage: A.antitranspose()
[5|2]
[-+-]
[4|1]
[3|0]
>>> from sage.all import *
>>> A.subdivide(Integer(1),Integer(2)); A
[0 1|2]
[---+-]
[3 4|5]
>>> A.antitranspose()
[5|2]
[-+-]
[4|1]
[3|0]
A.subdivide(1,2); A
A.antitranspose()
>>> from sage.all import *
>>> A.subdivide(Integer(1),Integer(2)); A
[0 1|2]
[---+-]
[3 4|5]
>>> A.antitranspose()
[5|2]
[-+-]
[4|1]
[3|0]
A.subdivide(1,2); A
A.antitranspose()
transpose()[source]

Return the transpose of self, without changing self.

EXAMPLES: We create a matrix, compute its transpose, and note that the original matrix is not changed.

sage: M = MatrixSpace(QQ,  2)
sage: A = M([1,2,3,4])
sage: B = A.transpose()
sage: print(B)
[1 3]
[2 4]
sage: print(A)
[1 2]
[3 4]
>>> from sage.all import *
>>> M = MatrixSpace(QQ,  Integer(2))
>>> A = M([Integer(1),Integer(2),Integer(3),Integer(4)])
>>> B = A.transpose()
>>> print(B)
[1 3]
[2 4]
>>> print(A)
[1 2]
[3 4]
M = MatrixSpace(QQ,  2)
A = M([1,2,3,4])
B = A.transpose()
print(B)
print(A)

.T is a convenient shortcut for the transpose:

sage: A.T
[1 3]
[2 4]
>>> from sage.all import *
>>> A.T
[1 3]
[2 4]
A.T
sage: A.subdivide(None, 1); A
[1|2]
[3|4]
sage: A.transpose()
[1 3]
[---]
[2 4]
>>> from sage.all import *
>>> A.subdivide(None, Integer(1)); A
[1|2]
[3|4]
>>> A.transpose()
[1 3]
[---]
[2 4]
A.subdivide(None, 1); A
A.transpose()
>>> from sage.all import *
>>> A.subdivide(None, Integer(1)); A
[1|2]
[3|4]
>>> A.transpose()
[1 3]
[---]
[2 4]
A.subdivide(None, 1); A
A.transpose()