Package sage :: Package linalg :: Module matrix :: Class Matrix_generic_sparse
[show private | hide private]
[frames | no frames]

Class Matrix_generic_sparse

Matrix --+
         |
        Matrix_generic_sparse

Known Subclasses:
Matrix_rational_sparse

A generic sparse matrix is a dictionary with keys pairs (i,j)
and entries in the base ring.
WARNING: We do not check that the i,j pairs satisfy
    0 <= i < nrows,  0 <= j < ncols.

Method Summary
  __init__(self, parent, entries, coerce_entries, copy)
  __getitem__(self, ij)
Access a matrix by A[i, j] to get entry i, j of A.
  __mul__(self, right)
  __rmul__(self, left)
  __setitem__(self, ij, value)
Set entry i,j of self to value.
  denominator(self)
  entries(self)
  get(self, ij)
Like __getitem__ but with no type or bounds checking.
  nonzero_positions(self)
Returns the set of pairs (i,j) such that self[i,j] != 0.
  set(self, ij, x)
Like __setitem__ but with no type or bounds checking.
  sparse_columns(self)
  sparse_rows(self)
  submatrix_from_columns(self, columns)
Return the submatrix of self of columns col[i] for i in the list of columns.
  submatrix_from_rows(self, rows)
Return the submatrix of self of rows row[i] for i in the list of rows.
  swap_rows(self, r1, r2)
Swap rows r1 and r2 of self.
  transpose(self)
Returns the transpose of self, without changing self.
    Inherited from Matrix
  __abs__(self)
  __add__(self, right)
  __cmp__(self, right)
  __div__(self, right)
  __invert__(self)
  __mod__(self, p)
  __neg__(self)
  __pos__(self)
  __pow__(self, n)
EXAMPLES:
  __radd__(self, right)
  __repr__(self)
  __str__(self)
  __sub__(self, right)
  add_multiple_of_column(self, i, j, s)
Replace column i by s times column j.
  add_multiple_of_row(self, i, j, s)
Replace row i by s times row j.
  augment(self, other)
Return the augmented matrix of the form [self | other].
  base_ring(self)
  block_sum(self, other)
Return the block matrix that has self and other on the diagonal: [self | 0 ] [ 0 | other ]
  change_ring(self, ring)
  charpoly(self)
  column_space(self)
  columns(self)
Returns the list of columns of self, as vectors.
  commutator(self, other)
  copy(self)
  decompose(self, is_diagonalizable)
Returns the decomposition of the vector space under the right action of self.
  decompose_subspace(self, V, is_diagonalizable)
Suppose A is a matrix acting on a vector space V, and W is a vector subspace of V.
  dense_row(self, n)
  det(self)
  determinant(self)
  echelon_form(self, *args)
Returns the reduced row echelon form INPUT: matrix -- an element A of a MatrixSpace OUTPUT: matrix -- The reduced row echelon form of A.
  fcp(self)
Return the factorization of the characteristic polynomial of self.
  height(self)
  hermite_normal_form(self)
  hessenberg_normal_form(self)
Compute and return the Hessenberg form of self.
  image(self)
  is_dense(self)
  is_invertible(self)
  is_matrix(self)
  is_sparse(self)
  is_square(self)
  kernel(self)
ALGORITHM: Elementary row ops don't change kernel, since they are just left multiplication by an invertible matrix, so we instead compute kernel of echelon form, which is easy.
  linalg_matrix(self)
  linear_combination_of_rows(self, v)
  list(self)
  matrix(self, nrows, ncols, entries, coerce_entries, copy)
  matrix_space(self, nrows, ncols)
  maxspin(self, v)
Computes the largest integer n such that the list of vectors S=[v, A(v), ..., A^n(v)] are linearly independent, and returns that list.
  ncols(self)
  nonpivots(self)
Return the list of i such that the i-th column of self is NOT a pivot column of the reduced row echelon form of self.
  nonzero_positions_in_column(self, i)
Return the integers j such that self[j,i] is nonzero, i.e., such that the j-th position of the i-th column is nonzero.
  nonzero_positions_in_row(self, i)
Return the integers j such that self[i,j] is nonzero, i.e., such that the j-th position of the i-th row is nonzero.
  nrows(self)
  nullity(self)
  parent(self)
  pari(self)
  pivots(self)
Return the i such that the i-th column of self is a pivot column of the reduced row echelon form of self.
  rank(self)
  rational_decomposition(self)
  rational_reconstruction(self)
  reduced_row_echelon_form(self, *args)
Returns the reduced row echelon form INPUT: matrix -- an element A of a MatrixSpace OUTPUT: matrix -- The reduced row echelon form of A.
  rescale_row(self, i, s)
Replace i-th row of self by s times i-th row of self.
  restrict(self, V, check)
Returns the matrix that defines the action of self on the invariant subspace V.
  row(self, i)
  row_space(self)
  rows(self)
  smith_normal_form(self)
  stack(self, other)
Return the augmented matrix self on top of other:...
  str_latex(self, hfill)
Print a latex matrix representation of self.
  str_sparse_latex(self, variable)
Return a latex string that represents this matrix as a sparse matrix.
  swap_columns(self, c1, c2)
Swap columns c1 and c2 of self.
  trace(self)
Return the trace of self, which is the sum of the diagonal entries of self.
  vector_matrix_multiply(self, v)
Returns the vector times matrix product.

Method Details

__getitem__(self, ij)
(Indexing operator)

Access a matrix by A[i, j] to get entry i, j of A.
Overrides:
sage.linalg.matrix.Matrix.__getitem__

__setitem__(self, ij, value)
(Index assignment operator)

Set entry i,j of self to value.
Overrides:
sage.linalg.matrix.Matrix.__setitem__

get(self, ij)

Like __getitem__ but with no type or bounds checking. Returns 0 if access is out of bounds.
Overrides:
sage.linalg.matrix.Matrix.get

nonzero_positions(self)

Returns the set of pairs (i,j) such that self[i,j] != 0.
Overrides:
sage.linalg.matrix.Matrix.nonzero_positions

set(self, ij, x)

Like __setitem__ but with no type or bounds checking.
Overrides:
sage.linalg.matrix.Matrix.set

submatrix_from_columns(self, columns)

Return the submatrix of self of columns col[i] for i in the list of columns.
Overrides:
sage.linalg.matrix.Matrix.submatrix_from_columns

submatrix_from_rows(self, rows)

Return the submatrix of self of rows row[i] for i in the list of rows.
Overrides:
sage.linalg.matrix.Matrix.submatrix_from_rows

swap_rows(self, r1, r2)

Swap rows r1 and r2 of self.
Overrides:
sage.linalg.matrix.Matrix.swap_rows

transpose(self)

Returns the transpose of self, without changing self. EXAMPLES: We create a matrix, compute its transpose, and note that the original matrix is not changed.
>>> from matrix_space import MatrixSpace
>>> from sage.rings.rings import RationalField
>>> M = MatrixSpace(RationalField(), 2)
>>> A = M([1,2,3,4])
>>> B = A.transpose()
>>> print B
[1 3]
[2 4]

>>> print A
[1 2]
[3 4]
Overrides:
sage.linalg.matrix.Matrix.transpose (inherited documentation)

Generated by Epydoc 2.1 on Mon May 9 17:57:03 2005 http://epydoc.sf.net