Base class for dense matrices#
- class sage.matrix.matrix_dense.Matrix_dense[source]#
Bases:
Matrix
- antitranspose()[source]#
Returns 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]
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]
- transpose()[source]#
Returns 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]
.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]
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]