general slicing for sparse mats