7.1.3 Design

Matrices are either immutable or not. When initially created, matrices are typically mutable, so one can change their entries. However, nothing about mutable matrices is cached. Once a matrix $ A$ is made immutable using A.set_immutable() the entries of $ A$ cannot be changed. However, properies of $ A$ such as its rank, characteristic polynomial, etc., are all cached so computations involving $ A$ may be more efficient. Once $ A$ is made immutable it cannot be changed back. However, one can obtain a mutable copy of $ A$ using A.copy().

The echelon form method always returns immutable matrices with known rank.

The module matrix.matrix defines the following methods:

_sparse_dot_product( v, w)

v and w are dictionaries with integer keys.

berlekamp( v)

Find minimal polynomial of a linear recurrence sequence.

The module matrix.matrix defines the following classes:

class Matrix
The Matrix class is the base class for all matrix classes.

class Matrix_dense_integer

class Matrix_dense_rational
The Matrix_dense_rational class derives from Matrix, and defines functionality for dense matrices over the field $ \mathbf{Q}$ of rational numbers.

class Matrix_domain

class Matrix_field

class Matrix_generic_dense
The Matrix_generic_dense class derives from Matrix, and defines functionality for dense matrices over any base ring.

class Matrix_generic_dense_domain

class Matrix_generic_dense_field

class Matrix_generic_dense_pid

class Matrix_generic_sparse
The Matrix_generic_sparse class derives from Matrix, and defines functionality for dense matrices over any base ring.

class Matrix_generic_sparse_domain

class Matrix_generic_sparse_field

class Matrix_generic_sparse_pid

class Matrix_integer

class Matrix_pid

class Matrix_sparse_integer

class Matrix_sparse_rational
The Matrix_sparse_rational class derives from Matrix, and defines functionality for sparse matrices over the field $ \mathbf{Q}$ of rational numbers.



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