Generic compressed sparse matrix insertion: algorithms and implementations in MTL4 and FEniCS

Sparse matrices are indispensable components of most scientific applications. Nevertheless, there is very little general-purpose software support. With the Matrix Template Library 4 (MTL4) we provide a generic library support for dense and compressed sparse matrices. The first challenge in working with compressed matrices is how to set the nonzero entries in an efficient manner. The implementation in MTL4 does not need any pre-allocation or pre-sorting phase, uses a minimal amount of memory and was in all measures as fast or faster than comparable libraries. We demonstrate the performance on well-defined benchmarks.