Add more math functions for sparse matrices.