Software‎ > ‎



CSparseJ is a Java port of CSparse (a Concise Sparse matrix package).  CSparse is a small yet feature-rich sparse matrix package written specifically for the book "Direct Methods for Sparse Linear Systems"  by Tim Davis.

The algorithms contained in CSparse have been chosen with five goals in mind:

  • they must embody much of the theory behind sparse matrix algorithms,
  • they must be either asymptotically optimal in their run time and memory usage or be fast in practice,
  • they must be concise so as to be easily understood and short enough to print in the book,
  • they must cover a wide spectrum of matrix operations, and
  • they must be accurate (if it says it gets the right answer, then it does) and robust (it either works, or fails gracefully).
All classes of CSparseJ are implemented in both single and double precision.


CSparseJ 1.0 was benchmarked against CSparse 2.2.3. The timings in the table below are an average among 10 calls of each routine. They do not incorporate the "warm up phase" (first two calls require more time) for Java code.


  • 2 x Quad-Core Intel Xeon X5472 (3GHz, 12MB L2 Cache),
  • 32 GB RAM,
  • Ubuntu 9.04 (64-bit),
  • GCC 4.3.3,
  • Sun Java 1.6.0_14 (64-Bit Server VM),
  • Java flags: -d64 -server -Xms2g -Xmx2g -XX:+UseParallelGC
  • C compiler flags: -O2

Matrix LU (C)
LU (Java)
QR (C)
QR (Java)
Fidapm37 2.10 3.72
6.19 6.04
Rim 10.27 15.33
14.91 14.85

Average execution time (in seconds) for solving a system of linear equations 
using LU and QR factorization with natural ordering.


CSparse: a Concise Sparse matrix package.
Copyright (c) 2006, Timothy A. Davis.
CSparseJ is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
CSparseJ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this Module; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA


The source code distribution, besides Ant build file, contains also Eclipse project files.

version 1.0 (June 13, 2009) Changelog