7.1.3.6 Matrix_generic_dense Objects

class Matrix_generic_dense
The Matrix_generic_dense class derives from Matrix, and defines functionality for dense matrices over any base ring. Matrices are represented by a list of elements in the base ring, and element access operations are implemented in this class.
Matrix_generic_dense( parent, [entries=True], [coerce_entries=True], [copy=0])

Instances of class Matrix_generic_dense have the following methods (in addition to inherited methods and special methods):

antitranspose,$  $ list,$  $ transpose

Further documentation:

transpose( )

Returns the transpose of self, without changing self.

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

sage: M = MatrixSpace(RationalField(), 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]

Instances of class Matrix_generic_dense also have the following special methods:

__getitem__,$  $ __setitem__,$  $ _entries

Further documentation:

__getitem__( ij)

INPUT:
    A[i, j] -- the i,j of A, and
    A[i]    -- the i-th row of A.

__setitem__( ij, value)

INPUT:
    A[i, j] = value -- set the (i,j) entry of A
    A[i] = value    -- set the ith row of A

See About this document... for information on suggesting changes.