7.1.1.3 MatrixSpace_generic Objects

class MatrixSpace_generic
The space of all nrows x ncols matrices over base_ring.
MatrixSpace_generic( base_ring, nrows, [ncols=False], [sparse=None])

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

base_ring,$  $ basis,$  $ dimension,$  $ dims,$  $ gen,$  $ identity_matrix,$  $ is_dense,$  $ is_sparse,$  $ matrix,$  $ matrix_space,$  $ ncols,$  $ ngens,$  $ nrows,$  $ random_element

Further documentation:

matrix( [x=True], [coerce_entries=True], [copy=0])

Create a matrix in self. The entries can be specified either as a single list of length nrows*ncols, or as a list of lists.

sage: Z = IntegerRing()
sage: M = MatrixSpace(Z,2)
sage: M([[1,0],[0,-1]])
[ 1  0]
[ 0 -1]
sage: M([1,0,0,-1])
[ 1  0]
[ 0 -1]

random_element( [X=True], [prob=1.0], [coerce=[-2, -1, 1, 2]])

Returns a random element of self.

Instances of class MatrixSpace_generic also have the following special methods:

__call__,$  $ __cmp__,$  $ __repr__,$  $ _coerce_,$  $ _get_matrix_class,$  $ _latex_

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