Package sage :: Package linalg :: Module sparse_matrix :: Class Sparse_matrix_generic
[show private | hide private]
[frames | no frames]

Type Sparse_matrix_generic

  object --+    
           |    
SparseMatrix --+
               |
              Sparse_matrix_generic

Known Subclasses:
Sparse_matrix_rational

A generic sparse matrix.
Method Summary
  __init__(self, base_ring, nrows, ncols, entries, coerce, sort, copy)
  __add__(self, other)
  __getitem__(self, i)
  __getslice__(self, i, j)
  __neg__(self)
  __repr__(self)
  __rmul__(self, left)
  __sub__(self, right)
  base_ring(self)
  copy(self)
  dense_matrix(self)
todo
  dict(self)
  echelon_form(self, params)
Returns the echelon form of this matrix.
  entries(self)
  list(self)
  matrix_from_columns(self, columns)
Returns the sparse submatrix of self composed of the given list of columns.
  matrix_from_nonpivot_columns(self)
The sparse matrix got by deleted all pivot columns.
  matrix_from_rows(self, rows)
Returns the sparse submatrix of self composed of the given list of rows.
  ncols(self)
  nonpivots(self)
  nrows(self)
  pivots(self)
  randomize(self, sparcity, exact)
  row(self, i)
Return the ith row of this matrix as a sparse vector.
  rows(self)
Return a list of the sparse rows of this matrix.
  scalar_multiple(self, left)
  set_entries(self, entries, coerce, sort, copy)
entries is a list of triples (i,j,x) and the x must be nonzero.
  transpose(self)
Returns the transpose of self.
    Inherited from SparseMatrix
  __new__(cls, base_ring, nrows, ncols, entries, coerce, sort, copy)
(Static method)
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
x.__str__() <==> str(x)

Instance Method Details

dense_matrix(self)

todo

echelon_form(self, params=None)

Returns the echelon form of this matrix.

INPUT:
   params -- ignored.

matrix_from_columns(self, columns)

Returns the sparse submatrix of self composed of the given
list of columns.

INPUT:
    columns -- list of int's
OUTPUT:
    a sparse matrix.

matrix_from_nonpivot_columns(self)

The sparse matrix got by deleted all pivot columns.

matrix_from_rows(self, rows)

Returns the sparse submatrix of self composed of the given
list of rows.

INPUT:
    rows -- list of int's
OUTPUT:
    a sparse matrix.

row(self, i)

Return the ith row of this matrix as a sparse vector.

WARNING: Sparse matrices are stored as a single list of triples (i,j,x), so extracting the i-th row is expensive. This command builds a redundant representation of the matrix as a list of sparse vectors, thus doubling the memory requirement.

rows(self)

Return a list of the sparse rows of this matrix. The ith element of this list is the i-th row of this matrix.

set_entries(self, entries, coerce=True, sort=True, copy=True)

entries is a list of triples (i,j,x) and the x must be nonzero.

This function does *not* check that i and j are in bounds or that the x are all nonzero.

transpose(self)

Returns the transpose of self.

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