Initial implementation of the sparse matrix.

@bsoetaer 
Tests pass when the contracts are disabled.
Shouldn't this be different for sparse matrices?