08.02.2015 Views

Sage Reference Manual: Matrices and Spaces of Matrices - Mirrors

Sage Reference Manual: Matrices and Spaces of Matrices - Mirrors

Sage Reference Manual: Matrices and Spaces of Matrices - Mirrors

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CHAPTER<br />

SEVEN<br />

BASE CLASS FOR MATRICES, PART 2<br />

Base class for matrices, part 2<br />

For design documentation see matrix/docs.py.<br />

AUTHORS:<br />

TESTS:<br />

• William Stein: initial version<br />

• Miguel Marco (2010-06-19): modified eigenvalues <strong>and</strong> eigenvectors functions to allow the option extend=False<br />

• Rob Beezer (2011-02-05): refactored all <strong>of</strong> the matrix kernel routines<br />

sage: m = matrix(ZZ[’x’], 2, 3, [1..6])<br />

sage: TestSuite(m).run()<br />

class sage.matrix.matrix2.Matrix<br />

Bases: sage.matrix.matrix1.Matrix<br />

The initialization routine <strong>of</strong> the Matrix base class ensures that it sets the attributes self._parent, self._base_ring,<br />

self._nrows, self._ncols. It sets the latter ones by accessing the relevant information on parent, which is <strong>of</strong>ten<br />

slower than what a more specific subclass can do.<br />

Subclasses <strong>of</strong> Matrix can safely skip calling Matrix.__init__ provided they take care <strong>of</strong> initializing these attributes<br />

themselves.<br />

The private attributes self._is_immutable <strong>and</strong> self._cache are implicitly initialized to valid values upon memory<br />

allocation.<br />

EXAMPLES:<br />

sage: import sage.matrix.matrix0<br />

sage: A = sage.matrix.matrix0.Matrix(MatrixSpace(QQ,2))<br />

sage: type(A)<br />

<br />

C<br />

Returns the conjugate matrix.<br />

EXAMPLE:<br />

sage: A = matrix(QQbar, [[ -3, 5 - 3*I, 7 - 4*I],<br />

... [7 + 3*I, -1 + 6*I, 3 + 5*I],<br />

... [3 + 3*I, -3 + 6*I, 5 + I]])<br />

sage: A.C<br />

[ -3 5 + 3*I 7 + 4*I]<br />

119

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!