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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER<br />

NINETEEN<br />

DENSE MATRICES USING A NUMPY<br />

BACKEND.<br />

Dense matrices using a NumPy backend.<br />

This serves as a base class for dense matrices over Real Double Field <strong>and</strong> Complex Double Field.<br />

AUTHORS:<br />

• Jason Grout, Sep 2008: switch to NumPy backend, factored out the Matrix_double_dense class<br />

• Josh Kantor<br />

• William Stein: many bug fixes <strong>and</strong> touch ups.<br />

EXAMPLES:<br />

sage: b=Mat(RDF,2,3).basis()<br />

sage: b[0]<br />

[1.0 0.0 0.0]<br />

[0.0 0.0 0.0]<br />

We deal with the case <strong>of</strong> zero rows or zero columns:<br />

sage: m = MatrixSpace(RDF,0,3)<br />

sage: m.zero_matrix()<br />

[]<br />

TESTS:<br />

sage: a = matrix(RDF,2,range(4), sparse=False)<br />

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

sage: a = matrix(CDF,2,range(4), sparse=False)<br />

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

class sage.matrix.matrix_double_dense.Matrix_double_dense<br />

Bases: sage.matrix.matrix_dense.Matrix_dense<br />

Base class for matrices over the Real Double Field <strong>and</strong> the Complex Double Field. These are supposed to<br />

be fast matrix operations using C doubles. Most operations are implemented using numpy which will call the<br />

underlying BLAS on the system.<br />

This class cannot be instantiated on its own. The numpy matrix creation depends on several variables that are<br />

set in the subclasses.<br />

EXAMPLES:<br />

349

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

Saved successfully!

Ooh no, something went wrong!