Saturday, January 12, 2008

announcement: cl-sparsematrix

Lately I have been working on algorithms that solve Hamilton-Bellman-Jacobi equations (that describe optimal control problems in continuous time) using the methods of Kushner and Dupuis, which involve sparse stochastic matrices. The sparse matrix code has stabilized to the point that I cleaned it up today and decided to make it available as a library, in ASDF-installable form. The package is called cl-sparsematrix, and has the following features:
  • generalized sparse matrices: elements don't have to be numbers, but can be any object (eg functions for parametrized sparse matrices), of course you have to define what you mean by zero in this case
  • utility functions for creating, mapping, traversing or copying sparse matrices
  • numerical operations that make sense for numerical sparse matrices (elementwise addition, subtraction and multiplication, row and column sums, multiplication of rows by corresponding elements in a vector, vector-matrix and matrix-vector products)
  • a simple interface for UMFpack for solving sparse systems (uses cffi and ffa)
You will find an introduction to the main concepts in the code as a PDF file in the documentation/ directory. As usual, comments and suggestions are appreciated.