Add support for automatic jacobian computation with sparse matrices.