PySparse module overview

Main

Modules

Examples

Project Page

Download

Module Overview

spmatrix

The spmatrix module is the foundation of the PySparse package. It extends the Python interpreter by three new types named ll_mat, csr_mat and sss_mat. These types represent sparse matrices in the LL-, the CSR- and SSS-formats respectively. For all three formats, double precision values (C type double) are used to represent the non-zero entries.

The common way to use the spmatrix module is to first build a matrix in the LL-format. The LL-matrix is manipulated until it has its final shape and content. Afterwards it may be converted to either the CSR- or SSS-format, which needs less memory and allows for fast matrix-vector multiplications. A ll_mat object can be created from scratch, by reading data from a file (in MatrixMarket format) or as a result of matrix operation (as e.g. a matrix-matrix multiplication). The ll_mat object supports manipulating (reading, writing, add-updating) single entries or sub-matrices. csr_mat and sss_mat are not constructed directly, instead they are created by converting ll_mat objects. Once created, csr_mat and sss_mat objects cannot be manipulated. Their purpose is to support efficient matrix-vector multiplications.

itsolvers

The itsolvers module provides a set of iterative methods for solving linear systems of equations. The iterative methods are callable like ordinary Python functions. All these functions expect the same parameter list, and all function return values also follow a common standard. Any user-defined iterative solvers should also follow these conventions, since other PySparse modules rely on them (e.g. the jdsym module)

Currently the itsolvers module contains the following iterative methods: PCG, MINRES, QMRS, BICGSTAB and CGS.

precon

The precon module provides preconditioners, which can be used e.g. for the iterative methods implemented in the in the itsolvers module or the JDSYM eigensolver (in the jdsym module).

In the PySparse framework, any Python object that has the following properties can be used as a preconditioner:

  • a shape attribute, which returns a 2-tuple describing the dimension of the preconditioner, . and a
  • precon method, that accepts two vectors x and y, and applies the preconditioner to x and stores the result in y. Both x and y are double precision, rank-1 NumPy arrays of appropriate size.

The precon module currently implements m-step Jacobi and m-step SSOR preconditioners.

superlu

The superlu module interfaces the SuperLU library to make it usable by Python code. SuperLU is a software package written in C for the direct solution of a linear system of equations. SuperLU computes LU-factorisations of general non-symmetric, sparse matrices with partial pivoting.

jdsym

The jdsym module provides an implementation of the JDSYM algorithm, that is conveniently callable from Python. The JDSYM algorithm computes solutions of large sparse symmetric (genralised or standard) eigenvalue problems. JDSYM is an implementation of the Jacobi-Davidson method, optimised for symmetric matrices.

SourceForge.net Logo Page last modified on Mon Feb 9 09:59:54 2004
Page generated on Mon Feb 9 10:27:14 2004